From: Timo Sirainen Date: Wed, 3 Aug 2022 09:23:09 +0000 (+0300) Subject: lib-http: Fix unlimited size parameters for i_stream_create_limit() X-Git-Tag: 2.4.0~3722 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d233f22dff700d02fa0c4c7d068027b1e7c02703;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Fix unlimited size parameters for i_stream_create_limit() The type is uoff_t, not size_t, so the value should be UOFF_T_MAX. --- diff --git a/src/lib-http/http-message-parser.c b/src/lib-http/http-message-parser.c index a42bddde1f..46123ce5c2 100644 --- a/src/lib-http/http-message-parser.c +++ b/src/lib-http/http-message-parser.c @@ -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; }