FIX, Coverity, Argument can't be negative. CID# 212322, ftell(f) can …
…be negative. Not allowed in malloc... from @iceman1001
This commit is contained in:
parent
3d4982ddbf
commit
7a616c0d70
@ -283,8 +283,12 @@ int CmdHFiClassELoad(const char *Cmd) {
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user