ephoto_file: fix string not null-terminated. CID151522

master
Boris Faure 6 years ago
parent a0a389abb0
commit a0e367be4f
  1. 3
      src/bin/ephoto_file.c

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

Loading…
Cancel
Save