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

Unified Diff: third_party/hunspell/google/bdict_reader.cc

Issue 2081893002: [Hunspell] Better handling of invalid dictionary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/hunspell/google/bdict_reader.cc
diff --git a/third_party/hunspell/google/bdict_reader.cc b/third_party/hunspell/google/bdict_reader.cc
index a70127d44d3982b231dfffb8c3e17f35da1b08e7..358a8e2624e3e6c96e095fecfb8a92c602e48ef0 100644
--- a/third_party/hunspell/google/bdict_reader.cc
+++ b/third_party/hunspell/google/bdict_reader.cc
@@ -782,6 +782,10 @@ LineIterator BDictReader::GetOtherLineIterator() const {
}
ReplacementIterator BDictReader::GetReplacementIterator() const {
+ if (!bdict_data_ ||
+ aff_header_->rep_offset == 0 ||
+ aff_header_->rep_offset >= bdict_length_)
+ return ReplacementIterator(bdict_data_, 0, 0); // Item is empty or invalid.
please use gerrit instead 2016/06/21 16:35:44 nit: {}
groby-ooo-7-16 2016/06/21 18:22:40 Keeping it consistent with the rest of the file.
return ReplacementIterator(bdict_data_, bdict_length_,
aff_header_->rep_offset);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698