Skip to content

Commit

Permalink
http2: on_frame_recv: return early on stream 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bagder committed May 22, 2015
1 parent d04bab8 commit 84d811f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/http2.c
Expand Up @@ -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:
Expand Down

0 comments on commit 84d811f

Please sign in to comment.