diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-05-10 21:38:23 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-07-02 19:08:17 -0300 |
commit | c23ce2ff2439f09d00dc2c226562d44f02ca591a (patch) | |
tree | f0fd8f966a0a31cf44ce130188ff5fa663436db3 | |
parent | 2b4ebe868b660a69800dc5fe801bbcc05ccaefac (diff) |
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.
-rw-r--r-- | hook.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |