host: Properly handle NULL in host_create_from_string[_and_family]

This commit is contained in:
Tobias Brunner
2015-07-27 11:53:26 +02:00
parent 2096d54198
commit 65579569ad
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -354,6 +354,10 @@ host_t *host_create_from_string_and_family(char *string, int family,
struct sockaddr_in6 v6;
} addr;
if (!string)
{
return NULL;
}
if (streq(string, "%any"))
{
return host_create_any_port(family ? family : AF_INET, port);