]> git.ipfire.org Git - thirdparty/bind9.git/commit
Validate -l and -L arguments in named-checkzone
authorOndřej Surý <ondrej@isc.org>
Wed, 29 Apr 2026 12:52:21 +0000 (14:52 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 29 Apr 2026 15:25:49 +0000 (17:25 +0200)
commit042e86fa846140e42eda8f7d910f97919a08c6a5
tree7ae590ea3065c7e5d063cdcfb48ccb2d19ef8867
parent468b09feb2d9600e3bdf7d81817f8b9adc5a9d54
Validate -l and -L arguments in named-checkzone

The -l (max TTL) and -L (source serial) flags parsed their arguments
with strtol() and assigned the result directly to uint32_t with no
range check. A negative value such as -1 became UINT32_MAX, which made
-l silently disable the TTL cap it claimed to enforce, and out-of-range
values truncated to 32 bits without warning.

Switch both flags to isc_parse_uint32(), which rejects leading non-
alphanumeric input (catching '-'), checks ERANGE, and validates the
32-bit range, so an invalid argument now exits with an error instead
of being silently coerced.

Assisted-by: Claude:claude-opus-4-7
bin/check/named-checkzone.c