Bug 32149 - getaddrinfo not rejecting numeric string higher than 65535 passed as port/service
Summary: getaddrinfo not rejecting numeric string higher than 65535 passed as port/ser...
Status: RESOLVED DUPLICATE of bug 16208
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-07 00:21 UTC by Antonio Quartulli
Modified: 2024-09-07 09:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Quartulli 2024-09-07 00:21:55 UTC
When passing as service a string representing a number higher than 65535, getaddrinfo() should complain and reject the translation by returning an error.

Unfortunately the current behaviour consist in decoding the string to int and extracting the lower 16 bits to be used as sin_port.

For example, when passing "70000" as service, the string is decoded as 70000 (0x11170) and then saved as 4464 (0x1170).
Comment 1 Antonio Quartulli 2024-09-07 00:23:07 UTC
I just realized this is a duplicate of #16208
Comment 2 Sam James 2024-09-07 09:10:02 UTC
Dupe then. Thanks.

*** This bug has been marked as a duplicate of bug 16208 ***