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
4543f32e21
commit
bbe513dbf8
@ -596,9 +596,11 @@ main(int argc, char *argv[])
|
|||||||
addrcount++;
|
addrcount++;
|
||||||
next += nextifm->ifm_msglen;
|
next += nextifm->ifm_msglen;
|
||||||
}
|
}
|
||||||
strlcpy(name, sdl->sdl_data,
|
memcpy(name, sdl->sdl_data,
|
||||||
sizeof(name) <= sdl->sdl_nlen ?
|
sizeof(name) < sdl->sdl_nlen ?
|
||||||
sizeof(name) : sdl->sdl_nlen + 1);
|
sizeof(name)-1 : sdl->sdl_nlen);
|
||||||
|
name[sizeof(name) < sdl->sdl_nlen ?
|
||||||
|
sizeof(name)-1 : sdl->sdl_nlen] = '\0';
|
||||||
|
|
||||||
if (all || namesonly) {
|
if (all || namesonly) {
|
||||||
if (uponly)
|
if (uponly)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user