Fixed high AddressType variable used without being assigned

In RangeMap::StoreRangeInternal, when size <= 0 and !high_ok then the
high variable is passed to HexString uninitialized.

Change-Id: I7e597cadaf248b607c646534a5d800c17ccdeda9
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/5155712
Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
Nathan Moinvaziri 2023-12-29 07:23:17 -08:00 committed by Robert Sesek
parent 11ec9c3288
commit ed1d564c9e

View file

@ -57,7 +57,7 @@ template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::StoreRangeInternal( bool RangeMap<AddressType, EntryType>::StoreRangeInternal(
const AddressType& base, const AddressType& delta, const AddressType& base, const AddressType& delta,
const AddressType& size, const EntryType& entry) { const AddressType& size, const EntryType& entry) {
AddressType high; AddressType high = AddressType();
bool high_ok = false; bool high_ok = false;
if (size > 0) { if (size > 0) {
std::pair<AddressType, bool> result = AddWithOverflowCheck(base, size - 1); std::pair<AddressType, bool> result = AddWithOverflowCheck(base, size - 1);