]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix indentation and add buffer range check.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 16 Sep 2021 15:47:36 +0000 (11:47 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 16 Sep 2021 15:47:36 +0000 (11:47 -0400)
cups/snprintf.c

index e4eb3e9757c96d4d1042e2947da52179bcdf2087..d927f0ecd326e71bca5f2f1b123a0f29104a91d4 100644 (file)
@@ -323,8 +323,8 @@ _cups_vsnprintf(char       *buffer, /* O - Output buffer */
   * Nul-terminate the string and return the number of characters needed.
   */
 
-  if (bufptr)
-       *bufptr = '\0';
+  if (bufptr && bufptr < bufend)
+    *bufptr = '\0';
 
   return (bytes);
 }