提交 6e2f8114 编写于 作者: J Jim Meyering

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.
上级 b6719eab
......@@ -2394,6 +2394,9 @@ char *virGetHostnameLocalhost(int allow_localhost)
return NULL;
}
/* Tell static analyzers about getaddrinfo semantics. */
sa_assert (info);
/* 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
* that none of the IPv6 addresses are ::1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册