diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2015-03-29 04:50:56 -0500 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2015-03-29 04:50:56 -0500 |
commit | cd5f92704e1e17bbc0c15d197f3bc236c7dc9bf2 (patch) | |
tree | 1400302b543e4528aedea5d72731983559cfcf36 /libc/inet | |
parent | ad2bffbf1926051ef333f9899344f6bddf2c03cf (diff) | |
parent | 24946289317ea23bb0d1814cca0a499a905f7d6f (diff) |
merge uClibc git master
Diffstat (limited to 'libc/inet')
-rw-r--r-- | libc/inet/resolv.c | 6 |
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) |