]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Fix unlimited size parameters for i_stream_create_limit()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Aug 2022 09:23:09 +0000 (12:23 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Aug 2022 13:43:16 +0000 (16:43 +0300)
The type is uoff_t, not size_t, so the value should be UOFF_T_MAX.

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

index a42bddde1f4c6c89ec33e4aecc62ed3a5a7d7698..46123ce5c2fb2e22118731a8dbd6af7e511acc8f 100644 (file)
@@ -561,7 +561,7 @@ http_message_parse_body_encoded(struct http_message_parser *parser,
                /* FIXME: enforce max payload size (relevant to http-client
                   only) */
                parser->payload =
-                       i_stream_create_limit(parser->input, SIZE_MAX);
+                       i_stream_create_limit(parser->input, UOFF_T_MAX);
        } else {
                /* RFC 7230, Section 3.3.3: Message Body Length
 
@@ -631,7 +631,7 @@ static int http_message_parse_body_closed(struct http_message_parser *parser)
         */
        // FIXME: enforce max payload size (relevant to http-client only)
        // FIXME: handle request case correctly.
-       parser->payload = i_stream_create_limit(parser->input, SIZE_MAX);
+       parser->payload = i_stream_create_limit(parser->input, UOFF_T_MAX);
        return 0;
 }