From: Christophe Jaillet Date: Thu, 5 May 2016 16:12:47 +0000 (+0000) Subject: Avoid a potential NULL pointer deference. X-Git-Tag: 2.5.0-alpha~1648 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bffe35c88032f63dfe1962c2709181941335899;p=thirdparty%2Fapache%2Fhttpd.git Avoid a potential NULL pointer deference. Not sure this can happen, but the tests in this function handle such a case, so they should handle it correctly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1742444 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_mplx.c b/modules/http2/h2_mplx.c index 9a840e15670..5c2ecbc6260 100644 --- a/modules/http2/h2_mplx.c +++ b/modules/http2/h2_mplx.c @@ -764,12 +764,17 @@ apr_status_t h2_mplx_out_open(h2_mplx *m, int stream_id, h2_response *response) static apr_status_t out_close(h2_mplx *m, h2_task *task) { apr_status_t status = APR_SUCCESS; - h2_stream *stream = h2_ihash_get(m->streams, task->stream_id); + h2_stream *stream; - if (!task || !stream) { + if (!task) { return APR_ECONNABORTED; } - + + stream = h2_ihash_get(m->streams, task->stream_id); + if (!stream) { + return APR_ECONNABORTED; + } + if (!task->response && !task->rst_error) { /* In case a close comes before a response was created, * insert an error one so that our streams can properly