]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Fixed handling of limits=NULL parameter for http_request_parser_init.
authorStephan Bosch <stephan@rename-it.nl>
Wed, 18 Sep 2013 20:24:02 +0000 (23:24 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Wed, 18 Sep 2013 20:24:02 +0000 (23:24 +0300)
Got messed up in patch queue.

src/lib-http/http-request-parser.c

index 2d8a18e32ad1de187e20838369f9d13a1a106ad8..7151146238343081901afbc66bc6d07c23d3af1e 100644 (file)
@@ -42,15 +42,16 @@ http_request_parser_init(struct istream *input,
 {
        struct http_request_parser *parser;
        struct http_header_limits hdr_limits;
-       uoff_t max_payload_size = limits->max_payload_size;
+       uoff_t max_payload_size;
 
        parser = i_new(struct http_request_parser, 1);
-       parser->max_target_length = limits->max_target_length;
-       
-       if (limits != NULL)
+       if (limits != NULL) {
                hdr_limits = limits->header;
-       else
+               max_payload_size = limits->max_payload_size;
+       } else {
                memset(&hdr_limits, 0, sizeof(hdr_limits));
+               max_payload_size = 0;
+       }
 
        /* substitute default limits */
        if (parser->max_target_length == 0)