mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 09:46:53 +00:00
Fixed heap-buffer-overflow issue when Options.num_levels > 7.
Summary: Currently, when num_levels has been changed to > 7, internally it will not resize max_bytes_for_level_multiplier_additional. As a result, max_bytes_for_level_multiplier_additional.size() will be smaller than num_levels, which causes heap-buffer-overflow. Test Plan: make all check Reviewers: haobo, sdong, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D19275
This commit is contained in:
@@ -154,6 +154,9 @@ ColumnFamilyOptions::ColumnFamilyOptions(const Options& options)
|
||||
max_successive_merges(options.max_successive_merges),
|
||||
min_partial_merge_operands(options.min_partial_merge_operands) {
|
||||
assert(memtable_factory.get() != nullptr);
|
||||
if (max_bytes_for_level_multiplier_additional.size() < num_levels) {
|
||||
max_bytes_for_level_multiplier_additional.resize(num_levels, 1);
|
||||
}
|
||||
}
|
||||
|
||||
DBOptions::DBOptions()
|
||||
|
||||
Reference in New Issue
Block a user