summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-03-29 04:50:56 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2015-03-29 04:50:56 -0500
commitcd5f92704e1e17bbc0c15d197f3bc236c7dc9bf2 (patch)
tree1400302b543e4528aedea5d72731983559cfcf36 /libc/inet
parentad2bffbf1926051ef333f9899344f6bddf2c03cf (diff)
parent24946289317ea23bb0d1814cca0a499a905f7d6f (diff)
merge uClibc git master
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/resolv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index cfc1eee9b..31e63810b 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1615,9 +1615,13 @@ int __read_etc_hosts_r(
#endif
;
int ret = HOST_NOT_FOUND;
+ /* make sure pointer is aligned */
+ int i = ALIGN_BUFFER_OFFSET(buf);
+ buf += i;
+ buflen -= i;
*h_errnop = NETDB_INTERNAL;
- if (buflen < aliaslen
+ if (/* (ssize_t)buflen < 0 || */ buflen < aliaslen
|| (buflen - aliaslen) < BUFSZ + 1)
return ERANGE;
if (parser == NULL)