[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
jianli at chromium.org
jianli at chromium.org
Wed Dec 22 13:30:44 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 4dbf81b7391b61c0058d6104a821df1284d88dd2
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 17 18:59:15 2010 +0000
createBlobURL with no argument causes crash.
https://bugs.webkit.org/show_bug.cgi?id=45880
Reviewed by Dmitry Titov.
WebCore:
The fix is to check if the passing blob argument is NULL or not.
Test: fast/files/create-blob-url-crash.html
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::createPublicBlobURL):
* page/DOMWindow.idl: Add attribute to convert null string to undefined.
LayoutTests:
* fast/files/create-blob-url-crash-expected.txt: Added.
* fast/files/create-blob-url-crash.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 34b1ee1..3cbb105 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-17 Jian Li <jianli at chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ createBlobURL with no argument causes crash.
+ https://bugs.webkit.org/show_bug.cgi?id=45880
+
+ * fast/files/create-blob-url-crash-expected.txt: Added.
+ * fast/files/create-blob-url-crash.html: Added.
+
2010-09-17 Brian Weinstein <bweinstein at apple.com>
Rubber-stamped by Adam Roben.
diff --git a/LayoutTests/fast/files/create-blob-url-crash-expected.txt b/LayoutTests/fast/files/create-blob-url-crash-expected.txt
new file mode 100644
index 0000000..2b5356a
--- /dev/null
+++ b/LayoutTests/fast/files/create-blob-url-crash-expected.txt
@@ -0,0 +1,4 @@
+Test that createBlobURL with no argument should not cause crash.
+PASS
+DONE
+
diff --git a/LayoutTests/fast/files/create-blob-url-crash.html b/LayoutTests/fast/files/create-blob-url-crash.html
new file mode 100644
index 0000000..7b66221
--- /dev/null
+++ b/LayoutTests/fast/files/create-blob-url-crash.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function log(message)
+{
+ document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
+}
+
+function test()
+{
+ log("Test that createBlobURL with no argument should not cause crash.");
+ var url = createBlobURL();
+ log(url == undefined ? "PASS" : "FAIL");
+
+ log("DONE");
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+</head>
+<body onload="test()">
+<pre id='console'></pre>
+</body>
+</html>
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 83b94ae..1a550da 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-17 Jian Li <jianli at chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ createBlobURL with no argument causes crash.
+ https://bugs.webkit.org/show_bug.cgi?id=45880
+
+ The fix is to check if the passing blob argument is NULL or not.
+
+ Test: fast/files/create-blob-url-crash.html
+
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::createPublicBlobURL):
+ * page/DOMWindow.idl: Add attribute to convert null string to undefined.
+
2010-09-17 Chris Marrin <cmarrin at apple.com>
Reviewed by Simon Fraser.
diff --git a/WebCore/dom/ScriptExecutionContext.cpp b/WebCore/dom/ScriptExecutionContext.cpp
index 672a1f5..bfda17b 100644
--- a/WebCore/dom/ScriptExecutionContext.cpp
+++ b/WebCore/dom/ScriptExecutionContext.cpp
@@ -262,6 +262,8 @@ DOMTimer* ScriptExecutionContext::findTimeout(int timeoutId)
#if ENABLE(BLOB)
KURL ScriptExecutionContext::createPublicBlobURL(Blob* blob)
{
+ if (!blob)
+ return KURL();
KURL publicURL = BlobURL::createPublicURL(securityOrigin());
ThreadableBlobRegistry::registerBlobURL(publicURL, blob->url());
m_publicBlobURLs.add(publicURL.string());
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index b4c6589..23508be 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -762,7 +762,7 @@ module window {
attribute [Conditional=BLOB] BlobBuilderConstructor BlobBuilder;
#if defined(ENABLE_BLOB) && ENABLE_BLOB
- DOMString createBlobURL(in Blob blob);
+ [ConvertNullStringTo=Undefined] DOMString createBlobURL(in Blob blob);
void revokeBlobURL(in DOMString blobURL);
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list