mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
BUG/MINOR: http: Missing calloc return value check while parsing redirect rule
A memory allocation failure happening in http_parse_redirect_rule when trying to allocate a redirect_rule structure would have resulted in a crash. This function is only called during configuration parsing. It was raised in GitHub issue #1233. It could be backported to all stable branches.
This commit is contained in:
parent
1f4fa906c7
commit
b6864a5b6f
@ -408,6 +408,10 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st
|
|||||||
}
|
}
|
||||||
|
|
||||||
rule = calloc(1, sizeof(*rule));
|
rule = calloc(1, sizeof(*rule));
|
||||||
|
if (!rule) {
|
||||||
|
memprintf(errmsg, "parsing [%s:%d]: out of memory.", file, linenum);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
rule->cond = cond;
|
rule->cond = cond;
|
||||||
LIST_INIT(&rule->rdr_fmt);
|
LIST_INIT(&rule->rdr_fmt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user