Add safeguard suggested by Alcaro

This commit is contained in:
twinaphex 2017-12-16 00:19:56 +01:00
parent fbdd53b717
commit c63859cca9
1 changed files with 3 additions and 1 deletions

View File

@ -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)