httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1742444 - /httpd/httpd/trunk/modules/http2/h2_mplx.c
Date Thu, 05 May 2016 16:12:48 GMT
Author: jailletc36
Date: Thu May  5 16:12:47 2016
New Revision: 1742444

URL: http://svn.apache.org/viewvc?rev=1742444&view=rev
Log:
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.

Modified:
    httpd/httpd/trunk/modules/http2/h2_mplx.c

Modified: httpd/httpd/trunk/modules/http2/h2_mplx.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_mplx.c?rev=1742444&r1=1742443&r2=1742444&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_mplx.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_mplx.c Thu May  5 16:12:47 2016
@@ -764,12 +764,17 @@ apr_status_t h2_mplx_out_open(h2_mplx *m
 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



Mime
View raw message