From c26dede1f742f46157c2f3ff0ede6be8e96cf44f Mon Sep 17 00:00:00 2001 From: Matthias Goebel Date: Fri, 3 May 2024 10:55:35 +0200 Subject: [PATCH] Added missing check for replay protection pointer before allocating new variable --- storage/kvstore/securestore/source/SecureStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/kvstore/securestore/source/SecureStore.cpp b/storage/kvstore/securestore/source/SecureStore.cpp index be14c105f097..fc2d2d5de388 100644 --- a/storage/kvstore/securestore/source/SecureStore.cpp +++ b/storage/kvstore/securestore/source/SecureStore.cpp @@ -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); }