1
0
mirror of https://github.com/armink/FlashDB.git synced 2025-01-16 20:12:52 +08:00

[kvdb] fix null-pointer dereference (#314)

The C library function - strlen() does not accept a null-pointer.

Signed-off-by: FragrantRye <903465575@qq.com>
This commit is contained in:
莫若麦香 2024-09-15 16:32:07 +08:00 committed by GitHub
parent 523fd2052d
commit fd08d7f323
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1380,7 +1380,11 @@ fdb_err_t fdb_kv_set(fdb_kvdb_t db, const char *key, const char *value)
{
struct fdb_blob blob;
if (value) {
return fdb_kv_set_blob(db, key, fdb_blob_make(&blob, value, strlen(value)));
} else {
return fdb_kv_del(db, key);
}
}
/**