# HG changeset patch # User Mark Doliner # Date 1188457392 0 # Node ID e2135da444a5f08249f31bca5278c92d63796e39 # Parent 6c726af063c9286a0b0d55749f6e786b82039569 "text" isn't guarranteed to be null terminated, so make sure we use the given "length" parameter. Fixes #2224. diff -r 6c726af063c9 -r e2135da444a5 pidgin/gtksourceundomanager.c --- a/pidgin/gtksourceundomanager.c Thu Aug 30 06:45:27 2007 +0000 +++ b/pidgin/gtksourceundomanager.c Thu Aug 30 07:03:12 2007 +0000 @@ -677,8 +677,6 @@ if (um->priv->running_not_undoable_actions > 0) return; - g_return_if_fail (strlen (text) >= (guint)length); - undo_action.action_type = GTK_SOURCE_UNDO_ACTION_INSERT; undo_action.action.insert.pos = gtk_text_iter_get_offset (pos); @@ -774,7 +772,7 @@ *action = *undo_action; if (action->action_type == GTK_SOURCE_UNDO_ACTION_INSERT) - action->action.insert.text = g_strdup (undo_action->action.insert.text); + action->action.insert.text = g_strndup (undo_action->action.insert.text, undo_action->action.insert.length); else if (action->action_type == GTK_SOURCE_UNDO_ACTION_DELETE) action->action.delete.text = g_strdup (undo_action->action.delete.text); else