mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 07:05:40 -07:00
null checks
This commit is contained in:
parent
67632fdc24
commit
2dadba9cee
1 changed files with 8 additions and 0 deletions
|
@ -453,9 +453,17 @@ static int CmdrevengSearch(const char *Cmd) {
|
||||||
|
|
||||||
memset(result, 0, 30);
|
memset(result, 0, 30);
|
||||||
char *inCRC = calloc(crcChars + 1, sizeof(char));
|
char *inCRC = calloc(crcChars + 1, sizeof(char));
|
||||||
|
if (inCRC == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(inCRC, inHexStr + (dataLen - crcChars), crcChars);
|
memcpy(inCRC, inHexStr + (dataLen - crcChars), crcChars);
|
||||||
|
|
||||||
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
|
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
|
||||||
|
if (outHex == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(outHex, inHexStr, dataLen - crcChars);
|
memcpy(outHex, inHexStr, dataLen - crcChars);
|
||||||
|
|
||||||
ans = RunModel(Models[i], outHex, false, 0, result);
|
ans = RunModel(Models[i], outHex, false, 0, result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue