mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-05 04:56:10 +02:00
BUG/MINOR: proxy: Missing calloc return value check in proxy_parse_declare
A memory allocation failure happening during proxy_parse_declare while processing the "capture" keyword and allocating a cap_hdr 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
a4bf8a059d
commit
55ba0d6865
@ -756,6 +756,10 @@ static int proxy_parse_declare(char **args, int section, struct proxy *curpx,
|
||||
|
||||
/* register the capture. */
|
||||
hdr = calloc(1, sizeof(*hdr));
|
||||
if (!hdr) {
|
||||
memprintf(err, "proxy '%s': out of memory while registering a capture", curpx->id);
|
||||
return -1;
|
||||
}
|
||||
hdr->name = NULL; /* not a header capture */
|
||||
hdr->namelen = 0;
|
||||
hdr->len = len;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user