Merge pull request #15513 from mattgbio/check-rbp-SecureStore

SecureStore: Add missing check for rollback-protection pointer before allocating memory
pull/15521/head
Martin Kojtal 2024-06-08 16:11:20 +01:00 committed by GitHub
commit e3d2c560e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -290,7 +290,7 @@ int SecureStore::set_start(set_handle_t *handle, const char *key, size_t final_d
goto fail;
}
if (create_flags & (REQUIRE_REPLAY_PROTECTION_FLAG | WRITE_ONCE_FLAG)) {
if (_rbp_kv && (create_flags & (REQUIRE_REPLAY_PROTECTION_FLAG | WRITE_ONCE_FLAG))) {
_ih->key = new char[strlen(key) + 1];
strcpy(_ih->key, key);
}