From 066ecc8f4a6ef4195194626875fe32442bf91d56 Mon Sep 17 00:00:00 2001 From: Mattias Falk Date: Tue, 15 Feb 2011 08:44:20 +0100 Subject: [PATCH] Convert cname lenght before use The length of the cname is sent in big-endian order. Thus, it has to be converted before used in android_getaddrinfo_proxy Change-Id: I1a0cc12780c47f7493fcf06f690515829f88c01e --- libc/netbsd/net/getaddrinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c index bb6645c85..edb4f707e 100644 --- a/libc/netbsd/net/getaddrinfo.c +++ b/libc/netbsd/net/getaddrinfo.c @@ -541,6 +541,7 @@ android_getaddrinfo_proxy( if (fread(&name_len, sizeof(name_len), 1, proxy) != 1) { break; } + name_len = ntohl(name_len); if (name_len != 0) { ai->ai_canonname = (char*) malloc(name_len); if (fread(ai->ai_canonname, name_len, 1, proxy) != 1) {