mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 22:28:41 -04:00
BUG/MINOR: acme: warning ‘ctx’ may be used uninitialized
Please compiler with maybe-uninitialized warning
src/acme.c: In function ‘cli_acme_chall_ready_parse’:
include/haproxy/task.h:215:9: error: ‘ctx’ may be used uninitialized [-Werror=maybe-uninitialized]
215 | _task_wakeup(t, f, MK_CALLER(WAKEUP_TYPE_TASK_WAKEUP, 0, 0))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/acme.c:2903:17: note: in expansion of macro ‘task_wakeup’
2903 | task_wakeup(ctx->task, TASK_WOKEN_MSG);
| ^~~~~~~~~~~
src/acme.c:2862:26: note: ‘ctx’ was declared here
2862 | struct acme_ctx *ctx;
| ^~~
Backport to 3.2.
This commit is contained in:
parent
d77d3479ed
commit
0cae2f0515
1 changed files with 8 additions and 7 deletions
15
src/acme.c
15
src/acme.c
|
|
@ -2859,7 +2859,7 @@ static int cli_acme_chall_ready_parse(char **args, char *payload, struct appctx
|
|||
char *msg = NULL;
|
||||
const char *crt;
|
||||
const char *dns;
|
||||
struct acme_ctx *ctx;
|
||||
struct acme_ctx *ctx = NULL;
|
||||
struct acme_auth *auth;
|
||||
int found = 0;
|
||||
int remain = 0;
|
||||
|
|
@ -2897,13 +2897,14 @@ static int cli_acme_chall_ready_parse(char **args, char *payload, struct appctx
|
|||
if (!msg)
|
||||
memprintf(&msg, "Couldn't find the ACME task using crt \"%s\" and dns \"%s\" !\n", crt, dns);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!remain) {
|
||||
task_wakeup(ctx->task, TASK_WOKEN_MSG);
|
||||
return cli_dynmsg(appctx, LOG_INFO, memprintf(&msg, "%d '%s' challenge(s) ready! All challenges ready, starting challenges validation!", found, dns));
|
||||
} else {
|
||||
return cli_dynmsg(appctx, LOG_INFO, memprintf(&msg, "%d '%s' challenge(s) ready! Remaining challenges to deploy: %d", found, dns, remain));
|
||||
if (!remain) {
|
||||
if (ctx)
|
||||
task_wakeup(ctx->task, TASK_WOKEN_MSG);
|
||||
return cli_dynmsg(appctx, LOG_INFO, memprintf(&msg, "%d '%s' challenge(s) ready! All challenges ready, starting challenges validation!", found, dns));
|
||||
} else {
|
||||
return cli_dynmsg(appctx, LOG_INFO, memprintf(&msg, "%d '%s' challenge(s) ready! Remaining challenges to deploy: %d", found, dns, remain));
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
|
|
|
|||
Loading…
Reference in a new issue