null checks

This commit is contained in:
iceman1001 2021-10-10 15:33:39 +02:00
commit 2dadba9cee

View file

@ -453,9 +453,17 @@ static int CmdrevengSearch(const char *Cmd) {
memset(result, 0, 30);
char *inCRC = calloc(crcChars + 1, sizeof(char));
if (inCRC == NULL) {
return 0;
}
memcpy(inCRC, inHexStr + (dataLen - crcChars), crcChars);
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
if (outHex == NULL) {
return 0;
}
memcpy(outHex, inHexStr, dataLen - crcChars);
ans = RunModel(Models[i], outHex, false, 0, result);