Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 <jasnell@gmail.com>
    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 <info@bnoordhuis.nl>
    Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
    Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
jbergstroem committed Feb 27, 2016
commit f9ea960314cdc3658c5e0b53d3d29abcf59fb73b
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
HELPER ?=
BINEXT ?=
ifeq (darwin,$(PLATFORM))
SONAME ?= libhttp_parser.2.6.1.dylib
SONAME ?= libhttp_parser.2.6.2.dylib
SOEXT ?= dylib
else ifeq (wine,$(PLATFORM))
CC = winegcc
BINEXT = .exe.so
HELPER = wine
else
SONAME ?= libhttp_parser.so.2.6.1
SONAME ?= libhttp_parser.so.2.6.2
SOEXT ?= so
endif

Expand Down
4 changes: 2 additions & 2 deletions http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ do { \
FOR##_mark = NULL; \
} \
} while (0)

/* Run the data callback FOR and consume the current byte */
#define CALLBACK_DATA(FOR) \
CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
Expand Down Expand Up @@ -440,7 +440,7 @@ enum http_host_state
* character or %x80-FF
**/
#define IS_HEADER_CHAR(ch) \
(ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127))
(ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))

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

Expand Down
2 changes: 1 addition & 1 deletion http_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 6
#define HTTP_PARSER_VERSION_PATCH 1
#define HTTP_PARSER_VERSION_PATCH 2

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