[gnome-software/gnome-3-16] screenshot image: Check if the URI passed to libsoup is valid



commit 04a9da5074965dbe0331a677b6df39034caf3a2e
Author: Kalev Lember <klember redhat com>
Date:   Wed Jun 17 17:05:16 2015 +0200

    screenshot image: Check if the URI passed to libsoup is valid
    
    ... and bail out early if it's not.

 src/gs-screenshot-image.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 7234fe6..2625335 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -447,7 +447,7 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
        /* download file */
        g_debug ("downloading %s to %s", url, priv->filename);
        base_uri = soup_uri_new (url);
-       if (base_uri == NULL) {
+       if (base_uri == NULL || !SOUP_URI_VALID_FOR_HTTP (base_uri)) {
                /* TRANSLATORS: this is when we try to download a screenshot
                 * that was not a valid URL */
                gs_screenshot_image_set_error (ssimg, _("Screenshot not valid"));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]