mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
FIX: Coverity, CID#121314, Explicit null dereferenced, in really odd occasions buf would be NULL, and sending NULL to memcpy dereferences it. Not sure about this fix.
This commit is contained in:
parent
395ec4e99c
commit
e72d1fbba2
1 changed files with 5 additions and 0 deletions
|
@ -2052,6 +2052,11 @@ int CmdHF14AMfSniff(const char *Cmd){
|
|||
bufsize = traceLen;
|
||||
memset(buf, 0x00, traceLen);
|
||||
}
|
||||
if (bufPtr == NULL) {
|
||||
PrintAndLog("Cannot allocate memory for trace");
|
||||
free(buf);
|
||||
return 2;
|
||||
}
|
||||
memcpy(bufPtr, resp.d.asBytes, len);
|
||||
bufPtr += len;
|
||||
pckNum++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue