Fix sscanf character conversion (%c): do not add '\0' at the end as for strings, cause, for example, parsing one character will fill two bytes: character itself and zero one '\0' after it, so will overflow one byte variable argument and corrupt memory for variables allocated after it.

This commit is contained in:
Oleg Evseev 2017-11-19 13:33:46 -06:00 committed by Gregory Nutt
parent 34bae015df
commit d55e44b2ea

View File

@ -574,7 +574,6 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap)
if (!noassign)
{
strncpy(tv, buf, width);
tv[width] = '\0';
count++;
}