mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[mdns] Fix incorrect error check for getaddrinfo (can cause segfault)
Non-zero return from getaddrinfo is an error, so since *ai could be a null pointer when derefenced in the following socket() call.
This commit is contained in:
parent
4ab734343c
commit
6836a0f277
@ -498,7 +498,7 @@ connection_test(int family, const char *address, const char *address_log, int po
|
||||
snprintf(strport, sizeof(strport), "%d", port);
|
||||
|
||||
ret = getaddrinfo(address, strport, &hints, &ai);
|
||||
if (ret < 0)
|
||||
if (ret != 0)
|
||||
{
|
||||
DPRINTF(E_WARN, L_MDNS, "Connection test to %s:%d failed with getaddrinfo error: %s\n", address_log, port, gai_strerror(ret));
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user