Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add buffer range check. #5976

Merged
merged 1 commit into from
Oct 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Add buffer range check.
  • Loading branch information
AtariDreams committed Oct 1, 2021
commit 092c373ee72162836519f2232f19b136823dad8b
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