null checks
This commit is contained in:
1 parent
67632fdc24
commit
2dadba9cee
1 file changed
+8
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user