]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
headers: clear (possibly) lingering pointer in init
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 May 2023 07:56:51 +0000 (09:56 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 12 May 2023 15:48:20 +0000 (17:48 +0200)
The "prevhead" pointer is used for the headers storage but was not
cleared correctly in init, which made it possible to act up when a
handle is reused.

Reported-by: Steve Herrell
Fixes #11101
Closes #11103

lib/headers.c

index 6cd7e317032f8c2fc50198ba225ef21f4739019c..457ed63eda6d9230d2ffdb1ab41f7db21402a5f3 100644 (file)
@@ -336,6 +336,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header,
 static void headers_init(struct Curl_easy *data)
 {
   Curl_llist_init(&data->state.httphdrs, NULL);
+  data->state.prevhead = NULL;
 }
 
 /*