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
d9a83430ee
commit
7c57814bdc
@ -321,9 +321,9 @@ retry:
|
||||
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…
x
Reference in New Issue
Block a user