Skip to content

Commit 65ed321

Browse files
jasnellevanlucas
authored andcommitted
deps: update to nghttp2 1.32.0
This fixes CVE-2018-1000168. PR-URL: https://github.com/nodejs-private/node-private/pull/124 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
1 parent 828159f commit 65ed321

File tree

6 files changed

+126
-50
lines changed

6 files changed

+126
-50
lines changed

deps/nghttp2/lib/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ target_include_directories(nghttp2 INTERFACE
4949
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
5050
)
5151

52-
if(HAVE_CUNIT)
52+
if(HAVE_CUNIT OR ENABLE_STATIC_LIB)
5353
# Static library (for unittests because of symbol visibility)
5454
add_library(nghttp2_static STATIC ${NGHTTP2_SOURCES})
5555
set_target_properties(nghttp2_static PROPERTIES
@@ -58,6 +58,10 @@ if(HAVE_CUNIT)
5858
ARCHIVE_OUTPUT_NAME nghttp2
5959
)
6060
target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB")
61+
if(ENABLE_STATIC_LIB)
62+
install(TARGETS nghttp2_static
63+
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
64+
endif()
6165
endif()
6266

6367
install(TARGETS nghttp2

deps/nghttp2/lib/includes/nghttp2/nghttp2.h

+10
Original file line numberDiff line numberDiff line change
@@ -3081,6 +3081,16 @@ NGHTTP2_EXTERN int
30813081
nghttp2_session_set_stream_user_data(nghttp2_session *session,
30823082
int32_t stream_id, void *stream_user_data);
30833083

3084+
/**
3085+
* @function
3086+
*
3087+
* Sets |user_data| to |session|, overwriting the existing user data
3088+
* specified in `nghttp2_session_client_new()`, or
3089+
* `nghttp2_session_server_new()`.
3090+
*/
3091+
NGHTTP2_EXTERN void nghttp2_session_set_user_data(nghttp2_session *session,
3092+
void *user_data);
3093+
30843094
/**
30853095
* @function
30863096
*

deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
* @macro
3030
* Version number of the nghttp2 library release
3131
*/
32-
#define NGHTTP2_VERSION "1.29.0"
32+
#define NGHTTP2_VERSION "1.32.0"
3333

3434
/**
3535
* @macro
3636
* Numerical representation of the version number of the nghttp2 library
3737
* release. This is a 24 bit number with 8 bits for major number, 8 bits
3838
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
3939
*/
40-
#define NGHTTP2_VERSION_NUM 0x011d00
40+
#define NGHTTP2_VERSION_NUM 0x012000
4141

4242
#endif /* NGHTTP2VER_H */

deps/nghttp2/lib/nghttp2_frame.c

+3
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ void nghttp2_frame_altsvc_free(nghttp2_extension *frame, nghttp2_mem *mem) {
215215
nghttp2_ext_altsvc *altsvc;
216216

217217
altsvc = frame->payload;
218+
if (altsvc == NULL) {
219+
return;
220+
}
218221
/* We use the same buffer for altsvc->origin and
219222
altsvc->field_value. */
220223
nghttp2_mem_free(mem, altsvc->origin);

deps/nghttp2/lib/nghttp2_http.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static int http_response_on_header(nghttp2_stream *stream, nghttp2_hd_nv *nv,
244244
return NGHTTP2_ERR_HTTP_HEADER;
245245
}
246246
stream->status_code = (int16_t)parse_uint(nv->value->base, nv->value->len);
247-
if (stream->status_code == -1) {
247+
if (stream->status_code == -1 || stream->status_code == 101) {
248248
return NGHTTP2_ERR_HTTP_HEADER;
249249
}
250250
break;

0 commit comments

Comments
 (0)