From 46e3066f199a6d2e289c617f29f0281c0aac5f66 Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Thu, 1 Apr 2021 12:16:42 +0800 Subject: [PATCH] fix(reverse_lookup_dictionary): writing data to overflow buffer Closes #456 --- src/rime/dict/reverse_lookup_dictionary.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rime/dict/reverse_lookup_dictionary.cc b/src/rime/dict/reverse_lookup_dictionary.cc index b7ac613f74..51b26fabe0 100644 --- a/src/rime/dict/reverse_lookup_dictionary.cc +++ b/src/rime/dict/reverse_lookup_dictionary.cc @@ -173,7 +173,7 @@ bool ReverseDb::Build(DictSettings* settings, metadata_->key_trie_size = key_trie_image_size; // save value trie image - char* value_trie_image = Allocate(); + char* value_trie_image = Allocate(value_trie_image_size); if (!value_trie_image) { LOG(ERROR) << "Error creating value trie image."; return false;