Kaydet (Commit) 428e0b4c authored tarafından Michael Stahl's avatar Michael Stahl

i18npool: ASAN: fix off-by-one in gendict's index2 array

The charArray always contains the size of lenArray *before* it is
extended, i.e., the last valid index.

Change-Id: Id1f4e1f2cb55a88ef5339e9d962a3adf4cde91f9
(cherry picked from commit 2589d545)
üst 08bb8753
...@@ -151,8 +151,8 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa ...@@ -151,8 +151,8 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa
#endif #endif
} }
} }
lenArray.push_back( lenArrayCurr ); // store last ending pointer
charArray[current+1] = lenArray.size(); charArray[current+1] = lenArray.size();
lenArray.push_back( lenArrayCurr ); // store last ending pointer
#ifndef DICT_JA_ZH_IN_DATAFILE #ifndef DICT_JA_ZH_IN_DATAFILE
fputs("\n};\n", source_fp); fputs("\n};\n", source_fp);
#endif #endif
......
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