[gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 139/331] 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/temp/ubuntu-xenial-rebased-corrected: 139/331] Basic error checking of dpkg-deb's output
- Date: Wed, 4 May 2016 14:10:12 +0000 (UTC)
commit 42839962159e3184068e886d8731680b2103e427
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]