mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
2c3644a09f
When erasing a variable length item with an incorrect CRC32, the span value of the item can not be trusted, so the item will be erased with span = 1. Subsequent entries represent the data of the variable length item, and these will be treated as separate items. For each entry CRC32 is checked, the check most likely fails (because the entry contains arbitrary data, and not a proper NVS item), and the entry is erased. Erase function assumed that every item should be present in cache, but it is not the case for the entries which are just parts of item’s payload. This change allows for the item to be not found in the hashlist, if the CRC32 check fails.