mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MEDIUM: map: segmentation fault with the stats's socket command "set map ..."
The value of the variable "appctx->ctx.map.ent" is used after the loop, but its value has changed. The variable "value" is initialized and contains the good value. This is a recent bug, no backport is needed.
This commit is contained in:
parent
2317976daa
commit
410f8101ae
@ -1455,7 +1455,7 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
|
|||||||
else if (strcmp(args[1], "map") == 0) {
|
else if (strcmp(args[1], "map") == 0) {
|
||||||
struct pattern *pat_elt;
|
struct pattern *pat_elt;
|
||||||
struct pat_idx_elt *idx_elt;
|
struct pat_idx_elt *idx_elt;
|
||||||
char *value;
|
char *value = NULL;
|
||||||
|
|
||||||
/* Expect three parameters: map name, key and new value. */
|
/* Expect three parameters: map name, key and new value. */
|
||||||
if (!*args[2] || !*args[3] || !*args[4]) {
|
if (!*args[2] || !*args[3] || !*args[4]) {
|
||||||
@ -1506,9 +1506,9 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
|
|||||||
stats_map_lookup_next(si)) {
|
stats_map_lookup_next(si)) {
|
||||||
pattern_lookup(args[3], appctx->ctx.map.desc->pat, &pat_elt, &idx_elt, NULL);
|
pattern_lookup(args[3], appctx->ctx.map.desc->pat, &pat_elt, &idx_elt, NULL);
|
||||||
if (pat_elt != NULL)
|
if (pat_elt != NULL)
|
||||||
appctx->ctx.map.desc->parse(appctx->ctx.map.ent->value, pat_elt->smp);
|
appctx->ctx.map.desc->parse(value, pat_elt->smp);
|
||||||
if (idx_elt != NULL)
|
if (idx_elt != NULL)
|
||||||
appctx->ctx.map.desc->parse(appctx->ctx.map.ent->value, idx_elt->smp);
|
appctx->ctx.map.desc->parse(value, idx_elt->smp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The set is done, send message. */
|
/* The set is done, send message. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user