deps: update http_parser to 2.2.1
Main changes: * Fixed content-length and chunk-size overflow test
This commit is contained in:
parent
657cd2c4e5
commit
597eb6a5ae
13
deps/http_parser/.gitignore
vendored
13
deps/http_parser/.gitignore
vendored
@ -12,3 +12,16 @@ parsertrace_g
|
|||||||
*.Makefile
|
*.Makefile
|
||||||
*.so.*
|
*.so.*
|
||||||
*.a
|
*.a
|
||||||
|
|
||||||
|
|
||||||
|
# Visual Studio uglies
|
||||||
|
*.suo
|
||||||
|
*.sln
|
||||||
|
*.vcxproj
|
||||||
|
*.vcxproj.filters
|
||||||
|
*.vcxproj.user
|
||||||
|
*.opensdf
|
||||||
|
*.ncrunchsolution*
|
||||||
|
*.sdf
|
||||||
|
*.vsp
|
||||||
|
*.psess
|
||||||
|
2
deps/http_parser/AUTHORS
vendored
2
deps/http_parser/AUTHORS
vendored
@ -45,3 +45,5 @@ Chris Dickinson <christopher.s.dickinson@gmail.com>
|
|||||||
Uli Köhler <ukoehler@btronik.de>
|
Uli Köhler <ukoehler@btronik.de>
|
||||||
Charlie Somerville <charlie@charliesomerville.com>
|
Charlie Somerville <charlie@charliesomerville.com>
|
||||||
Fedor Indutny <fedor.indutny@gmail.com>
|
Fedor Indutny <fedor.indutny@gmail.com>
|
||||||
|
runner <runner.mei@gmail.com>
|
||||||
|
Alexis Campailla <alexis@janeasystems.com>
|
||||||
|
2
deps/http_parser/Makefile
vendored
2
deps/http_parser/Makefile
vendored
@ -19,7 +19,7 @@
|
|||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
||||||
SONAME ?= libhttp_parser.so.2.2
|
SONAME ?= libhttp_parser.so.2.2.1
|
||||||
|
|
||||||
CC?=gcc
|
CC?=gcc
|
||||||
AR?=ar
|
AR?=ar
|
||||||
|
8
deps/http_parser/http_parser.c
vendored
8
deps/http_parser/http_parser.c
vendored
@ -1509,8 +1509,8 @@ size_t http_parser_execute (http_parser *parser,
|
|||||||
t *= 10;
|
t *= 10;
|
||||||
t += ch - '0';
|
t += ch - '0';
|
||||||
|
|
||||||
/* Overflow? */
|
/* Overflow? Test against a conservative limit for simplicity. */
|
||||||
if (t < parser->content_length || t == ULLONG_MAX) {
|
if ((ULLONG_MAX - 10) / 10 < parser->content_length) {
|
||||||
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -1782,8 +1782,8 @@ size_t http_parser_execute (http_parser *parser,
|
|||||||
t *= 16;
|
t *= 16;
|
||||||
t += unhex_val;
|
t += unhex_val;
|
||||||
|
|
||||||
/* Overflow? */
|
/* Overflow? Test against a conservative limit for simplicity. */
|
||||||
if (t < parser->content_length || t == ULLONG_MAX) {
|
if ((ULLONG_MAX - 16) / 16 < parser->content_length) {
|
||||||
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
2
deps/http_parser/http_parser.h
vendored
2
deps/http_parser/http_parser.h
vendored
@ -27,7 +27,7 @@ extern "C" {
|
|||||||
/* Also update SONAME in the Makefile whenever you change these. */
|
/* Also update SONAME in the Makefile whenever you change these. */
|
||||||
#define HTTP_PARSER_VERSION_MAJOR 2
|
#define HTTP_PARSER_VERSION_MAJOR 2
|
||||||
#define HTTP_PARSER_VERSION_MINOR 2
|
#define HTTP_PARSER_VERSION_MINOR 2
|
||||||
#define HTTP_PARSER_VERSION_PATCH 0
|
#define HTTP_PARSER_VERSION_PATCH 1
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
|
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
|
||||||
|
4
deps/http_parser/test.c
vendored
4
deps/http_parser/test.c
vendored
@ -2938,7 +2938,7 @@ test_header_content_length_overflow_error (void)
|
|||||||
"HTTP/1.1 200 OK\r\n" \
|
"HTTP/1.1 200 OK\r\n" \
|
||||||
"Content-Length: " #size "\r\n" \
|
"Content-Length: " #size "\r\n" \
|
||||||
"\r\n"
|
"\r\n"
|
||||||
const char a[] = X(18446744073709551614); /* 2^64-2 */
|
const char a[] = X(1844674407370955160); /* 2^64 / 10 - 1 */
|
||||||
const char b[] = X(18446744073709551615); /* 2^64-1 */
|
const char b[] = X(18446744073709551615); /* 2^64-1 */
|
||||||
const char c[] = X(18446744073709551616); /* 2^64 */
|
const char c[] = X(18446744073709551616); /* 2^64 */
|
||||||
#undef X
|
#undef X
|
||||||
@ -2956,7 +2956,7 @@ test_chunk_content_length_overflow_error (void)
|
|||||||
"\r\n" \
|
"\r\n" \
|
||||||
#size "\r\n" \
|
#size "\r\n" \
|
||||||
"..."
|
"..."
|
||||||
const char a[] = X(FFFFFFFFFFFFFFFE); /* 2^64-2 */
|
const char a[] = X(FFFFFFFFFFFFFFE); /* 2^64 / 16 - 1 */
|
||||||
const char b[] = X(FFFFFFFFFFFFFFFF); /* 2^64-1 */
|
const char b[] = X(FFFFFFFFFFFFFFFF); /* 2^64-1 */
|
||||||
const char c[] = X(10000000000000000); /* 2^64 */
|
const char c[] = X(10000000000000000); /* 2^64 */
|
||||||
#undef X
|
#undef X
|
||||||
|
Loading…
x
Reference in New Issue
Block a user