NVS: BUGFIX non-matching type iterator works

Closes IDFGH-2229
This commit is contained in:
Jakob Hasse
2019-11-22 12:07:56 +08:00
parent de43b8406b
commit bb1cd9a440
2 changed files with 38 additions and 4 deletions
+4 -3
View File
@@ -622,9 +622,9 @@ esp_err_t Page::mLoadEntryTable()
}
}
/* Note that logic for duplicate detections works fine even
* when old-format blob is present along with new-format blob-index
* for same key on active page. Since datatype is not used in hash calculation,
/* Note that logic for duplicate detections works fine even
* when old-format blob is present along with new-format blob-index
* for same key on active page. Since datatype is not used in hash calculation,
* old-format blob will be removed.*/
if (duplicateIndex < i) {
eraseEntryAndSpan(duplicateIndex);
@@ -864,6 +864,7 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si
if (key == nullptr && nsIndex == NS_ANY && chunkIdx == CHUNK_ANY) {
continue; // continue for bruteforce search on blob indices.
}
itemIndex = i;
return ESP_ERR_NVS_TYPE_MISMATCH;
}