summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-02-25 15:46:42 +0000
committerKristian Monsen <kristianm@google.com>2011-02-25 16:04:06 +0000
commit0aef32fdccacdc2f81bcc13cffbf0641b33227aa (patch)
treede7337bb7e4656ea9f1eda019074b2036ff1c64d /net
parent50bb8b7f64c84a88670da4ed4e47cf9a1a374814 (diff)
downloadexternal_chromium-0aef32fdccacdc2f81bcc13cffbf0641b33227aa.zip
external_chromium-0aef32fdccacdc2f81bcc13cffbf0641b33227aa.tar.gz
external_chromium-0aef32fdccacdc2f81bcc13cffbf0641b33227aa.tar.bz2
Fix for bug 3435888 Native crash in Browser
It looks like the Android getaddrinfo sometimes does not set the addrinfo structure and does not return an error. This should make sure we do not crash if that happens. The native part of the java net library also checks for 0 here: http://android.git.kernel.org/?p=platform/libcore.git;a=blob;f=luni/src/main/native/java_net_InetAddress.cpp;h=8c810752cd15825bea9974fe1ec00558e1dd3685;hb=HEAD Change-Id: I2ac14cf58905448661cc4f932373ed7dbddf70ff
Diffstat (limited to 'net')
-rw-r--r--net/base/host_resolver_proc.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 3cb3b51..36f0a4b 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -234,7 +234,11 @@ int SystemHostResolverProc(const std::string& host,
err = getaddrinfo(host.c_str(), NULL, &hints, &ai);
}
+#ifdef ANDROID
+ if (err || ai == NULL) {
+#else
if (err) {
+#endif
#if defined(OS_WIN)
err = WSAGetLastError();
#endif