[snprintf] Check for '\0' to prevent undef memory read

This commit is contained in:
Sohom
2022-12-03 08:14:14 +05:30
parent e707ffe58b
commit 8ac89f8d05

View File

@@ -1154,6 +1154,8 @@ __find_arguments(const char *fmt0, va_list ap, union arg **argtable)
for (;;) {
for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
/* void */;
if ( ch == '\0' )
goto done;
fmt++; /* skip over '%' */
flags = 0;