Skip to content

Commit

Permalink
Add buffer range check.
Browse files Browse the repository at this point in the history
  • Loading branch information
AtariDreams committed Oct 1, 2021
1 parent 41203cb commit 092c373
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cups/snprintf.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 092c373

Please sign in to comment.