summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRose <83477269+AtariDreams@users.noreply.github.com>2021-10-01 10:41:58 -0400
committerRose <83477269+AtariDreams@users.noreply.github.com>2021-10-01 10:41:58 -0400
commit092c373ee72162836519f2232f19b136823dad8b (patch)
tree66a21a83e714e241bee079c337abcd4ec573a6ef
parent41203cbdb391d93264880ddc83b537730b5f9abf (diff)
downloadcups-092c373ee72162836519f2232f19b136823dad8b.tar.gz
Add buffer range check.
-rw-r--r--cups/snprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cups/snprintf.c b/cups/snprintf.c
index e4eb3e975..066252ee7 100644
--- a/cups/snprintf.c
+++ b/cups/snprintf.c
@@ -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);
}