mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-30 11:40:32 +00:00
Add safeguard suggested by Alcaro
This commit is contained in:
parent
fbdd53b717
commit
c63859cca9
@ -391,10 +391,12 @@ int filestream_read_file(const char *path, void **buf, ssize_t *len)
|
||||
if (content_buf_size < 0)
|
||||
goto error;
|
||||
|
||||
content_buf = malloc((size_t)(content_buf_size + 1));
|
||||
content_buf = malloc((size_t)(content_buf_size + 1));
|
||||
|
||||
if (!content_buf)
|
||||
goto error;
|
||||
if ((size_t)(content_buf_size + 1) != (content_buf_size + 1))
|
||||
goto error;
|
||||
|
||||
ret = filestream_read(file, content_buf, (int64_t)content_buf_size);
|
||||
if (ret < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user