[gnome-software/wip/rancell/apt] Basic error checking of dpkg-deb's output
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/apt] Basic error checking of dpkg-deb's output
- Date: Thu, 3 Mar 2016 21:21:29 +0000 (UTC)
commit 8dbd736181da6fe9bc1a2f2082b490aa04ab1f43
Author: William Hua <william hua canonical com>
Date: Thu Mar 3 16:20:55 2016 -0500
Basic error checking of dpkg-deb's output
src/plugins/gs-plugin-apt.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.c b/src/plugins/gs-plugin-apt.c
index afa9ced..fc1e5ac 100644
--- a/src/plugins/gs-plugin-apt.c
+++ b/src/plugins/gs-plugin-apt.c
@@ -879,6 +879,15 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
return FALSE;
tokens = g_strsplit (output, "\n", 0);
+
+ if (g_strv_length (tokens) < 5) {
+ g_set_error (error,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_FAILED,
+ "dpkg-deb output format incorrect:\n\"%s\"\n", output);
+ return FALSE;
+ }
+
description = g_strjoinv (NULL, tokens + 5);
app = gs_app_new (tokens[0]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]