Add safeguard suggested by Alcaro
This commit is contained in:
parent
fbdd53b717
commit
c63859cca9
|
@ -395,6 +395,8 @@ int filestream_read_file(const char *path, void **buf, ssize_t *len)
|
|||
|
||||
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