]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_proxy_http2: fixing a potential NULL pointer use in logging.
authorStefan Eissing <icing@apache.org>
Tue, 2 Jul 2019 11:11:08 +0000 (11:11 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 2 Jul 2019 11:11:08 +0000 (11:11 +0000)
     [Christophe Jaillet <christophe.jaillet wanadoo.fr>, Dr Silvio Cesare InfoSect]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1862418 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http2/h2_proxy_session.c
modules/http2/h2_proxy_util.c

diff --git a/CHANGES b/CHANGES
index 9cb41a6cdef469f83a05b602b10f8ac5e4471d37..be97a1b63a3a5dfb017b84728291caad22998b80 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.40
 
+  *) mod_proxy_http2: fixing a potential NULL pointer use in logging.
+     [Christophe Jaillet <christophe.jaillet wanadoo.fr>, Dr Silvio Cesare InfoSect]
+
   *) mod_dav: Reduce the amount of memory needed when doing PROPFIND's on large
      collections by improving the memory management. [Joe Orton, Ruediger Pluem]
 
index 4b852bf366fcefe51cacddaa4319a4c48dde277f..3246ce1af48bbb5eb001cfb11a6ee811b3bdcb86 100644 (file)
@@ -494,8 +494,8 @@ static ssize_t stream_request_data(nghttp2_session *ngh2, int32_t stream_id,
     stream = nghttp2_session_get_stream_user_data(ngh2, stream_id);
     if (!stream) {
         ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(03361)
-                     "h2_proxy_stream(%s): data_read, stream %d not found", 
-                     stream->session->id, stream_id);
+                     "h2_proxy_stream(NULL): data_read, stream %d not found", 
+                     stream_id);
         return NGHTTP2_ERR_CALLBACK_FAILURE;
     }
     
@@ -1443,7 +1443,7 @@ run_loop:
                 ap_log_cerror(APLOG_MARK, APLOG_TRACE3, status, session->c, 
                               APLOGNO(03365)
                               "h2_proxy_session(%s): WAIT read, timeout=%fms", 
-                              session->id, (float)session->wait_timeout/1000.0);
+                              session->id, session->wait_timeout/1000.0);
                 if (status == APR_SUCCESS) {
                     have_read = 1;
                     dispatch_event(session, H2_PROXYS_EV_DATA_READ, 0, NULL);
index c291193d2ef46af6b1fc7d0ba15d8652e4c5d5da..1e6cb277b0c1919acb5fd5a86c6a3f77762b3082 100644 (file)
@@ -937,12 +937,12 @@ static size_t subst_str(link_ctx *ctx, int start, int end, const char *ns)
     nlen = (int)strlen(ns);
     delta = nlen - olen;
     plen = ctx->slen + delta + 1;
-    p = apr_pcalloc(ctx->pool, plen);
+    p = apr_palloc(ctx->pool, plen);
     memcpy(p, ctx->s, start);
     memcpy(p + start, ns, nlen);
     strcpy(p + start + nlen, ctx->s + end);
     ctx->s = p;
-    ctx->slen = (int)strlen(p);
+    ctx->slen = plen - 1;   /* (int)strlen(p) */
     if (ctx->i >= end) {
         ctx->i += delta;
     }