From c23ce2ff2439f09d00dc2c226562d44f02ca591a Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sat, 10 May 2008 21:38:23 -0300 Subject: 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 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hook.c') 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; -- cgit v1.2.3