fix_load_file_mem: add trailing NULL
This commit is contained in:
1 parent
895867d50f
commit
0e88c0d6f9
1 file changed
+2
-1
+2
-1
@@ -410,7 +410,8 @@ ssize_t fs_load_file_mem(const char *path, void **ptr)
|
||||
struct file_stat stat;
|
||||
fs_stat_file(cookie, &stat);
|
||||
|
||||
*ptr = malloc(stat.size);
|
||||
*ptr = malloc(stat.size + 1);
|
||||
ptr[stat.size] = NULL;
|
||||
|
||||
if (!(*ptr)) return -1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user