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.
This commit is contained in:
Daniel Stenberg 2015-05-22 15:17:16 +02:00
parent d04bab8873
commit 84d811f6af

View File

@ -235,6 +235,9 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
} }
stream = data_s->req.protop; stream = data_s->req.protop;
} }
else
/* we do nothing on stream zero */
return 0;
switch(frame->hd.type) { switch(frame->hd.type) {
case NGHTTP2_DATA: case NGHTTP2_DATA: