Commit a4b773e7 authored by Jüri Valdmann's avatar Jüri Valdmann Committed by Commit Bot

Fix hunspell::NodeReader::affix_id_for_leaf() bounds check

This method checks for 3 bytes of available data, but reads only 2 bytes.

Change-Id: I504e9ed6cda18907a3f74cd931ef97d910043df5
Reviewed-on: https://chromium-review.googlesource.com/1185019Reviewed-by: default avatarRachel Blum <groby@chromium.org>
Commit-Queue: Rachel Blum <groby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585076}
parent 5ddcf273
...@@ -76,7 +76,7 @@ class NodeReader { ...@@ -76,7 +76,7 @@ class NodeReader {
// additional affix IDs following the node when leaf_has_following is set, // additional affix IDs following the node when leaf_has_following is set,
// but this will not handle those. // but this will not handle those.
inline int affix_id_for_leaf() const { inline int affix_id_for_leaf() const {
if (node_offset_ >= bdict_length_ - 2) { if (node_offset_ >= bdict_length_ - 1) {
is_valid_ = false; is_valid_ = false;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment