Fix an off-by-one which could mean writing beyond the end of the array
when copying the interface name. This code part should probably be rewritten.
This commit is contained in:
parent
5583491044
commit
3ca72aeb09
@ -321,9 +321,9 @@ main(int argc, char *argv[])
|
||||
next += nextifm->ifm_msglen;
|
||||
}
|
||||
memcpy(name, sdl->sdl_data,
|
||||
sizeof(name) < sdl->sdl_nlen ?
|
||||
sizeof(name) <= sdl->sdl_nlen ?
|
||||
sizeof(name)-1 : sdl->sdl_nlen);
|
||||
name[sizeof(name) < sdl->sdl_nlen ?
|
||||
name[sizeof(name) <= sdl->sdl_nlen ?
|
||||
sizeof(name)-1 : sdl->sdl_nlen] = '\0';
|
||||
|
||||
if (all || namesonly) {
|
||||
|
Loading…
Reference in New Issue
Block a user