Use memcpy plus a manual NUL termination when copying the interface name
from the sdl because strlcpy requires that the source string be NUL-terminated unlike strncpy. Submitted by: Peter Jeremy <PeterJeremy at optushome dot com dot au>
This commit is contained in:
parent
2eed8d0864
commit
ee34d661df
@ -596,9 +596,11 @@ main(int argc, char *argv[])
|
||||
addrcount++;
|
||||
next += nextifm->ifm_msglen;
|
||||
}
|
||||
strlcpy(name, sdl->sdl_data,
|
||||
sizeof(name) <= sdl->sdl_nlen ?
|
||||
sizeof(name) : sdl->sdl_nlen + 1);
|
||||
memcpy(name, sdl->sdl_data,
|
||||
sizeof(name) < sdl->sdl_nlen ?
|
||||
sizeof(name)-1 : sdl->sdl_nlen);
|
||||
name[sizeof(name) < sdl->sdl_nlen ?
|
||||
sizeof(name)-1 : sdl->sdl_nlen] = '\0';
|
||||
|
||||
if (all || namesonly) {
|
||||
if (uponly)
|
||||
|
Loading…
Reference in New Issue
Block a user