DO NOT MERGE Cherry-pick of 0ee092fb2 from master

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: I78552d427ef6500d9121fc83423f0744ea0c3087
This commit is contained in:
Mattias Falk 2011-02-15 08:44:20 +01:00 committed by Jason Chen
parent b67c1bacd0
commit 4489244058

View File

@ -521,6 +521,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) {