dovecot-2.2: lib-http: http-url: Fixed return of proper error me...

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 18 23:24:48 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/8442a0dc44b7
changeset: 16766:8442a0dc44b7
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Wed Sep 18 23:24:11 2013 +0300
description:
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.

diffstat:

 src/lib-http/http-url.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 34d3a9a883fa -r 8442a0dc44b7 src/lib-http/http-url.c
--- a/src/lib-http/http-url.c	Wed Sep 18 23:24:02 2013 +0300
+++ b/src/lib-http/http-url.c	Wed Sep 18 23:24:11 2013 +0300
@@ -370,12 +370,12 @@
 	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;
 	}
 


More information about the dovecot-cvs mailing list