]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-url: Fixed return of proper error message in case of a failure to...
authorStephan Bosch <stephan@rename-it.nl>
Wed, 18 Sep 2013 20:24:11 +0000 (23:24 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Wed, 18 Sep 2013 20:24:11 +0000 (23:24 +0300)
Assigned the error to the parser object rather than returning it directly.

src/lib-http/http-url.c

index 37f13dd89f1bfb5bb51c748e023f12b86ecd325e..3236720e97cb8ce5ffce35b435609b293b71c1bb 100644 (file)
@@ -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;
        }