diff --git a/http_parser.c b/http_parser.c index 1affebae..d6b1b184 100644 --- a/http_parser.c +++ b/http_parser.c @@ -638,6 +638,7 @@ size_t http_parser_execute (http_parser *parser, ch = *p; if (PARSING_HEADER(parser->state)) { + ++parser->boundary; ++parser->nread; /* Buffer overflow attack */ if (parser->nread > HTTP_MAX_HEADER_SIZE) { @@ -1902,6 +1903,7 @@ http_parser_init (http_parser *parser, enum http_parser_type t) parser->data = data; parser->type = t; parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res)); + parser->boundary = 0; parser->http_errno = HPE_OK; } diff --git a/http_parser.h b/http_parser.h index 6c9f839f..fcc98ce1 100644 --- a/http_parser.h +++ b/http_parser.h @@ -212,6 +212,7 @@ struct http_parser { uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */ /** READ-ONLY **/ + uint32_t boundary; unsigned short http_major; unsigned short http_minor; unsigned short status_code; /* responses only */