From: Olivier Houchard Date: Wed, 21 Nov 2018 12:49:48 +0000 (+0100) Subject: BUG/MEDIUM: http_fetch: Make sure name is initialized before http_find_header. X-Git-Tag: v1.9-dev8~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2c78cd3e8142751ee6d81fc6055955fd129e51b;p=thirdparty%2Fhaproxy.git 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 f8dfe335c9..56c6a2bf90 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;