| Summary: | getaddrinfo doesn't compute length for sort rule 9 correctly | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Herbie.Robinson | ||||
| Component: | bin | Assignee: | Andrey A. Chernov <ache> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Many People | CC: | ache | ||||
| Priority: | --- | Keywords: | patch | ||||
| Version: | CURRENT | Flags: | ache:
mfc-stable11+
ache: mfc-stable10+ |
||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Created attachment 174253 [details]
Patch based on version 304911 in head.
A commit references this bug: Author: ache Date: Wed Aug 31 18:49:50 UTC 2016 New revision: 305144 URL: https://svnweb.freebsd.org/changeset/base/305144 Log: 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com MFC after: 7 days Changes: head/lib/libc/net/getaddrinfo.c head/lib/libc/net/name6.c A commit references this bug: Author: ache Date: Mon Sep 5 00:36:53 UTC 2016 New revision: 305401 URL: https://svnweb.freebsd.org/changeset/base/305401 Log: MFC r305144 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com Changes: _U stable/10/ stable/10/lib/libc/net/getaddrinfo.c stable/10/lib/libc/net/name6.c A commit references this bug: Author: ache Date: Mon Sep 5 00:41:17 UTC 2016 New revision: 305402 URL: https://svnweb.freebsd.org/changeset/base/305402 Log: MFC r305144 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com Changes: _U stable/11/ stable/11/lib/libc/net/getaddrinfo.c stable/11/lib/libc/net/name6.c |
The routine "matchlen" in getaddrinfo contains the following loop: while (r < addrlen * 8) { It should be while ((r & 0x80) == 0) { While this bug does, in theory, affect a lot of people, I seriously doubt many of them will notice.