[exim-cvs] Make printf of gstring null-safe

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Exim Git Commits Mailing List
Data:  
Para: exim-cvs
Asunto: [exim-cvs] Make printf of gstring null-safe
Gitweb: https://git.exim.org/exim.git/commitdiff/3e7e6162870de6545f3ee53d0c52d14a6b9434ef
Commit:     3e7e6162870de6545f3ee53d0c52d14a6b9434ef
Parent:     fb911b21a156dfe5967b9c79f4f1408e4f90458b
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Aug 11 13:24:57 2023 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Aug 11 13:24:57 2023 +0100


    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;
       }



--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/