OSDN Git Service

util/set: Assert that keys are not reserved pointers
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 5 Jun 2019 21:56:20 +0000 (16:56 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 6 Jun 2019 00:27:53 +0000 (00:27 +0000)
commit8306dabc03c9a030cacd078b56446e6548224a23
tree7ebf83403956268d5ba78adee5eee5e149e213d5
parent7a18ce0b9119898b6d58b8e76495a40a9fe71765
util/set: Assert that keys are not reserved pointers

If we insert a NULL key, it will appear to succeed but will mess up
entry counting.  Similar errors can occur if someone accidentally
inserts the deleted key.  The later is highly unlikely but technically
possible so we should guard against it too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/util/set.c