Message ID | 20250323143111.79886-1-kendra.j.moore3443@gmail.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Len Brown |
Headers | show |
Series | Replace strncpy with strscpy to ensure null-termination | expand |
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 8d5011a0bf60..8f24e18d3de0 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -9345,7 +9345,7 @@ int pmt_add_counter(unsigned int guid, unsigned int seq, const char *name, enum } if (new_counter) { - strncpy(pcounter->name, name, ARRAY_SIZE(pcounter->name) - 1); + strscpy(pcounter->name, name, ARRAY_SIZE(pcounter->name)); pcounter->type = type; pcounter->scope = scope; pcounter->lsb = lsb;