]> git.ipfire.org Git - thirdparty/bind9.git/commit
Allow zero length keys in isc_hashmap
authorOndřej Surý <ondrej@isc.org>
Thu, 8 Dec 2022 09:46:09 +0000 (10:46 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 14 Dec 2022 16:59:07 +0000 (17:59 +0100)
commit7cefcb6184952074e3a3289ba67c7c37cb8a3cac
treeb1fe8618215c2dd239f08c8690e94495e0bfefca
parent8a35d52807bdba90a616ee8814e6f7ba8c620646
Allow zero length keys in isc_hashmap

In case, we are trying to hash the empty key into the hashmap, the key
is going to have zero length.  This might happen in the unit test.
Allow this and add a unit test to ensure the empty zero-length key
doesn't hash to slot 0 as SipHash 2-4 (our hash function of choice) has
no problem with zero-length inputs.
lib/isc/hashmap.c
tests/isc/hashmap_test.c