Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit dbcda19

Browse files
jbergstroemjasnell
authored andcommitted
Update http-parser to 2.6.2
Fixes a header parsing bug for obstext characters (> 0x80) Adaption of nodejs/node@954a4b4b: Author: James M Snell <[email protected]> Date: Mon Feb 15 09:40:58 2016 -0800 deps: update to http-parser 2.6.2 Fixes http-parser regression with IS_HEADER_CHAR check Add test case for obstext characters (> 0x80) is header PR-URL: nodejs/node#5237 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Myles Borins <[email protected]> PR-URL: #287 Reviewed-By: James M Snell <[email protected]>
1 parent fd65b0f commit dbcda19

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
2222
HELPER ?=
2323
BINEXT ?=
2424
ifeq (darwin,$(PLATFORM))
25-
SONAME ?= libhttp_parser.2.6.1.dylib
25+
SONAME ?= libhttp_parser.2.6.2.dylib
2626
SOEXT ?= dylib
2727
else ifeq (wine,$(PLATFORM))
2828
CC = winegcc
2929
BINEXT = .exe.so
3030
HELPER = wine
3131
else
32-
SONAME ?= libhttp_parser.so.2.6.1
32+
SONAME ?= libhttp_parser.so.2.6.2
3333
SOEXT ?= so
3434
endif
3535

http_parser.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ do { \
123123
FOR##_mark = NULL; \
124124
} \
125125
} while (0)
126-
126+
127127
/* Run the data callback FOR and consume the current byte */
128128
#define CALLBACK_DATA(FOR) \
129129
CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
@@ -440,7 +440,7 @@ enum http_host_state
440440
* character or %x80-FF
441441
**/
442442
#define IS_HEADER_CHAR(ch) \
443-
(ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127))
443+
(ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
444444

445445
#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
446446

http_parser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
/* Also update SONAME in the Makefile whenever you change these. */
2828
#define HTTP_PARSER_VERSION_MAJOR 2
2929
#define HTTP_PARSER_VERSION_MINOR 6
30-
#define HTTP_PARSER_VERSION_PATCH 1
30+
#define HTTP_PARSER_VERSION_PATCH 2
3131

3232
#include <sys/types.h>
3333
#if defined(_WIN32) && !defined(__MINGW32__) && \

0 commit comments

Comments
 (0)