Handle null char in the middle of text in custom spellcheck dictionary engine
commit8c8781fd8590fe123cbea3ffaa589f4928a96188
authorrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 11 Jul 2013 20:08:22 +0000 (11 20:08 +0000)
committerrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 11 Jul 2013 20:08:22 +0000 (11 20:08 +0000)
tree46553c3db8cafcd9cad3ff7b7eeeeec3e562347b
parent10e82ebfba10de942551387e8d7d3f00075ac2d9
Handle null char in the middle of text in custom spellcheck dictionary engine

The code in custom spellcheck dictionary erroneously assumes that null char
terminates the string. Other code does not make this assumption, however, and
passes misspelling offsets to custom spellcheck dictionary that are past the
position of the null char. This causes an exception. The fix is to not convert
the string into a char array and then back into a string in custom spellcheck
dictionary engine.

TEST=CustomDictionaryTest.HandlesNullCharacters
TEST=CustomDictionaryTest.HandlesEmptyWordWithInvalidSubstring
BUG=258550

Review URL: https://chromiumcodereview.appspot.com/18137008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211197 0039d316-1c4b-4281-b951-d872f2087c98
chrome/renderer/spellchecker/custom_dictionary_engine.cc
chrome/renderer/spellchecker/custom_dictionary_engine.h
chrome/renderer/spellchecker/custom_dictionary_engine_unittest.cc
chrome/renderer/spellchecker/spellcheck.cc