From 6af6c96e8541c2138f5784d8b2258437d048d095 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Apr 2013 22:46:41 +0000 Subject: [PATCH] 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. --- source/blender/editors/space_console/console_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index a6379e6465f..c10ea96096f 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -570,7 +570,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) (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;