[gitg] Fix possible NULL deref
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Fix possible NULL deref
- Date: Sat, 23 Jul 2011 11:53:01 +0000 (UTC)
commit 21842783bfe4aabe93f6236ea31d59bd98bdb4e4
Author: Garrett Regier <garrettregier gmail com>
Date: Sat Jul 23 04:02:32 2011 -0700
Fix possible NULL deref
gitg/gitg-branch-actions.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gitg/gitg-branch-actions.c b/gitg/gitg-branch-actions.c
index 4edafb2..2d46d05 100644
--- a/gitg/gitg-branch-actions.c
+++ b/gitg/gitg-branch-actions.c
@@ -67,9 +67,11 @@ static gchar const **
parse_valist (va_list ap)
{
gchar const *a;
- gchar const **ret = NULL;
+ gchar const **ret;
guint num = 0;
+ ret = g_new (gchar const *, 1);
+
while ( (a = va_arg (ap, gchar const *)) != NULL)
{
ret = g_realloc (ret, sizeof (gchar const *) * (++num + 1));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]