Skip to content

Commit

Permalink
ICU-22764 Fix gendict memory safety in toml uchars mode
Browse files Browse the repository at this point in the history
(cherry picked from commit 23bf38f)
  • Loading branch information
sffc committed May 3, 2024
1 parent 7750081 commit 7bc1b89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion icu4c/source/tools/gendict/gendict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ int main(int argc, char **argv) {
fprintf(f, "transform_type = \"%s\"\n", isOffset ? "offset" : "none");
fprintf(f, "transform_offset = %d\n", offset);

usrc_writeArray(f, "trie_data = [\n ", outData, isBytesTrie ? 8 : 16, outDataSize, " ", "\n]\n");
int32_t outDataWidth = isBytesTrie ? 8 : 16;
int32_t outDataLength = isBytesTrie ? outDataSize : outDataSize / U_SIZEOF_UCHAR;
usrc_writeArray(f, "trie_data = [\n ", outData, outDataWidth, outDataLength, " ", "\n]\n");


fclose(f);
Expand Down

0 comments on commit 7bc1b89

Please sign in to comment.