summaryrefslogtreecommitdiffstats
path: root/Documentation/mic
diff options
context:
space:
mode:
authorMike Danese <mikedanese@google.com>2016-05-20 00:54:51 -0400
committerJonathan Corbet <corbet@lwn.net>2016-06-03 15:31:37 -0400
commit3610a2add39365a0f153154c60169a66c616d50f (patch)
tree45580c74529d4e1f9ced50f3c7f986a2d8c6617c /Documentation/mic
parentfac8434dab9645905d0f1f6baaa0f2e27daca435 (diff)
mpssd: fix buffer overflow warning
The compilation emits a warning in function ‘snprintf’, inlined from ‘set_cmdline’ at ../Documentation/mic/mpssd/mpssd.c:1541:9: /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: warning: call to __builtin___snprintf_chk will always overflow destination buffer This was introduced in commit f4a66c204482 ("misc: mic: Update MIC host daemon with COSM changes") and is fixed by reverting the changes to the size argument of these snprintf statements. Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Mike Danese <mikedanese@google.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/mic')
-rw-r--r--Documentation/mic/mpssd/mpssd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c
index 30fb842a976d..49db1def1721 100644
--- a/Documentation/mic/mpssd/mpssd.c
+++ b/Documentation/mic/mpssd/mpssd.c
@@ -1538,9 +1538,9 @@ set_cmdline(struct mic_info *mic)
1538 1538
1539 len = snprintf(buffer, PATH_MAX, 1539 len = snprintf(buffer, PATH_MAX,
1540 "clocksource=tsc highres=off nohz=off "); 1540 "clocksource=tsc highres=off nohz=off ");
1541 len += snprintf(buffer + len, PATH_MAX, 1541 len += snprintf(buffer + len, PATH_MAX - len,
1542 "cpufreq_on;corec6_off;pc3_off;pc6_off "); 1542 "cpufreq_on;corec6_off;pc3_off;pc6_off ");
1543 len += snprintf(buffer + len, PATH_MAX, 1543 len += snprintf(buffer + len, PATH_MAX - len,
1544 "ifcfg=static;address,172.31.%d.1;netmask,255.255.255.0", 1544 "ifcfg=static;address,172.31.%d.1;netmask,255.255.255.0",
1545 mic->id + 1); 1545 mic->id + 1);
1546 1546