commit | f5cded1c6cf0f39df13750d4f9f5ba66c1b32964 | [log] [tgz] |
---|---|---|
author | satok <satok@google.com> | Mon Dec 06 21:28:24 2010 +0900 |
committer | satok <satok@google.com> | Mon Dec 06 22:58:56 2010 +0900 |
tree | 36b85632d436e00fbce2ca31c5ac7170e70abadf | |
parent | 48e432ceb830c1932bd4f52d5fd2780b94685bf7 [diff] [blame] |
Fix a crash when MAX_WORD_LENGTH is too short. Change-Id: Idcb5aa2685321b8d0ac7d846caecbd1c79e4dd77
diff --git a/native/src/bigram_dictionary.cpp b/native/src/bigram_dictionary.cpp index 095b805..7bfef38 100644 --- a/native/src/bigram_dictionary.cpp +++ b/native/src/bigram_dictionary.cpp
@@ -146,7 +146,7 @@ bool firstAddress = true; bool haveToSearchAll = true; - if (depth >= 0) { + if (depth < MAX_WORD_LENGTH && depth >= 0) { word[depth] = (unsigned short) followingChar; } pos = followDownBranchAddress; // pos start at count