[gnome-builder/wip/chergert/buildcleanup: 4/10] subprocess: add more precondition checks
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/buildcleanup: 4/10] subprocess: add more precondition checks
- Date: Mon, 12 Dec 2016 03:32:17 +0000 (UTC)
commit 52fd699829665fd3efa5af1c96f38ef2bf28067c
Author: Christian Hergert <chergert redhat com>
Date: Sun Dec 11 19:13:54 2016 -0800
subprocess: add more precondition checks
libide/subprocess/ide-subprocess-launcher.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libide/subprocess/ide-subprocess-launcher.c b/libide/subprocess/ide-subprocess-launcher.c
index 154b9c8..60eead3 100644
--- a/libide/subprocess/ide-subprocess-launcher.c
+++ b/libide/subprocess/ide-subprocess-launcher.c
@@ -828,7 +828,8 @@ ide_subprocess_launcher_insert_argv (IdeSubprocessLauncher *self,
IdeSubprocessLauncherPrivate *priv = ide_subprocess_launcher_get_instance_private (self);
g_return_if_fail (IDE_IS_SUBPROCESS_LAUNCHER (self));
- g_return_if_fail (index < priv->argv->len);
+ g_return_if_fail (priv->argv->len > 0);
+ g_return_if_fail (index < (priv->argv->len - 1));
g_return_if_fail (arg != NULL);
g_ptr_array_insert (priv->argv, index, g_strdup (arg));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]