]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use a read lock when iterating over a hashmap
authorAram Sargsyan <aram@isc.org>
Tue, 7 Nov 2023 10:02:57 +0000 (10:02 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 13 Nov 2023 12:06:26 +0000 (12:06 +0000)
commit6687de854fa048f8a2d7d1650c45dd6848340491
tree1d6c8d50cd603722682a24515234415d2d373e5a
parent4c9d94836547d535d0c8f8ba230dcae5303687a4
Use a read lock when iterating over a hashmap

The 'dns_tsigkeyring_t' structure has a read/write lock to protect
its 'keys' member, which is a 'isc_hashmap_t' pointer and needs to
be protected.

The dns_tsigkeyring_dump() function, however, doesn't use the lock,
which can introduce a race with another thread, if the other thread
tries to modify the hashmap.

Add a read lock around the code, which iterates over the hashmap.
lib/dns/tsig.c