]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http2: only mimic http1 request if there is one 6186/head
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 22 Apr 2021 07:41:30 +0000 (09:41 +0200)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 8 Jun 2021 16:12:13 +0000 (21:42 +0530)
That may not be the case in midstream/async configurations

(cherry picked from commit d00b755b647a69eb4d4a10adb57be45fd4d14c7d)

src/app-layer-http2.c

index 8576697780a5024ab62f30f0703a50885078423d..6285be9dd9d47f51e0373bc732da8b0010f89f24 100644 (file)
@@ -77,6 +77,10 @@ void HTTP2MimicHttp1Request(void *alstate_orig, void *h2s)
     if (h2s == NULL || h1tx == NULL) {
         return;
     }
+    if (h1tx->request_method == NULL) {
+        // may happen if we only got the reply, not the HTTP1 request
+        return;
+    }
 
     rs_http2_tx_set_method(h2s, bstr_ptr(h1tx->request_method), bstr_len(h1tx->request_method));
     rs_http2_tx_set_uri(h2s, bstr_ptr(h1tx->request_uri), bstr_len(h1tx->request_uri));