diff --git a/CHANGES b/CHANGES index 60ba9d5311..5161697276 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5586. [bug] An invalid direction field in a LOC record resulted in + an INSIST failure. [GL #2499] + 5585. [func] Implementations of memory contexts and memory pools were refactored to reduce lock contention for shared memory contexts by replacing mutexes with atomic operations. diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index 9fdc8fd32b..508fbb0226 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -48,3 +48,6 @@ Bug Fixes of sending a proper response back. Rollback setting the IP_DONTFRAG on the UDP sockets that we enabled during the DNS Flag Day 2020 to fix this issue. [GL #2487] + +- An invalid direction field (not one of 'N'/'S' or 'E'/'W') in a LOC record + triggered an INSIST failure. [GL #2499] diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index 5ab231cb93..478723ae6c 100644 --- a/lib/dns/rdata/generic/loc_29.c +++ b/lib/dns/rdata/generic/loc_29.c @@ -242,7 +242,7 @@ loc_getcoordinate(isc_lex_t *lexer, unsigned long *dp, unsigned long *mp, * Direction. */ RETERR(get_direction(lexer, &token, directions, &direction)); - if (direction == -1) { + if (direction == 0) { RETERR(DNS_R_SYNTAX); } done: diff --git a/lib/dns/tests/rdata_test.c b/lib/dns/tests/rdata_test.c index 9cf32c2849..877660f67d 100644 --- a/lib/dns/tests/rdata_test.c +++ b/lib/dns/tests/rdata_test.c @@ -2017,6 +2017,7 @@ loc(void **state) { TEXT_INVALID("90 0 1 S 180 W 0"), TEXT_INVALID("90 S 180 1 W 0"), TEXT_INVALID("90 S 180 0 1 W 0"), + TEXT_INVALID("0 0 0.000 E 0 0 0.000 E -0.95m 1m 10000m 10m"), TEXT_VALID("0 0 0.000 N 0 0 0.000 E -0.95m 1m 10000m 10m"), TEXT_VALID("0 0 0.000 N 0 0 0.000 E -0.05m 1m 10000m 10m"), TEXT_VALID("0 0 0.000 N 0 0 0.000 E -100000.00m 1m 10000m 10m"),