BUG/MEDIUM: http_fetch: Make sure name is initialized before http_find_header.
Before calling http_find_header, make sure name is initialized properly, or
its value would be random.
diff --git a/src/http_fetch.c b/src/http_fetch.c
index f8dfe33..56c6a2b 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -1165,6 +1165,9 @@
if (args && args->type == ARGT_STR) {
name.ptr = args->data.str.area;
name.len = args->data.str.data;
+ } else {
+ name.ptr = NULL;
+ name.len = 0;
}
ctx.blk = NULL;
@@ -1390,6 +1393,9 @@
if (args && args->type == ARGT_STR) {
name.ptr = args->data.str.area;
name.len = args->data.str.data;
+ } else {
+ name.ptr = NULL;
+ name.len = 0;
}
ctx.blk = NULL;