Title: [128067] releases/WebKitGTK/webkit-1.10/Source/WebKit2
Revision
128067
Author
[email protected]
Date
2012-09-10 09:21:43 -0700 (Mon, 10 Sep 2012)

Log Message

Merge r128050 - [GTK] Sanitize the suggested filename when building the download destination URI
https://bugs.webkit.org/show_bug.cgi?id=96260

Reviewed by Gustavo Noronha Silva.

The suggested filename returned by the server can contain
directory separators so that the filename would be interpreted as
a full path.

* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadDecideDestination): Convert any directory separator
contained in the suggested filename to an underscore.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit2/ChangeLog (128066 => 128067)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit2/ChangeLog	2012-09-10 16:17:02 UTC (rev 128066)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit2/ChangeLog	2012-09-10 16:21:43 UTC (rev 128067)
@@ -1,3 +1,18 @@
+2012-09-10  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Sanitize the suggested filename when building the download destination URI
+        https://bugs.webkit.org/show_bug.cgi?id=96260
+
+        Reviewed by Gustavo Noronha Silva.
+
+        The suggested filename returned by the server can contain
+        directory separators so that the filename would be interpreted as
+        a full path.
+
+        * UIProcess/API/gtk/WebKitDownload.cpp:
+        (webkitDownloadDecideDestination): Convert any directory separator
+        contained in the suggested filename to an underscore.
+
 2012-09-06  Carlos Garcia Campos  <[email protected]>
 
         [GTK] [WK2] Crash when navigating between pages

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp (128066 => 128067)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp	2012-09-10 16:17:02 UTC (rev 128066)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp	2012-09-10 16:21:43 UTC (rev 128067)
@@ -98,7 +98,9 @@
 {
     if (!download->priv->destinationURI.isNull())
         return FALSE;
-    GOwnPtr<char> destination(g_build_filename(g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD), suggestedFilename, NULL));
+
+    GOwnPtr<char> filename(g_strdelimit(g_strdup(suggestedFilename), G_DIR_SEPARATOR_S, '_'));
+    GOwnPtr<char> destination(g_build_filename(g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD), filename.get(), NULL));
     GOwnPtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
     download->priv->destinationURI = destinationURI.get();
     g_object_notify(G_OBJECT(download), "destination");
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to