]> granicus.if.org Git - apache/commitdiff
Merge r1758446 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 30 Aug 2016 19:24:43 +0000 (19:24 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 30 Aug 2016 19:24:43 +0000 (19:24 +0000)
Without AP_DEBUG_ASSERT, these could still be NULL during runtime

Reviewed/backported by: jim

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

modules/http2/h2_request.c

index 14ddb5466598f7dc76ae45e41b0a58121ea0ccb4..229f17ef87a6e098dc6ffd57749e679e5375207b 100644 (file)
@@ -50,7 +50,7 @@ apr_status_t h2_request_rwrite(h2_request *req, apr_pool_t *pool,
     
     scheme = apr_pstrdup(pool, r->parsed_uri.scheme? r->parsed_uri.scheme
               : ap_http_scheme(r));
-    authority = apr_pstrdup(pool, r->hostname);
+    authority = (r->hostname ? apr_pstrdup(pool, r->hostname) : "");
     if (!ap_strchr_c(authority, ':') && r->server && r->server->port) {
         apr_port_t defport = apr_uri_port_of_scheme(scheme);
         if (defport != r->server->port) {
@@ -250,6 +250,7 @@ request_rec *h2_request_create_rec(const h2_request *req, conn_rec *conn)
     apr_pool_t *p;
     int access_status = HTTP_OK;    
     const char *expect;
+    const char *rpath;
 
     apr_pool_create(&p, conn->pool);
     apr_pool_tag(p, "request");
@@ -310,12 +311,13 @@ request_rec *h2_request_create_rec(const h2_request *req, conn_rec *conn)
         r->header_only = 1;
     }
 
-    ap_parse_uri(r, req->path);
+    rpath = (req->path ? req->path : "");
+    ap_parse_uri(r, rpath);
     r->protocol = "HTTP/2.0";
     r->proto_num = HTTP_VERSION(2, 0);
 
     r->the_request = apr_psprintf(r->pool, "%s %s %s", 
-                                  r->method, req->path, r->protocol);
+                                  r->method, rpath, r->protocol);
     
     /* update what we think the virtual host is based on the headers we've
      * now read. may update status.