diff -r c49104015a6b -r 056e5f592d84 src/hash_key.c --- a/src/hash_key.c Sun Nov 06 14:46:59 2022 +0100 +++ b/src/hash_key.c Sun Nov 06 16:07:32 2022 +0100 @@ -30,8 +30,13 @@ #include void cx_hash_murmur(CxHashKey *key) { + unsigned char const *data = key->data.cbytes; + if (data == NULL) { + /* extension: special value for NULL */ + key->hash = 1574210520u; + return; + } size_t len = key->len; - unsigned char const *data = key->data.cbytes; unsigned m = 0x5bd1e995; unsigned r = 24; @@ -79,7 +84,7 @@ CxHashKey cx_hash_key_str(char const *str) { CxHashKey key; key.data.cstr = str; - key.len = str == NULL ? 0 : (1 + strlen(str)); + key.len = str == NULL ? 0 : strlen(str); cx_hash_murmur(&key); return key; }