Skip to content
Browse files

[GTK] Bad utf8 data is being passed to enchant_dict_check

https://bugs.webkit.org/show_bug.cgi?id=94202

Patch by Mario Sanchez Prada <msanchez@igalia.com> on 2012-08-16
Reviewed by Martin Robinson.

Pass the number of bytes instead of the number of UTF8 characters
when calling enchant_dict_check.

* platform/text/gtk/TextCheckerEnchant.cpp:
(TextCheckerEnchant::checkSpellingOfString): Use 'bytes' instead
of 'wordLength'.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent 458695b commit b3d6cb676470e7b2c1d076b5369f73ecf29050c0 commit-queue committed Aug 16, 2012
Showing with 15 additions and 1 deletion.
  1. +14 −0 Source/WebCore/ChangeLog
  2. +1 −1 Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp
View
14 Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2012-08-16 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [GTK] Bad utf8 data is being passed to enchant_dict_check
+ https://bugs.webkit.org/show_bug.cgi?id=94202
+
+ Reviewed by Martin Robinson.
+
+ Pass the number of bytes instead of the number of UTF8 characters
+ when calling enchant_dict_check.
+
+ * platform/text/gtk/TextCheckerEnchant.cpp:
+ (TextCheckerEnchant::checkSpellingOfString): Use 'bytes' instead
+ of 'wordLength'.
+
2012-08-16 Sergey Rogulenko <rogulenko@google.com>
Web Inspector: added Paint events for Images to TimelineAgent
View
2 Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp
@@ -115,7 +115,7 @@ void TextCheckerEnchant::checkSpellingOfString(const String& string, int& misspe
g_utf8_strncpy(word.get(), cstart, wordLength);
for (; dictIter != m_enchantDictionaries.end(); ++dictIter) {
- if (enchant_dict_check(*dictIter, word.get(), wordLength)) {
+ if (enchant_dict_check(*dictIter, word.get(), bytes)) {
misspellingLocation = start;
misspellingLength = wordLength;
} else {

0 comments on commit b3d6cb6

Please sign in to comment.
Something went wrong with that request. Please try again.