Message ID | 20250403210637.1c477d4a@gandalf.local.home (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | tracing: Always use memcpy() in histogram add_to_key() | expand |
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index c1ea6aaac182..4258324219ca 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -5224,10 +5224,8 @@ static inline void add_to_key(char *compound_key, void *key, /* ensure NULL-termination */ if (size > key_field->size - 1) size = key_field->size - 1; - - strncpy(compound_key + key_field->offset, (char *)key, size); - } else - memcpy(compound_key + key_field->offset, key, size); + } + memcpy(compound_key + key_field->offset, key, size); } static void