]> granicus.if.org Git - apache/commitdiff
Avoid a potential NULL pointer deference.
authorChristophe Jaillet <jailletc36@apache.org>
Thu, 5 May 2016 16:12:47 +0000 (16:12 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Thu, 5 May 2016 16:12:47 +0000 (16:12 +0000)
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

modules/http2/h2_mplx.c

index 9a840e156709e4799e66f3cf4615886b1087e7e1..5c2ecbc626077771a6546afb3f8ba07c3f6e04fc 100644 (file)
@@ -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