From: Stephan Bosch Date: Mon, 16 May 2016 16:19:24 +0000 (+0200) Subject: uri-util: The uri_parse_host_name_dns() would segfault if the hostname_r parameter... X-Git-Tag: 2.3.0.rc1~3741 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f95afa9df14bee49d82baa3679fc94ef3a101d92;p=thirdparty%2Fdovecot%2Fcore.git uri-util: The uri_parse_host_name_dns() would segfault if the hostname_r parameter was NULL. --- diff --git a/src/lib/uri-util.c b/src/lib/uri-util.c index bfdc07fc14..b3e33b9c20 100644 --- a/src/lib/uri-util.c +++ b/src/lib/uri-util.c @@ -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; }