]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: on_frame_recv: return early on stream 0
authorDaniel Stenberg <daniel@haxx.se>
Fri, 22 May 2015 13:17:16 +0000 (15:17 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 May 2015 13:17:16 +0000 (15:17 +0200)
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.

lib/http2.c

index 93182429554f0db6a0da77a96026be3e05471ef8..a56535471ecddb2dc4196ed2d2f163ee6f3f64da 100644 (file)
@@ -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: