Merge "Convert cname lenght before use"

This commit is contained in:
David Turner 2011-02-16 18:58:45 -08:00 committed by Android Code Review
commit aac93c2370

View file

@ -541,6 +541,7 @@ android_getaddrinfo_proxy(
if (fread(&name_len, sizeof(name_len), 1, proxy) != 1) { if (fread(&name_len, sizeof(name_len), 1, proxy) != 1) {
break; break;
} }
name_len = ntohl(name_len);
if (name_len != 0) { if (name_len != 0) {
ai->ai_canonname = (char*) malloc(name_len); ai->ai_canonname = (char*) malloc(name_len);
if (fread(ai->ai_canonname, name_len, 1, proxy) != 1) { if (fread(ai->ai_canonname, name_len, 1, proxy) != 1) {