]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
uri-util: The uri_parse_host_name_dns() would segfault if the hostname_r parameter...
authorStephan Bosch <stephan@rename-it.nl>
Mon, 16 May 2016 16:19:24 +0000 (18:19 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 16 May 2016 18:32:53 +0000 (21:32 +0300)
src/lib/uri-util.c

index bfdc07fc1474879c8c3b5d546037e11748c79d3e..b3e33b9c20839d3f1d438d56ab477bac16828fa1 100644 (file)
@@ -559,7 +559,8 @@ int uri_parse_host_name_dns(struct uri_parser *parser,
        if ((ret=uri_do_parse_host_name_dns(parser, host_name)) <= 0)
                return ret;
 
-       *host_name_r = str_c(host_name);
+       if (host_name_r != NULL)
+               *host_name_r = str_c(host_name);
        return 1;
 }