[gnome-software/gnome-3-22] trivial: Add some critical checks for gs_plugin_download_file()
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] trivial: Add some critical checks for gs_plugin_download_file()
- Date: Tue, 6 Dec 2016 11:55:43 +0000 (UTC)
commit 1d0c2ce0389a58a789893186393229b95de20252
Author: Richard Hughes <richard hughsie com>
Date: Thu Dec 1 20:15:15 2016 +0000
trivial: Add some critical checks for gs_plugin_download_file()
src/gs-plugin.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index 3b32285..1a1567f 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -1075,6 +1075,10 @@ gs_plugin_download_data (GsPlugin *plugin,
guint status_code;
g_autoptr(SoupMessage) msg = NULL;
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), NULL);
+ g_return_val_if_fail (uri != NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
g_debug ("downloading %s from plugin %s", uri, priv->name);
msg = soup_message_new (SOUP_METHOD_GET, uri);
if (app != NULL) {
@@ -1133,6 +1137,11 @@ gs_plugin_download_file (GsPlugin *plugin,
g_autoptr(GError) error_local = NULL;
g_autoptr(SoupMessage) msg = NULL;
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (uri != NULL, FALSE);
+ g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
g_debug ("downloading %s to %s from plugin %s", uri, filename, priv->name);
msg = soup_message_new (SOUP_METHOD_GET, uri);
if (app != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]