From: Baptiste Daroussin Date: Mon, 8 Jun 2026 21:18:44 +0000 (+0200) Subject: Fix do_access: add missing NULL check on msg parameter X-Git-Tag: RELEASE_2_1_0~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efc7b1b5c904dd6df31398287c26dfddd86cf4a4;p=thirdparty%2Fmlmmj.git Fix do_access: add missing NULL check on msg parameter The final fallthrough path (no rules matched) called xasprintf(msg, ...) without checking if msg != NULL, unlike all other xasprintf calls in the same function. If a caller passes NULL for msg, this would crash in vasprintf(NULL, ...). --- diff --git a/src/access.c b/src/access.c index a084a632..1e9cd3b8 100644 --- a/src/access.c +++ b/src/access.c @@ -167,9 +167,10 @@ do_access(strlist *rules, strlist *headers, const char *from, char **msg, char * } } - xasprintf(msg, "access -" - " A mail from \"%s\" didn't match any rules, and" - " was denied by default.", from); + if (msg != NULL) + xasprintf(msg, "access -" + " A mail from \"%s\" didn't match any rules, and" + " was denied by default.", from); return ACT_DENY; }