mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
dist/tools: fix tunslip6 strncat num param
Cppcheck was (correctly) warning here that concat to strings might result in buffer overflow because the terminating `\0` was not considered. This is fixed here, making the cppcheck suppression also obsolete.
This commit is contained in:
parent
3f811c44db
commit
d7942cd974
2
dist/tools/tunslip/tunslip6.c
vendored
2
dist/tools/tunslip/tunslip6.c
vendored
@ -651,7 +651,7 @@ devopen(const char *dev, int flags)
|
||||
char t[1024];
|
||||
strcpy(t, "/dev/");
|
||||
/* cppcheck-suppress bufferAccessOutOfBounds
|
||||
* reason: seems to be a cppcheck bug */
|
||||
* (reason: seems to be a bug in cppcheck 1.7x) */
|
||||
strncat(t, dev, sizeof(t) - 5);
|
||||
return open(t, flags);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user