mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-26 00:55:19 +08:00
coverity dont think we check if we got enough bytes to operate on. The sizeof the bmp_header_t gives a bit, we would need more ...
This commit is contained in:
parent
fb35a29ba0
commit
90a3b968fd
1 changed files with 7 additions and 1 deletions
|
@ -1064,7 +1064,13 @@ static int CmdHF14AWSLoadBmp(const char *Cmd) {
|
|||
size_t bytes_read = 0;
|
||||
if (loadFile_safe(filename, ".bmp", (void **)&bmp, &bytes_read) != PM3_SUCCESS) {
|
||||
PrintAndLogEx(WARNING, "Could not find file " _YELLOW_("%s"), filename);
|
||||
return PM3_EIO;
|
||||
return PM3_EFILE;
|
||||
}
|
||||
if (bmp == NULL) {
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
if (bytes_read < sizeof(bmp_header_t)) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
int depth = picture_bit_depth(bmp, bytes_read, model_nr);
|
||||
|
|
Loading…
Reference in a new issue