Commit bda9af7
Fix: Use snprintf() for device path generation
Compilation warning:
mibgroup/ucd-snmp/diskio_linux.c: In function 'diskio_parse_config_disks':
mibgroup/ucd-snmp/diskio_linux.c:184:5: warning: '__builtin___strncat_chk' output may be truncated copying 1023 bytes from a string of length 1023 [-Wstringop-truncation]
184 | strncat(device, path, STRMAX - 1);
| ^
Use of strncat() is totally insecure for any buffer overruns attacks (see 'man strncat' for details).
Fix it with use more friendly function to string end '\0'.1 parent 3328a67 commit bda9af7
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 180 | + | |
| 181 | + | |
185 | 182 | | |
186 | 183 | | |
187 | 184 | | |
| |||
0 commit comments