From 28bac5767051c39552b943b7d2ba5173ade50c25 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 1 Aug 2003 20:46:44 +0000 Subject: [PATCH] Fix obvious reallocation bug in rarely or never hit code path (#118071, Fri Aug 1 16:44:51 2003 Owen Taylor * gtk/gtkfilesel.c (update_cmpl): Fix obvious reallocation bug in rarely or never hit code path (#118071, Tor Lillqvist) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkfilesel.c | 2 +- 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e79b36dc3..12097a224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Aug 1 16:44:51 2003 Owen Taylor + + * gtk/gtkfilesel.c (update_cmpl): Fix obvious reallocation + bug in rarely or never hit code path (#118071, + Tor Lillqvist) + Fri Aug 1 16:30:13 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (_gdk_x11_have_render): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e79b36dc3..12097a224 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Fri Aug 1 16:44:51 2003 Owen Taylor + + * gtk/gtkfilesel.c (update_cmpl): Fix obvious reallocation + bug in rarely or never hit code path (#118071, + Tor Lillqvist) + Fri Aug 1 16:30:13 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (_gdk_x11_have_render): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e79b36dc3..12097a224 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Fri Aug 1 16:44:51 2003 Owen Taylor + + * gtk/gtkfilesel.c (update_cmpl): Fix obvious reallocation + bug in rarely or never hit code path (#118071, + Tor Lillqvist) + Fri Aug 1 16:30:13 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (_gdk_x11_have_render): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e79b36dc3..12097a224 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Fri Aug 1 16:44:51 2003 Owen Taylor + + * gtk/gtkfilesel.c (update_cmpl): Fix obvious reallocation + bug in rarely or never hit code path (#118071, + Tor Lillqvist) + Fri Aug 1 16:30:13 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (_gdk_x11_have_render): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e79b36dc3..12097a224 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Fri Aug 1 16:44:51 2003 Owen Taylor + + * gtk/gtkfilesel.c (update_cmpl): Fix obvious reallocation + bug in rarely or never hit code path (#118071, + Tor Lillqvist) + Fri Aug 1 16:30:13 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (_gdk_x11_have_render): diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index b105970fb..647deb453 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -3727,10 +3727,10 @@ update_cmpl (PossibleCompletion *poss, if (cmpl_state->updated_text_alloc < cmpl_len + 1) { + cmpl_state->updated_text_alloc = 2*cmpl_len; cmpl_state->updated_text = (gchar*)g_realloc (cmpl_state->updated_text, cmpl_state->updated_text_alloc); - cmpl_state->updated_text_alloc = 2*cmpl_len; } if (cmpl_state->updated_text_len < 0)