Skip to content

Commit

Permalink
Merge pull request #5976 from AtariDreams/snprintf
Browse files Browse the repository at this point in the history
Add buffer range check.
  • Loading branch information
michaelrsweet committed Oct 1, 2021
2 parents 41203cb + 092c373 commit 26dcdbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cups/snprintf.c
Original file line number Diff line number Diff line change
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 26dcdbf

Please sign in to comment.