summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-09-15 10:00:03 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-15 10:00:03 -0700
commit4c939b9e9f84df00ee65eb7aaffacbf88b60def8 (patch)
treeab477e796186e83ce80b3a493ffa4b2d8520286c /Source
parentbf67a54e6a1e5ab331404b6e745a6c27c840d6dd (diff)
parent50c829a5ccdfac52020f6ddd3e9eda7b87c11fd0 (diff)
downloadexternal_webkit-4c939b9e9f84df00ee65eb7aaffacbf88b60def8.zip
external_webkit-4c939b9e9f84df00ee65eb7aaffacbf88b60def8.tar.gz
external_webkit-4c939b9e9f84df00ee65eb7aaffacbf88b60def8.tar.bz2
Merge "Fix handling of empty URLs when setting up the NoDomain error page"
Diffstat (limited to 'Source')
-rw-r--r--Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index 9de6c09..31eed62 100644
--- a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -373,10 +373,16 @@ void FrameLoaderClientAndroid::dispatchDidFailProvisionalLoad(const ResourceErro
url.append(buf, res);
}
}
+ // Vector sets up its data buffer lazilly, so if failingUrl is the empty
+ // string, the data buffer will be null. This will result in sanitizedUrl
+ // being null, and the string substitution below will be a no-op.
+ // FIXME: Ideally we'd always have a non-empty URL, or at least improve the
+ // wording of the error page in this case. See http://b/5293782.
+ String sanitizedUrl = url.data() ? String(url.data(), url.size()) : "";
// Replace all occurances of %s with the failing url.
String s = UTF8Encoding().decode((const char*)a->getBuffer(false), a->getLength());
- s = s.replace("%s", String(url.data(), url.size()));
+ s = s.replace("%s", sanitizedUrl);
// Replace all occurances of %e with the error text
s = s.replace("%e", error.localizedDescription());