Fixed a bug where cv record size was not correctly checked.

BUG=

Change-Id: I6c1d78cfe344c7b90a03f6df35193d67623bfd89
Reviewed-on: https://chromium-review.googlesource.com/434094
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
Joshua Peraza 2017-01-30 11:46:33 -08:00
parent 76a48f4aa9
commit cb94b71d28

View file

@ -2189,8 +2189,9 @@ const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
}
if (signature == MD_CVINFOPDB70_SIGNATURE) {
// Now that the structure type is known, recheck the size.
if (MDCVInfoPDB70_minsize > module_.cv_record.data_size) {
// Now that the structure type is known, recheck the size,
// ensuring at least one byte for the null terminator.
if (MDCVInfoPDB70_minsize + 1 > module_.cv_record.data_size) {
BPLOG(ERROR) << "MinidumpModule CodeView7 record size mismatch, " <<
MDCVInfoPDB70_minsize << " > " <<
module_.cv_record.data_size;
@ -2215,8 +2216,9 @@ const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
return NULL;
}
} else if (signature == MD_CVINFOPDB20_SIGNATURE) {
// Now that the structure type is known, recheck the size.
if (MDCVInfoPDB20_minsize > module_.cv_record.data_size) {
// Now that the structure type is known, recheck the size,
// ensuring at least one byte for the null terminator.
if (MDCVInfoPDB20_minsize + 1 > module_.cv_record.data_size) {
BPLOG(ERROR) << "MinidumpModule CodeView2 record size mismatch, " <<
MDCVInfoPDB20_minsize << " > " <<
module_.cv_record.data_size;