mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
Fix issue in file_stream.c - it would corrupt memory if
maxlen is negative
This commit is contained in:
parent
46ed5c3fcb
commit
538cca8bcd
@ -221,6 +221,9 @@ int filestream_scanf(RFILE *stream, const char* format, ...)
|
||||
int ret = 0;
|
||||
int64_t maxlen = filestream_read(stream, buf, sizeof(buf)-1);
|
||||
|
||||
if (maxlen <= 0)
|
||||
return EOF;
|
||||
|
||||
buf[maxlen] = '\0';
|
||||
|
||||
va_start(args, format);
|
||||
|
Loading…
x
Reference in New Issue
Block a user