summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-05-22 15:17:16 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-22 15:17:16 +0200
commit84d811f6af15f9e3ce39f8603e6a2dacf7cdbcba (patch)
tree19aed15ab80586c06e7fe728b7d95b674fd98142
parentd04bab8873e45a59d71e146409035ba151bc877a (diff)
downloadgnurl-84d811f6af15f9e3ce39f8603e6a2dacf7cdbcba.tar.gz
gnurl-84d811f6af15f9e3ce39f8603e6a2dacf7cdbcba.tar.bz2
gnurl-84d811f6af15f9e3ce39f8603e6a2dacf7cdbcba.zip
http2: on_frame_recv: return early on stream 0
Coverity CID 1299426 warned about possible NULL dereference otherwise, but that would only ever happen if we get invalid HTTP/2 data with frames for stream 0. Avoid this risk by returning early when stream 0 is used.
-rw-r--r--lib/http2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 931824295..a56535471 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -235,6 +235,9 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
}
stream = data_s->req.protop;
}
+ else
+ /* we do nothing on stream zero */
+ return 0;
switch(frame->hd.type) {
case NGHTTP2_DATA: