[gnome-software] trivial: Prevent critical warning when trying to parse an invalid URI
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Prevent critical warning when trying to parse an invalid URI
- Date: Mon, 8 May 2017 11:31:57 +0000 (UTC)
commit 23f32dcef9d8dc750b411b32982e81f0b0b7be22
Author: Richard Hughes <richard hughsie com>
Date: Fri May 5 20:52:13 2017 +0100
trivial: Prevent critical warning when trying to parse an invalid URI
lib/gs-plugin.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index a8f2f04..dc29e56 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1284,6 +1284,13 @@ gs_plugin_download_file (GsPlugin *plugin,
/* remote */
g_debug ("downloading %s to %s from plugin %s", uri, filename, priv->name);
msg = soup_message_new (SOUP_METHOD_GET, uri);
+ if (msg == NULL) {
+ g_set_error (error,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_DOWNLOAD_FAILED,
+ "failed to parse URI %s", uri);
+ return FALSE;
+ }
if (app != NULL) {
helper.plugin = plugin;
helper.app = app;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]