mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
FIX: Coverity, unchecked return value, CID #121292,..
basicallty the flush queue commmand is replaced with clearCommandBuffer();.
This commit is contained in:
parent
1d42f25fcd
commit
28415b5d90
8 changed files with 30 additions and 23 deletions
|
@ -790,7 +790,8 @@ static command_t CommandTable[] =
|
||||||
|
|
||||||
int CmdHF14A(const char *Cmd) {
|
int CmdHF14A(const char *Cmd) {
|
||||||
// flush
|
// flush
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
|
|
||||||
// parse
|
// parse
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
|
|
|
@ -18,9 +18,11 @@ int CmdHFDESReader(const char *Cmd)
|
||||||
{
|
{
|
||||||
UsbCommand c = { CMD_MIFARE_DES_READER, {3, 0x60, 0} };
|
UsbCommand c = { CMD_MIFARE_DES_READER, {3, 0x60, 0} };
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
UsbCommand resp;
|
UsbCommand resp;
|
||||||
WaitForResponseTimeout(CMD_ACK,&resp,2000);
|
if (!WaitForResponseTimeout(CMD_ACK,&resp,2000) ){
|
||||||
|
PrintAndLog("Command time-out");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +59,8 @@ static command_t CommandTable[] =
|
||||||
int CmdHFDES(const char *Cmd)
|
int CmdHFDES(const char *Cmd)
|
||||||
{
|
{
|
||||||
//flush
|
//flush
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,8 @@ int CmdHelp(const char *Cmd)
|
||||||
int CmdHFEPA(const char *Cmd)
|
int CmdHFEPA(const char *Cmd)
|
||||||
{
|
{
|
||||||
// flush
|
// flush
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
|
|
||||||
// parse
|
// parse
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
|
|
|
@ -2163,7 +2163,8 @@ static command_t CommandTable[] =
|
||||||
int CmdHFMF(const char *Cmd)
|
int CmdHFMF(const char *Cmd)
|
||||||
{
|
{
|
||||||
// flush
|
// flush
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -636,8 +636,7 @@ int CmdHF14ADesAuth(const char *Cmd){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static command_t CommandTable[] =
|
static command_t CommandTable[] = {
|
||||||
{
|
|
||||||
{"help", CmdHelp, 1, "This help"},
|
{"help", CmdHelp, 1, "This help"},
|
||||||
{"info", CmdHF14ADesInfo, 0, "Get MIFARE DesFire information"},
|
{"info", CmdHF14ADesInfo, 0, "Get MIFARE DesFire information"},
|
||||||
{"enum", CmdHF14ADesEnumApplications,0, "Tries enumerate all applications"},
|
{"enum", CmdHF14ADesEnumApplications,0, "Tries enumerate all applications"},
|
||||||
|
@ -647,16 +646,15 @@ static command_t CommandTable[] =
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
int CmdHFMFDes(const char *Cmd)
|
int CmdHFMFDes(const char *Cmd) {
|
||||||
{
|
|
||||||
// flush
|
// flush
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdHelp(const char *Cmd)
|
int CmdHelp(const char *Cmd) {
|
||||||
{
|
|
||||||
CmdsHelp(CommandTable);
|
CmdsHelp(CommandTable);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,8 @@ static command_t CommandTable[] =
|
||||||
|
|
||||||
int CmdHFMFDesfire(const char *Cmd){
|
int CmdHFMFDesfire(const char *Cmd){
|
||||||
// flush
|
// flush
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2025,7 +2025,8 @@ static command_t CommandTable[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
int CmdHFMFUltra(const char *Cmd){
|
int CmdHFMFUltra(const char *Cmd){
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,8 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo
|
||||||
struct Crypto1State *p1, *p2, *p3, *p4;
|
struct Crypto1State *p1, *p2, *p3, *p4;
|
||||||
|
|
||||||
// flush queue
|
// flush queue
|
||||||
WaitForResponseTimeout(CMD_ACK,NULL,100);
|
clearCommandBuffer();
|
||||||
|
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
||||||
|
|
||||||
UsbCommand c = {CMD_MIFARE_NESTED, {blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, calibrate}};
|
UsbCommand c = {CMD_MIFARE_NESTED, {blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, calibrate}};
|
||||||
memcpy(c.d.asBytes, key, 6);
|
memcpy(c.d.asBytes, key, 6);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue