From: Jeremy Harris Date: Fri, 11 Aug 2023 12:24:57 +0000 (+0100) Subject: Make printf of gstring null-safe X-Git-Tag: exim-4.97-RC0~34 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/3e7e6162870de6545f3ee53d0c52d14a6b9434ef Make printf of gstring null-safe Broken-by: 00392be0e7cf --- diff --git a/src/src/string.c b/src/src/string.c index 854cf0d34..52b1d2fb5 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -1579,8 +1579,8 @@ while (*fp) case 'Y': /* gstring pointer */ { gstring * zg = va_arg(ap, gstring *); - s = CS zg->s; - slen = zg->ptr; + if (zg) { s = CS zg->s; slen = zg->ptr; } + else { s = null; slen = Ustrlen(s); } goto INSERT_GSTRING; }