NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/50195: Incorrect check in getnameinfo_link.
>Number: 50195
>Category: lib
>Synopsis: Incorrect check in getnameinfo_link.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 03 08:10:00 +0000 2015
>Originator: Henning Petersen
>Release: -current
>Organization:
>Environment:
>Description:
Incorrect check in getnameinfo_link.
Check is n > hostlen should be n >= hostlen.
>How-To-Repeat:
>Fix:
diff -u -p -r1.56 getnameinfo.c
--- lib/libc/net/getnameinfo.c 15 May 2015 14:26:02 -0000 1.56
+++ lib/libc/net/getnameinfo.c 3 Sep 2015 05:57:40 -0000
@@ -536,7 +535,7 @@ getnameinfo_link(const struct sockaddr *
if (sdl->sdl_nlen == 0 && sdl->sdl_alen == 0 && sdl->sdl_slen == 0) {
n = snprintf(host, hostlen, "link#%u", sdl->sdl_index);
- if (n < 0 || (socklen_t) n > hostlen) {
+ if (n < 0 || (socklen_t) n >= hostlen) {
*host = '\0';
return EAI_MEMORY;
}
Home |
Main Index |
Thread Index |
Old Index