From 98eed0d673618382eb8d4b158f467ab077f1d30d Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sat, 10 May 2008 21:38:23 -0300 Subject: [PATCH] Fix an off by one error check that can lead to an infinite loop. This can happen when using the line edit mode to search&replace regexes. --- hook.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hook.c b/hook.c index 8d2eb22..7dd6da0 100644 --- a/hook.c +++ b/hook.c @@ -934,7 +934,9 @@ confirm_label: } memcpy(einfo.line, block.ptr, block.length); length = block.length; - for (position += length; position < to; position += block.length) { + for (position += length; + position < to && block.length; + position += block.length) { XawTextSourceRead(source, position, &block, to - position); memcpy(einfo.line + length, block.ptr, block.length); length += block.length; -- 1.5.4.3