Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: Source/WebCore/fileapi/WebKitBlobBuilder.cpp

Issue 7003106: Merge 88510 - Calling WebKitBlobBuilder.append with null argument should not crash (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/files/blob-builder-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/fileapi/WebKitBlobBuilder.cpp
===================================================================
--- Source/WebCore/fileapi/WebKitBlobBuilder.cpp (revision 88511)
+++ Source/WebCore/fileapi/WebKitBlobBuilder.cpp (working copy)
@@ -88,6 +88,8 @@
#if ENABLE(BLOB)
void WebKitBlobBuilder::append(ArrayBuffer* arrayBuffer)
{
+ if (!arrayBuffer)
+ return;
Vector<char>& buffer = getBuffer();
size_t oldSize = buffer.size();
buffer.append(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength());
@@ -97,6 +99,8 @@
void WebKitBlobBuilder::append(Blob* blob)
{
+ if (!blob)
+ return;
if (blob->isFile()) {
// If the blob is file that is not snapshoted, capture the snapshot now.
// FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous.
Property changes on: Source\WebCore\fileapi\WebKitBlobBuilder.cpp
___________________________________________________________________
Added: svn:mergeinfo
Merged /trunk/WebCore/fileapi/WebKitBlobBuilder.cpp:r53455
« no previous file with comments | « LayoutTests/fast/files/blob-builder-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698