From 97240d01b3e111a72265a953e3ca774680df8fef Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Mon, 29 Apr 2024 20:19:05 +0200 Subject: [PATCH] BUG/MINOR: log/encode: fix potential NULL-dereference in LOGCHAR() When CBOR encoding was added in c614fd3b9 ("MINOR: log: add +cbor encoding option"), in LOGCHAR(), we forgot to check that we don't assign the NULL value to tmplog (as we assume that tmplog cannot be NULL at the end of sess_build_logline()) No backport needed. --- src/log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/log.c b/src/log.c index 31295d288..3b78bc09e 100644 --- a/src/log.c +++ b/src/log.c @@ -3163,6 +3163,8 @@ const char sess_set_cookie[8] = "NPDIRU67"; /* No set-cookie, Set-cookie found a tmplog, \ dst + maxsize, \ _x, sizeof(_x)); \ + if (ret == NULL) \ + goto out; \ tmplog = ret; \ break; \ } \ -- 2.47.3