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



commit 394b33da8b2cb1fb99b6d7bd006d7a44f1bdc53e
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 2edf10d..7b63d19 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]