diff --git a/Changes.md b/Changes.md index d0cd76ca..ccff203e 100644 --- a/Changes.md +++ b/Changes.md @@ -5,6 +5,7 @@ * The feature test macro `_POSIX_C_SOURCE` is no longer set by `maxminddb.h`. As discussed in GitHub #318, this should be set by applications rather than by libraries. +* `assert()` is no longer used outside test code. ## 1.7.1 - 2022-09-30 diff --git a/src/maxminddb.c b/src/maxminddb.c index 27c0b6be..c4bf1916 100644 --- a/src/maxminddb.c +++ b/src/maxminddb.c @@ -8,7 +8,6 @@ #include "data-pool.h" #include "maxminddb-compat-util.h" #include "maxminddb.h" -#include #include #include #include @@ -993,10 +992,11 @@ static record_info_s record_info_for_database(const MMDB_s *const mmdb) { record_info.left_record_getter = &get_uint32; record_info.right_record_getter = &get_uint32; record_info.right_record_offset = 4; - } else { - assert(false); } + // Callers must check that right_record_offset is non-zero in case none of + // the above conditions matched. + return record_info; }