fix: hf mf hardnested - access out of malloc mem. (@vdwel) https://github.com/RfidResearchGroup/proxmark3/issues/46

looks like increasing size removes the problem.
This commit is contained in:
Chris 2018-11-05 22:29:31 +01:00
parent 4d500dff2f
commit ecc7983866

View file

@ -1750,7 +1750,7 @@ static void add_matching_states(statelist_t *candidates, uint8_t part_sum_a0, ui
PrintAndLogEx(WARNING, "Out of memory error in add_matching_states() - statelist.\n"); PrintAndLogEx(WARNING, "Out of memory error in add_matching_states() - statelist.\n");
exit(4); exit(4);
} }
uint32_t *candidates_bitarray = (uint32_t *)malloc_bitarray(sizeof(uint32_t) * (1<<19)); uint32_t *candidates_bitarray = (uint32_t *)malloc_bitarray(sizeof(uint32_t) * worstcase_size);
if (candidates_bitarray == NULL) { if (candidates_bitarray == NULL) {
PrintAndLogEx(WARNING, "Out of memory error in add_matching_states() - bitarray.\n"); PrintAndLogEx(WARNING, "Out of memory error in add_matching_states() - bitarray.\n");
free(candidates->states[odd_even]); free(candidates->states[odd_even]);