From 3e7e6162870de6545f3ee53d0c52d14a6b9434ef Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 11 Aug 2023 13:24:57 +0100 Subject: Make printf of gstring null-safe Broken-by: 00392be0e7cf --- src/src/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- cgit v1.2.3