[gnome-software/gnome-3-24] 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/gnome-3-24] trivial: Prevent critical warning when trying to parse an invalid URI
- Date: Mon, 8 May 2017 12:31:05 +0000 (UTC)
commit de98a7a721f42186e259957a2e24bcba4d88c031
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 c1c892a..e334dbe 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1262,6 +1262,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]