]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Prevent writing to NULL if buffer is NULL 233/head
authorAlfonso Gregory <83477269+AtariDreams@users.noreply.github.com>
Mon, 30 Aug 2021 18:07:05 +0000 (14:07 -0400)
committerAlfonso Gregory <83477269+AtariDreams@users.noreply.github.com>
Mon, 30 Aug 2021 18:07:05 +0000 (14:07 -0400)
cups/snprintf.c

index ff680321a04c2f20264872fb9720f76228cc0a45..e4eb3e9757c96d4d1042e2947da52179bcdf2087 100644 (file)
@@ -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);
 }