mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 16:17:09 +02:00
BUG/MEDIUM: http: fix the url_param fetch
The "name" and "name_len" arguments in function "smp_fetch_url_param"
could be left uninitialized for subsequent calls.
[wt: no backport needed, this is an 1.6 regression introduced by
commit 4fdc74c
("MINOR: http: split the url_param in two parts") ]
This commit is contained in:
parent
726ab7145c
commit
26f77e534c
@ -11762,15 +11762,11 @@ smp_fetch_url_param(const struct arg *args, struct sample *smp, const char *kw,
|
|||||||
const char *name;
|
const char *name;
|
||||||
int name_len;
|
int name_len;
|
||||||
|
|
||||||
if (!smp->ctx.a[0]) { // first call, find the query string
|
|
||||||
if (!args ||
|
if (!args ||
|
||||||
(args[0].type && args[0].type != ARGT_STR) ||
|
(args[0].type && args[0].type != ARGT_STR) ||
|
||||||
(args[1].type && args[1].type != ARGT_STR))
|
(args[1].type && args[1].type != ARGT_STR))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (args[1].type)
|
|
||||||
delim = *args[1].data.str.str;
|
|
||||||
|
|
||||||
name = "";
|
name = "";
|
||||||
name_len = 0;
|
name_len = 0;
|
||||||
if (args->type == ARGT_STR) {
|
if (args->type == ARGT_STR) {
|
||||||
@ -11778,6 +11774,10 @@ smp_fetch_url_param(const struct arg *args, struct sample *smp, const char *kw,
|
|||||||
name_len = args->data.str.len;
|
name_len = args->data.str.len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args[1].type)
|
||||||
|
delim = *args[1].data.str.str;
|
||||||
|
|
||||||
|
if (!smp->ctx.a[0]) { // first call, find the query string
|
||||||
CHECK_HTTP_MESSAGE_FIRST();
|
CHECK_HTTP_MESSAGE_FIRST();
|
||||||
|
|
||||||
msg = &smp->strm->txn->req;
|
msg = &smp->strm->txn->req;
|
||||||
|
Loading…
Reference in New Issue
Block a user