sed_https(): Update the last https header after running sed()
authorFabian Keil <fk@fabiankeil.de>
Tue, 14 Apr 2020 12:15:56 +0000 (14:15 +0200)
committerFabian Keil <fk@fabiankeil.de>
Tue, 14 Apr 2020 12:33:41 +0000 (14:33 +0200)
This is necessary because addtional header may have been added.

Fixes a crash triggered by an assertion.

Reported by:  Nedžad Hrnjica
Sponsored by: Robert Klemme

parsers.c

index 45b4c3b..70f368f 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1231,6 +1231,12 @@ jb_err sed_https(struct client_state *csp)
    err = sed(csp, FILTER_CLIENT_HEADERS);
    csp->flags |= CSP_FLAG_CLIENT_HEADER_PARSING_DONE;
 
+   /*
+    * Update the last header which may have changed
+    * due to header additions,
+    */
+   csp->https_headers->last = csp->headers->last;
+
    csp->headers->first = headers.first;
    csp->headers->last  = headers.last;