Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110919638
D27332.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
765 B
Referenced Files
None
Subscribers
None
D27332.diff
View Options
diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c
--- a/lib/libc/rpc/getrpcport.c
+++ b/lib/libc/rpc/getrpcport.c
@@ -62,14 +62,14 @@
assert(host != NULL);
- if ((hp = gethostbyname(host)) == NULL)
+ if ((hp = gethostbyname2(host, AF_INET)) == NULL)
return (0);
memset(&addr, 0, sizeof(addr));
addr.sin_len = sizeof(struct sockaddr_in);
addr.sin_family = AF_INET;
addr.sin_port = 0;
- if (hp->h_length > addr.sin_len)
- hp->h_length = addr.sin_len;
+ if (hp->h_length > sizeof(addr.sin_addr.s_addr))
+ hp->h_length = sizeof(addr.sin_addr.s_addr);
memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
/* Inconsistent interfaces need casts! :-( */
return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 25, 10:12 PM (1 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16842584
Default Alt Text
D27332.diff (765 B)
Attached To
Mode
D27332: Fix buffer overrun in getrpcport(3)
Attached
Detach File
Event Timeline
Log In to Comment