Prevent potential buffer s overflow by limiting the characters written.
Use vsnprintf instead of vsprintf.
This commit is contained in:
parent
c939f9610a
commit
cd568e37bc
|
|
@ -1499,7 +1499,7 @@ win_x_fprintf(FILE *stream, const char *format, ...)
|
|||
if ((stream == stdout) || (stream == stderr)) {
|
||||
|
||||
s[0] = SE;
|
||||
result = vsprintf(s, format, args);
|
||||
result = vsnprintf(s, IOBufSize, format, args);
|
||||
win_x_fputs(s, stream);
|
||||
} else
|
||||
result = vfprintf(stream, format, args);
|
||||
|
|
|
|||
Loading…
Reference in New Issue