summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2023-08-11 13:24:57 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2023-08-11 13:24:57 +0100
commit3e7e6162870de6545f3ee53d0c52d14a6b9434ef (patch)
treeb48482971f61c4b1ec13a21a47d4782ce153e587
parentfb911b21a156dfe5967b9c79f4f1408e4f90458b (diff)
Make printf of gstring null-safe
Broken-by: 00392be0e7cf
-rw-r--r--src/src/string.c4
1 files 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;
}