From e2c78cd3e8142751ee6d81fc6055955fd129e51b Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Wed, 21 Nov 2018 13:49:48 +0100 Subject: [PATCH] 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. --- src/http_fetch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/http_fetch.c b/src/http_fetch.c index f8dfe335c..56c6a2bf9 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -1165,6 +1165,9 @@ static int smp_fetch_fhdr_cnt(const struct arg *args, struct sample *smp, const 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 @@ static int smp_fetch_hdr_cnt(const struct arg *args, struct sample *smp, const c 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; -- 2.47.3