]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl_ckch: fix "maybe-uninitialized" build error on gcc-9.4 + ARM
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Jun 2022 03:40:25 +0000 (05:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Jun 2022 03:45:34 +0000 (05:45 +0200)
As reported in issue #1755, gcc-9.3 and 9.4 emit a "maybe-uninitialized"
warning in cli_io_handler_commit_cafile_crlfile() because it sees that
when the "path" variable is not set, we're jumping to the error label
inside the loop but cannot see that the new state will avoid the places
where the value is used. Thus it's a false positive but a difficult one.
Let's just preset the value to NULL to make it happy.

This was introduced in 2.7-dev by commit ddc8e1cf8 ("MINOR: ssl_ckch:
Simplify I/O handler to commit changes on CA/CRL entry"), thus no
backport is needed for now.

src/ssl_ckch.c

index 9d7775ae01421c0757b0ea816efb7101ab53f2a8..da982405a8233d68715422aa9d1a7777edd0709b 100644 (file)
@@ -2710,6 +2710,7 @@ static int cli_io_handler_commit_cafile_crlfile(struct appctx *appctx)
                        path = crlfile_transaction.path;
                        break;
                default:
+                       path = NULL;
                        goto error;
        }