[gnome-software/wip/temp/ubuntu-xenial-rebased: 139/326] Basic error checking of dpkg-deb's output
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/temp/ubuntu-xenial-rebased: 139/326] Basic error checking of dpkg-deb's output
- Date: Fri, 29 Apr 2016 09:59:01 +0000 (UTC)
commit 0302ad9024898fc13d0f448d344cc567b5adfec2
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 731aa41..c90e481 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]