mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2026-10-13 21:34:42 +00:00
[PR #72] fix: reject out-of-range u16 values #73
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-tools#73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-tools/pull/72
Author: @HeisLuka
Created: 9/14/2026
Status: 🔄 Open
Base:
master← Head:fix/u16-range-overflow📝 Commits (1)
f742b8ffix: reject out-of-range u16 values📊 Changes
1 file changed (+4 additions, -2 deletions)
View changed files
📝
src/type.c(+4 -2)📄 Description
Summary
u16_range_from_string()inputs againstUINT16_MAXinstead ofUINT32_MAXerrnoaround bothstrtoul()calls so overflow is rejected explicitlyThis prevents values above
65535from being silently truncated when packed intou16_range_t.Fixes #71
Validation
Compiled the parser with
-std=gnu99 -Wall -Wextra -Werrorand exercised the boundary cases from #71, including:0,1,65535,0-65535,10-2065536,70000,20-10,65535-65536,70000-70010,4294967295, and an overflowing decimal valueAll cases passed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.