[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56425] trunk/blender/source/blender/ editors/space_console/console_ops.c: fix for yet another off by one error in console code, could crash deleting words (but mostly it was hidden by guardedalloc), hopefully the last of this kind in console.

Campbell Barton ideasman42 at gmail.com
Wed May 1 00:46:41 CEST 2013


Revision: 56425
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56425
Author:   campbellbarton
Date:     2013-04-30 22:46:41 +0000 (Tue, 30 Apr 2013)
Log Message:
-----------
fix for yet another off by one error in console code, could crash deleting words (but mostly it was hidden by guardedalloc), hopefully the last of this kind in console.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_console/console_ops.c

Modified: trunk/blender/source/blender/editors/space_console/console_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_ops.c	2013-04-30 22:27:52 UTC (rev 56424)
+++ trunk/blender/source/blender/editors/space_console/console_ops.c	2013-04-30 22:46:41 UTC (rev 56425)
@@ -570,7 +570,7 @@
 				                         (type == DEL_NEXT_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM, true);
 				stride = pos - ci->cursor;
 				if (stride) {
-					memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1);
+					memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - (ci->cursor + stride)) + 1);
 					ci->len -= stride;
 					BLI_assert(ci->len >= 0);
 					done = TRUE;




More information about the Bf-blender-cvs mailing list