]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: fcgi-app: handle a possible strdup() failure
authorIlia Shipitsin <chipitsine@gmail.com>
Mon, 5 Aug 2024 18:59:09 +0000 (20:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 6 Aug 2024 06:21:49 +0000 (08:21 +0200)
This defect was found by the coccinelle script "unchecked-strdup.cocci".
It can be backported to 2.2.

src/fcgi-app.c

index b3a9b7c595ae054a8f76f125ce8d8d3545dfefe6..98077b9593276fcae377964307b10eec6fa02f1f 100644 (file)
@@ -606,6 +606,8 @@ static int proxy_parse_use_fcgi_app(char **args, int section, struct proxy *curp
        if (!fcgi_conf)
                goto err;
        fcgi_conf->name = strdup(args[1]);
+       if (!fcgi_conf->name)
+               goto err;
        LIST_INIT(&fcgi_conf->param_rules);
        LIST_INIT(&fcgi_conf->hdr_rules);