From: Alfonso Gregory <83477269+AtariDreams@users.noreply.github.com> Date: Mon, 30 Aug 2021 18:07:05 +0000 (-0400) Subject: Prevent writing to NULL if buffer is NULL X-Git-Tag: v2.4b1~80^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3878a9bbf79791463bf6acac2a51486b60dfd409;p=thirdparty%2Fcups.git Prevent writing to NULL if buffer is NULL --- diff --git a/cups/snprintf.c b/cups/snprintf.c index ff680321a0..e4eb3e9757 100644 --- a/cups/snprintf.c +++ b/cups/snprintf.c @@ -323,7 +323,8 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */ * Nul-terminate the string and return the number of characters needed. */ - *bufptr = '\0'; + if (bufptr) + *bufptr = '\0'; return (bytes); }