mirror of
https://github.com/nmap/nmap.git
synced 2026-11-16 12:59:09 +00:00
Fix mismatch between switch condition and case size
On macOS (and probably other BSDs), the sa_family member is 8 bits, so comparing with 0xffff and other 16-bit values overflows. Cast to a wider type to resolve the issue.
This commit is contained in:
parent
6e5eb5f3a9
commit
9369f7a9df
1 changed files with 1 additions and 1 deletions
|
|
@ -302,7 +302,7 @@ addr_ston(const struct sockaddr *sa, struct addr *a)
|
|||
|
||||
memset(a, 0, sizeof(*a));
|
||||
|
||||
switch (sa->sa_family) {
|
||||
switch ((unsigned int)sa->sa_family) {
|
||||
#ifdef HAVE_NET_IF_DL_H
|
||||
# ifdef AF_LINK
|
||||
case AF_LINK:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue