mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-16 18:25:08 -06:00
virGetHostnameLocalhost: avoid FP NULL-ptr-deref from clang
* src/util/util.c (virGetHostnameLocalhost): Add an sa_assert to tell clang it's ok to dereference "info" after a non-failing getaddrinfo call.
This commit is contained in:
parent
b6719eab9e
commit
6e2f811443
@ -2394,6 +2394,9 @@ char *virGetHostnameLocalhost(int allow_localhost)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tell static analyzers about getaddrinfo semantics. */
|
||||||
|
sa_assert (info);
|
||||||
|
|
||||||
/* if we aren't allowing localhost, then we iterate through the
|
/* if we aren't allowing localhost, then we iterate through the
|
||||||
* list and make sure none of the IPv4 addresses are 127.0.0.1 and
|
* list and make sure none of the IPv4 addresses are 127.0.0.1 and
|
||||||
* that none of the IPv6 addresses are ::1
|
* that none of the IPv6 addresses are ::1
|
||||||
|
Loading…
Reference in New Issue
Block a user