3
4
Fork
You've already forked validns
5

fix: parse -t as unsigned 32-bit epoch #125

Merged
jelu merged 2 commits from tobez/validns:fix-2038-t-flag-32bit-clamp into main 2026年05月18日 09:51:38 +02:00
Collaborator
Copy link

-t parsed with strtol() silently clamped post-2038 values to LONG_MAX on 32-bit hosts (breaking the issue-89 tests on Debian i386), and truncated them to UINT32_MAX on 64-bit hosts. Parse with strtoull() and reject anything outside [0, 0xFFFFFFFF].

Regression test runs validns -t99999999999 against an unsigned zone so silent clamping would show up as rc=0.

-t parsed with strtol() silently clamped post-2038 values to LONG_MAX on 32-bit hosts (breaking the issue-89 tests on Debian i386), and truncated them to UINT32_MAX on 64-bit hosts. Parse with strtoull() and reject anything outside [0, 0xFFFFFFFF]. Regression test runs validns -t99999999999 against an unsigned zone so silent clamping would show up as rc=0.
test: regression test for -t out-of-uint32 rejection
All checks were successful
builds.sr.ht/freebsd Job completed
builds.sr.ht/openbsd Job completed
test / debian (pull_request) Successful in 44s
test / ubuntu (pull_request) Successful in 45s
test / centos (pull_request) Successful in 1m0s
test / scan-build (pull_request) Successful in 1m13s
d478a6eeed
Owner
Copy link

#build

#build
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DNS-OARC/validns!125
Reference in a new issue
DNS-OARC/validns
No description provided.
Delete branch "tobez/validns:fix-2038-t-flag-32bit-clamp"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?