Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 11442040: Fix array-out-of-bounds error in hunspell (Closed)

Created:
8 years ago by please use gerrit instead
Modified:
8 years ago
Reviewers:
groby-ooo-7-16
CC:
chromium-reviews, rpetterson
Base URL:
https://chromium.googlesource.com/chromium/deps/hunspell.git@master
Visibility:
Public.

Description

Fix array-out-of-bounds error in hunspell If you invoke SuggestMgr::forgotchar_utf() with wl=99, then the method will write past the candidate_utf[MAXSWL] array. Here's a step through of what happens: int wl = 99; // word length is 99 charachters. w_char candidate_utf[MAXSWL]; // buffer size is 100 chars. w_char * p = candidate_utf + wl; // p = candidate_utf + 99. *(p + 1) = *p; // writing to p + 1, which is candidate_utf + 100. The fix is to reduce maximum length of spellchecked words from 99 to 98 characters. Corresponding upstream bug report: https://sourceforge.net/tracker/?func=detail&aid=3595024&group_id=143754&atid=756395 BUG=130128 Committed: 174476

Patch Set 1 #

Total comments: 3

Patch Set 2 : Better fix #

Patch Set 3 : Update google patch #

Patch Set 4 : Address comments #

Total comments: 5

Patch Set 5 : Merge with master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -17 lines) Patch
M README.chromium View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M google.patch View 1 2 3 4 16 chunks +27 lines, -16 lines 0 comments Download
M src/hunspell/hunspell.cxx View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 24 (0 generated)
please use gerrit instead
Groby: PTAL.
8 years ago (2012-12-12 01:11:08 UTC) #1
groby-ooo-7-16
https://codereview.chromium.org/11442040/diff/1/src/hunspell/suggestmgr.cxx File src/hunspell/suggestmgr.cxx (right): https://codereview.chromium.org/11442040/diff/1/src/hunspell/suggestmgr.cxx#newcode849 src/hunspell/suggestmgr.cxx:849: char candidate[MAXSWUTF8L + 4]; does this work for 100 ...
8 years ago (2012-12-12 01:19:38 UTC) #2
please use gerrit instead
https://codereview.chromium.org/11442040/diff/1/src/hunspell/suggestmgr.cxx File src/hunspell/suggestmgr.cxx (right): https://codereview.chromium.org/11442040/diff/1/src/hunspell/suggestmgr.cxx#newcode849 src/hunspell/suggestmgr.cxx:849: char candidate[MAXSWUTF8L + 4]; On 2012/12/12 01:19:38, groby wrote: ...
8 years ago (2012-12-12 05:33:53 UTC) #3
please use gerrit instead
https://codereview.chromium.org/11442040/diff/1/src/hunspell/suggestmgr.cxx File src/hunspell/suggestmgr.cxx (right): https://codereview.chromium.org/11442040/diff/1/src/hunspell/suggestmgr.cxx#newcode849 src/hunspell/suggestmgr.cxx:849: char candidate[MAXSWUTF8L + 4]; On 2012/12/12 05:33:53, Rouslan Solomakhin ...
8 years ago (2012-12-12 21:00:01 UTC) #4
groby-ooo-7-16
Wondering if a better fix would be to change that line to if (*nc *>* ...
8 years ago (2012-12-12 21:05:45 UTC) #5
please use gerrit instead
On 2012/12/12 21:05:45, groby wrote: > Wondering if a better fix would be to change ...
8 years ago (2012-12-12 21:11:23 UTC) #6
groby-ooo-7-16
That's what I meant. Clearly, my brain is still a bit flu-y ;) - rachel ...
8 years ago (2012-12-13 00:27:42 UTC) #7
please use gerrit instead
Would you mind reducing the max word length from 99 to 98?
8 years ago (2012-12-13 00:28:47 UTC) #8
groby-ooo-7-16
On 2012/12/13 00:28:47, Rouslan Solomakhin wrote: > Would you mind reducing the max word length ...
8 years ago (2012-12-13 01:20:14 UTC) #9
please use gerrit instead
Perhaps a cleaner solution would be to reduce MAXWORDLEN to 99.
8 years ago (2012-12-13 16:18:25 UTC) #10
please use gerrit instead
On 2012/12/13 16:18:25, Rouslan Solomakhin wrote: > Perhaps a cleaner solution would be to reduce ...
8 years ago (2012-12-13 16:19:51 UTC) #11
please use gerrit instead
Groby: PTAL. I've regenerated google.patch using the difference between our hunspell and hunspell-1.3.2 from sourceforge. ...
8 years ago (2012-12-13 22:38:55 UTC) #12
groby-ooo-7-16
Well, for one, it seems that the google patch diffs against hunspell 1.41 :) I'd ...
8 years ago (2012-12-13 22:52:36 UTC) #13
please use gerrit instead
Hironori: How did you generate google.patch originally? It does not appear to be a diff ...
8 years ago (2012-12-13 22:55:51 UTC) #14
Hironori Bono
Greetings, If I recall correctly, it is a diff between hunspell.cvs.sourceforge.net (the cvs repository of ...
8 years ago (2012-12-16 05:32:45 UTC) #15
please use gerrit instead
On 2012/12/16 05:32:45, Hironori Bono wrote: > By the way, for a change to a ...
8 years ago (2012-12-16 20:29:22 UTC) #16
Hironori Bono
On 2012/12/16 20:29:22, Rouslan Solomakhin wrote: > On 2012/12/16 05:32:45, Hironori Bono wrote: > > ...
8 years ago (2012-12-19 06:49:57 UTC) #17
please use gerrit instead
Groby: PTAL. - Added a comment linking to the upstream change next to the interim ...
8 years ago (2012-12-20 17:54:40 UTC) #18
groby-ooo-7-16
LGTM, but you might want to do the suggested .patch update first. https://codereview.chromium.org/11442040/diff/24001/google.patch File google.patch ...
8 years ago (2012-12-20 22:56:27 UTC) #19
please use gerrit instead
https://codereview.chromium.org/11442040/diff/24001/google.patch File google.patch (right): https://codereview.chromium.org/11442040/diff/24001/google.patch#newcode1214 google.patch:1214: + bdict_reader = reader; On 2012/12/20 22:56:28, groby wrote: ...
8 years ago (2012-12-20 22:58:00 UTC) #20
please use gerrit instead
https://codereview.chromium.org/11442040/diff/24001/google.patch File google.patch (right): https://codereview.chromium.org/11442040/diff/24001/google.patch#newcode1214 google.patch:1214: + bdict_reader = reader; On 2012/12/20 22:58:00, Rouslan Solomakhin ...
8 years ago (2012-12-20 23:48:02 UTC) #21
please use gerrit instead
https://codereview.chromium.org/11442040/diff/24001/google.patch File google.patch (right): https://codereview.chromium.org/11442040/diff/24001/google.patch#newcode911 google.patch:911: wordbreak = pAMgr->get_breaktable(); On 2012/12/20 22:56:28, groby wrote: > ...
8 years ago (2012-12-21 02:24:39 UTC) #22
please use gerrit instead
Groby: PTAL. I've merged with master, which makes google.patch much more reasonable.
8 years ago (2012-12-21 02:25:11 UTC) #23
groby-ooo-7-16
8 years ago (2012-12-21 22:18:52 UTC) #24
LGTM

Powered by Google App Engine
This is Rietveld 408576698