From: Stephan Bosch Date: Wed, 18 Sep 2013 20:24:11 +0000 (+0300) Subject: lib-http: http-url: Fixed return of proper error message in case of a failure to... X-Git-Tag: 2.2.6~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1490e4e923be08022fe68371251bda7980c63bc3;p=thirdparty%2Fdovecot%2Fcore.git lib-http: http-url: Fixed return of proper error message in case of a failure to parse request target Host header. Assigned the error to the parser object rather than returning it directly. --- diff --git a/src/lib-http/http-url.c b/src/lib-http/http-url.c index 37f13dd89f..3236720e97 100644 --- a/src/lib-http/http-url.c +++ b/src/lib-http/http-url.c @@ -370,12 +370,12 @@ int http_url_request_target_parse(const char *request_target, uri_parser_init(parser, pool, host_header); if (uri_parse_authority(parser, &host) <= 0) { - parser->error = t_strdup_printf("Invalid Host header: %s", parser->error); + *error_r = t_strdup_printf("Invalid Host header: %s", parser->error); return -1; } if (parser->cur != parser->end || host.enc_userinfo != NULL) { - parser->error = "Invalid Host header: Contains invalid character"; + *error_r = "Invalid Host header: Contains invalid character"; return -1; }