mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
cppcheck: add test to avoid dereferncing null pointer
This commit is contained in:
parent
17d7fb8abb
commit
eb23028514
2 changed files with 4 additions and 1 deletions
|
@ -141,6 +141,8 @@ int fnf(uint64_t s) {
|
|||
|
||||
// builds the lfsr for the prng (quick calcs for hitag2_nstep())
|
||||
void buildlfsr(Hitag_State *hstate) {
|
||||
if (hstate == NULL)
|
||||
return;
|
||||
uint64_t state = hstate->shiftreg;
|
||||
uint64_t temp = state ^ (state >> 1);
|
||||
hstate->lfsr = state ^ (state >> 6) ^ (state >> 16)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue