ephoto_file: fix string not null-terminated. CID151522

This commit is contained in:
Boris Faure 2016-11-28 21:32:09 +01:00
parent a0a389abb0
commit a0e367be4f
1 changed files with 2 additions and 1 deletions

View File

@ -938,9 +938,10 @@ _prompt_upload_apply(void *data, Evas_Object *obj EINA_UNUSED,
return;
}
rewind(f);
fdata = malloc(fsize);
fdata = malloc(fsize+1);
res = fread(fdata, fsize, 1, f);
if (res < 1) CRIT("fread() failed on file '%s': %s", entry->path, strerror(errno));
fdata[fsize] = '\0';
res = fclose(f);
if (!res) CRIT("fclose() failed on file '%s': %s", entry->path, strerror(errno));