We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4108d14 commit 212f07aCopy full SHA for 212f07a
arch/x86/kernel/apic/x2apic_uv_x.c
@@ -294,8 +294,7 @@ static void __init early_get_apic_socketid_shift(void)
294
295
static void __init uv_stringify(int len, char *to, char *from)
296
{
297
- /* Relies on 'to' being NULL chars so result will be NULL terminated */
298
- strncpy(to, from, len-1);
+ strscpy(to, from, len);
299
300
/* Trim trailing spaces */
301
(void)strim(to);
@@ -1013,7 +1012,7 @@ static void __init calc_mmioh_map(enum mmioh_arch index,
1013
1012
1014
/* One (UV2) mapping */
1015
if (index == UV2_MMIOH) {
1016
- strncpy(id, "MMIOH", sizeof(id));
+ strscpy(id, "MMIOH", sizeof(id));
1017
max_io = max_pnode;
1018
mapped = 0;
1019
goto map_exit;
0 commit comments