mirror of
https://github.com/openharmony/utils_native_lite.git
synced 2026-07-21 01:35:27 -04:00
update kv_store/src/kvstore_common/kvstore_common.c.
add memset_s after malloc of kv
This commit is contained in:
@@ -112,6 +112,7 @@ void AddKVCache(const char* key, const char* value, boolean isNew)
|
||||
if (item == NULL) {
|
||||
return;
|
||||
}
|
||||
(void)memset_s(item, sizeof(KvItem), 0, sizeof(KvItem));
|
||||
size_t keyLen = strnlen(key, MAX_KEY_LEN);
|
||||
size_t valueLen = strnlen(value, MAX_VALUE_LEN);
|
||||
if ((keyLen >= MAX_KEY_LEN) || (valueLen >= MAX_VALUE_LEN)) {
|
||||
|
||||
Reference in New Issue
Block a user