BUG/MINOR: acme: fix possible NULL deref
Task was dereferenced when setting ctx but was checked after. This patch move the setting of ctx after the check. Should fix issue #2931
This commit is contained in:
parent
3cbbf41cd8
commit
3866d3bd12
@ -493,11 +493,13 @@ REGISTER_CONFIG_SECTION("acme", cfg_parse_acme, cfg_postsection_acme);
|
|||||||
static void acme_httpclient_end(struct httpclient *hc)
|
static void acme_httpclient_end(struct httpclient *hc)
|
||||||
{
|
{
|
||||||
struct task *task = hc->caller;
|
struct task *task = hc->caller;
|
||||||
struct acme_ctx *ctx = task->context;
|
struct acme_ctx *ctx;
|
||||||
|
|
||||||
if (!task)
|
if (!task)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ctx = task->context;
|
||||||
|
|
||||||
if (ctx->http_state == ACME_HTTP_REQ)
|
if (ctx->http_state == ACME_HTTP_REQ)
|
||||||
ctx->http_state = ACME_HTTP_RES;
|
ctx->http_state = ACME_HTTP_RES;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user