mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-27 21:00:07 +01:00
Avoid a null dereference if IFF_BROADCAST is set but there is no broadcast address
It seems that the getifaddrs() function can return interfaces with
IFF_BROADCAST & IFF_UP set, but no broadcast address (at least
under Cygwin 1.7, this seems to happen for v6 mapped v4 addresses)
Avoid a null dereference if this ever happens
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
(cherry picked from commit 28eb61fc04)
This commit is contained in:
parent
71f4b404c0
commit
2b9ad70196
1 changed files with 2 additions and 1 deletions
|
|
@ -811,7 +811,8 @@ DefineSelf (int fd)
|
|||
continue;
|
||||
#endif
|
||||
if ((ifr->ifa_flags & IFF_BROADCAST) &&
|
||||
(ifr->ifa_flags & IFF_UP))
|
||||
(ifr->ifa_flags & IFF_UP) &&
|
||||
ifr->ifa_broadaddr)
|
||||
broad_addr = *ifr->ifa_broadaddr;
|
||||
else
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue