]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: fix a possible null dereference in qc_timeout_task
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 21 Feb 2022 09:05:16 +0000 (10:05 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 21 Feb 2022 09:05:16 +0000 (10:05 +0100)
The qcc instance should be tested as it is implied by a previous test
that it may be NULL. In this case, qc_timeout_task can be stopped.

This should fix github issue #1559.

src/mux_quic.c

index 2ed269e3cb39370c4a8a5fb3e06e3996bdd7824d..c01fcbfa7939dbca9b584fe5460a0eecbb0c2233 100644 (file)
@@ -427,6 +427,10 @@ static struct task *qc_timeout_task(struct task *t, void *ctx, unsigned int stat
 
        fprintf(stderr, "%s: timeout\n", __func__);
        task_destroy(t);
+
+       if (!qcc)
+               return NULL;
+
        qcc->task = NULL;
 
        if (qcc_is_dead(qcc))