summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3d4982d)
…be negative. Not allowed in malloc...
from @iceman1001
long fsize = ftell(f);
fseek(f, 0, SEEK_SET);
long fsize = ftell(f);
fseek(f, 0, SEEK_SET);
- uint8_t *dump = malloc(fsize);
+ if (fsize < 0) {
+ PrintAndLog("Error, when getting filesize");
+ return 1;
+ }
+ uint8_t *dump = malloc(fsize);
size_t bytes_read = fread(dump, 1, fsize, f);
fclose(f);
size_t bytes_read = fread(dump, 1, fsize, f);
fclose(f);