From 9b1e0fc3c807eae7e50eba536ba5c63b9a40e697 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Mon, 6 Sep 2010 06:55:31 +0000 Subject: [PATCH] avoid spell check with out of range start value git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35292 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/AppleSpeller.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/support/AppleSpeller.m b/src/support/AppleSpeller.m index feba78c1a1..aecb787551 100644 --- a/src/support/AppleSpeller.m +++ b/src/support/AppleSpeller.m @@ -94,11 +94,12 @@ SpellCheckResult AppleSpeller_check(AppleSpeller speller, const char * word, con NSString * lang_ = toString(lang); SpellCheckResult result = SPELL_CHECK_FAILED; int start = 0; - + int length = [word_ length]; + [speller->misspelled release]; speller->misspelled = nil; - while (result == SPELL_CHECK_FAILED) { + while (result == SPELL_CHECK_FAILED && start < length) { NSRange match = [speller->checker checkSpellingOfString:word_ startingAt:start