bind9/bin
Michal Nowak bb8321c637 Validate nsec3hash arguments instead of relying on atoi()
The nsec3hash tool parsed its algorithm, flags, and iterations
arguments with atoi(), then range-checked the result. For values
that overflow int during digit-by-digit accumulation, atoi() is
undefined; in practice on musl libc the modular wrap leaves
n == 0, which silently passes the "iterations > 0xffffU" check.
On Alpine Linux this made nsec3hash succeed with iterations
treated as 0 for inputs like 4294967296 (2^32).

The latent bug only surfaced when the recent image rebuild pulled
in Hypothesis 6.152.9 (2026-05-19), which unified the distribution
used for bounded and unbounded integers() strategies. The new
smoother distribution explores the 2^32 boundary on unbounded
ranges like integers(min_value=65536); earlier versions did not
reach there, so test_nsec3hash_too_many_iterations only started
failing on Alpine after the image refresh.

Replace the three atoi() calls with isc_parse_uint8 /
isc_parse_uint16, which uniformly reject overflow, trailing
garbage, leading sign, and non-numeric input across libc
implementations. As a side effect, error messages now include
the offending argument and a specific reason ("out of range" vs
"not a valid number").

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit e13302a6bc)
2026-05-21 11:41:29 +00:00
..
check Resolve ERR_MISSING_GLUE / ERR_EXTRA_AAAA value collision 2026-04-29 15:31:58 +00:00
confgen Size HMAC key generation buffers to the maximum block size 2026-04-30 06:00:07 +02:00
delv Skip detach when delv's client never created 2026-04-30 12:07:49 +02:00
dig Add examples to the dig man page 2026-02-22 16:21:13 +00:00
dnssec Fix off by one error in dnssec-ksr sign 2026-04-07 08:32:58 +00:00
named Merge tag 'v9.20.23' into bind-9.20 2026-05-20 10:18:28 +00:00
nsupdate nsupdate does not handle zero length RDATA well 2026-04-09 00:34:15 +00:00
plugins standardize CHECK and RETERR macros 2025-12-03 19:17:20 -08:00
rndc List 'rndc dnssec' arguments in alphabetic order 2026-02-18 14:20:53 +00:00
tests Follow common naming and coding conventions 2026-05-21 12:02:20 +02:00
tools Validate nsec3hash arguments instead of relying on atoi() 2026-05-21 11:41:29 +00:00
Makefile.am Remove native PKCS#11 support 2021-09-09 15:35:39 +02:00