]> git.ipfire.org Git - thirdparty/bind9.git/commit
Properly detect MMDB lookup failures
authorMichał Kępień <michal@isc.org>
Mon, 13 Jan 2020 13:32:19 +0000 (14:32 +0100)
committerMichał Kępień <michal@isc.org>
Mon, 13 Jan 2020 13:36:58 +0000 (14:36 +0100)
commit814da1c808127ea7caaf0fa45fccf33272f0cfbc
tree63d315192b21f8a1489df80f9c09c9f518e06516
parent8c7faf623dddf2d9305b65ab5144bd0f5dc91205
Properly detect MMDB lookup failures

Only comparing the value of the integer passed as the last argument to
MMDB_lookup_sockaddr() against MMDB_SUCCESS is not enough to ensure that
an MMDB lookup was successful - the 'found_entry' field of the
MMDB_lookup_result_s structure returned by that function also needs to
be true or else the remaining contents of that structure should be
ignored as the lookup failed.  Extend the relevant logical condition in
get_entry_for() to ensure the latter does not return incorrect MMDB
entries for IP addresses which do not belong to any subnet defined in a
given GeoIP2 database.

(cherry picked from commit ec8334fb743ecd8ae29f2751dab0fd86b7334327)
lib/dns/geoip2.c
lib/dns/tests/geoip_test.c