Title: [145167] trunk/Source/WebKit2
Revision
145167
Author
[email protected]
Date
2013-03-07 17:47:56 -0800 (Thu, 07 Mar 2013)

Log Message

Don't try to create a sandbox extension when path is empty
https://bugs.webkit.org/show_bug.cgi?id=111788

Reviewed by Anders Carlsson.

* Shared/FileAPI/BlobRegistrationData.cpp:
(WebKit::BlobRegistrationData::BlobRegistrationData): Skip File objects with empty
paths to avoid logging an error to console.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (145166 => 145167)


--- trunk/Source/WebKit2/ChangeLog	2013-03-08 01:42:17 UTC (rev 145166)
+++ trunk/Source/WebKit2/ChangeLog	2013-03-08 01:47:56 UTC (rev 145167)
@@ -1,3 +1,14 @@
+2013-03-07  Alexey Proskuryakov  <[email protected]>
+
+        Don't try to create a sandbox extension when path is empty
+        https://bugs.webkit.org/show_bug.cgi?id=111788
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/FileAPI/BlobRegistrationData.cpp:
+        (WebKit::BlobRegistrationData::BlobRegistrationData): Skip File objects with empty
+        paths to avoid logging an error to console.
+
 2013-03-07  Mark Lam  <[email protected]>
 
         WebPageProxy::exceededDatabaseQuota() needs to be serialized.

Modified: trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp (145166 => 145167)


--- trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp	2013-03-08 01:42:17 UTC (rev 145166)
+++ trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp	2013-03-08 01:47:56 UTC (rev 145167)
@@ -47,7 +47,8 @@
     const BlobDataItemList& items = m_data->items();
     size_t fileCount = 0;
     for (size_t i = 0, count = items.size(); i < count; ++i) {
-        if (items[i].type == BlobDataItem::File)
+        // File path can be empty when submitting a form file input without a file, see bug 111778.
+        if (items[i].type == BlobDataItem::File && !items[i].path.isEmpty())
             ++fileCount;
     }
 
@@ -55,7 +56,7 @@
     size_t extensionIndex = 0;
     for (size_t i = 0, count = items.size(); i < count; ++i) {
         const BlobDataItem& item = items[i];
-        if (item.type == BlobDataItem::File)
+        if (item.type == BlobDataItem::File && !items[i].path.isEmpty())
             SandboxExtension::createHandle(item.path, SandboxExtension::ReadOnly, m_sandboxExtensions[extensionIndex++]);
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to