Title: [87758] trunk
- Revision
- 87758
- Author
- [email protected]
- Date
- 2011-05-31 15:40:17 -0700 (Tue, 31 May 2011)
Log Message
2011-05-31 Berend-Jan Wever <[email protected]>
Reviewed by Adam Barth.
Add test to make sure an error in requestFileSystem or resolveLocalFileSystemURI
when no error callback is supplied does not cause a NULL ptr.
https://bugs.webkit.org/show_bug.cgi?id=49539
* fast/filesystem/filesystem-no-callback-null-ptr-crash.html: Added.
* fast/filesystem/filesystem-no-callback-null-ptr-crash-expected.txt: Added.
2011-05-31 B.J. Wever <[email protected]>
Reviewed by Adam Barth.
requestFileSystem and resolveLocalFileSystemURI are not checking if
errorCallback is NULL before scheduling a callback on error.
https://bugs.webkit.org/show_bug.cgi?id=49539
Test: fast/filesystem/filesystem-no-callback-null-ptr-crash.html
* fileapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::scheduleCallback): Only call callback if
one is supplied.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (87757 => 87758)
--- trunk/LayoutTests/ChangeLog 2011-05-31 22:26:55 UTC (rev 87757)
+++ trunk/LayoutTests/ChangeLog 2011-05-31 22:40:17 UTC (rev 87758)
@@ -1,3 +1,14 @@
+2011-05-31 Berend-Jan Wever <[email protected]>
+
+ Reviewed by Adam Barth.
+
+ Add test to make sure an error in requestFileSystem or resolveLocalFileSystemURI
+ when no error callback is supplied does not cause a NULL ptr.
+ https://bugs.webkit.org/show_bug.cgi?id=49539
+
+ * fast/filesystem/filesystem-no-callback-null-ptr-crash.html: Added.
+ * fast/filesystem/filesystem-no-callback-null-ptr-crash-expected.txt: Added.
+
2011-05-31 Hao Zheng <[email protected]>
Reviewed by Tony Chang.
Added: trunk/LayoutTests/fast/filesystem/filesystem-no-callback-null-ptr-crash-expected.txt (0 => 87758)
--- trunk/LayoutTests/fast/filesystem/filesystem-no-callback-null-ptr-crash-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/filesystem/filesystem-no-callback-null-ptr-crash-expected.txt 2011-05-31 22:40:17 UTC (rev 87758)
@@ -0,0 +1 @@
+PASS
Added: trunk/LayoutTests/fast/filesystem/filesystem-no-callback-null-ptr-crash.html (0 => 87758)
--- trunk/LayoutTests/fast/filesystem/filesystem-no-callback-null-ptr-crash.html (rev 0)
+++ trunk/LayoutTests/fast/filesystem/filesystem-no-callback-null-ptr-crash.html 2011-05-31 22:40:17 UTC (rev 87758)
@@ -0,0 +1,13 @@
+<!--
+ http://code.google.com/p/chromium/issues/detail?id=63204
+ https://bugs.webkit.org/show_bug.cgi?id=49539
+-->
+<div id="log">FAIL</div>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ // These two calls so not cause a NULL pointer crash:
+ try { window.requestFileSystem(10); } catch (e) {}
+ try { window.resolveLocalFileSystemURI(); } catch (e) {}
+ document.getElementById('log').innerHTML = "PASS";
+</script>
Modified: trunk/Source/WebCore/ChangeLog (87757 => 87758)
--- trunk/Source/WebCore/ChangeLog 2011-05-31 22:26:55 UTC (rev 87757)
+++ trunk/Source/WebCore/ChangeLog 2011-05-31 22:40:17 UTC (rev 87758)
@@ -1,3 +1,17 @@
+2011-05-31 B.J. Wever <[email protected]>
+
+ Reviewed by Adam Barth.
+
+ requestFileSystem and resolveLocalFileSystemURI are not checking if
+ errorCallback is NULL before scheduling a callback on error.
+ https://bugs.webkit.org/show_bug.cgi?id=49539
+
+ Test: fast/filesystem/filesystem-no-callback-null-ptr-crash.html
+
+ * fileapi/DOMFileSystem.cpp:
+ (WebCore::DOMFileSystem::scheduleCallback): Only call callback if
+ one is supplied.
+
2011-05-31 Brady Eidson <[email protected]>
Reviewed by Darin Adler.
Modified: trunk/Source/WebCore/fileapi/DOMFileSystem.h (87757 => 87758)
--- trunk/Source/WebCore/fileapi/DOMFileSystem.h 2011-05-31 22:26:55 UTC (rev 87757)
+++ trunk/Source/WebCore/fileapi/DOMFileSystem.h 2011-05-31 22:40:17 UTC (rev 87758)
@@ -101,8 +101,8 @@
void DOMFileSystem::scheduleCallback(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<CB> callback, PassRefPtr<CBArg> arg)
{
ASSERT(scriptExecutionContext->isContextThread());
- ASSERT(callback);
- scriptExecutionContext->postTask(adoptPtr(new DispatchCallbackTask<CB, CBArg>(callback, arg)));
+ if (callback)
+ scriptExecutionContext->postTask(adoptPtr(new DispatchCallbackTask<CB, CBArg>(callback, arg)));
}
} // namespace
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes