diff options
3 files changed, 8 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index 14ac72fe1d..ff9e4b2179 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -187,7 +187,7 @@ ValidatePassword ( ASSERT (EncodedPassword != NULL);
StrnCpy (EncodedPassword, Password, StrLen (Password));
EncodePassword (EncodedPassword, StrLen (EncodedPassword) * sizeof (CHAR16));
- if (CompareMem (EncodedPassword, PrivateData->Configuration.WhatIsThePassword2, StrLen (EncodedPassword) * sizeof (CHAR16)) != 0) {
+ if (CompareMem (EncodedPassword, PrivateData->Configuration.WhatIsThePassword2, PasswordMaxSize) != 0) {
//
// Old password mismatch, return EFI_NOT_READY to prompt for error message
//
@@ -355,7 +355,7 @@ LoadNameValueNames ( @retval EFI_SUCCESS The Results is filled with the requested values.
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
- @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
+ @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this
driver.
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 4f68d98e6b..38812f92f2 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -661,7 +661,7 @@ UpdateBindingDriverSelectPage ( // Switch the item callback key value to its NO. in mDevicePathHandleBuffer
//
mSelectedCtrIndex = KeyValue - KEY_VALUE_DEVICE_OFFSET;
- ASSERT (mSelectedCtrIndex < MAX_CHOICE_NUM);
+ ASSERT (mSelectedCtrIndex >= 0 && mSelectedCtrIndex < MAX_CHOICE_NUM);
mLastSavedDriverImageNum = 0;
@@ -1145,7 +1145,7 @@ CommintChanges ( @retval EFI_SUCCESS The Results is filled with the requested values.
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
- @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
+ @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
**/
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c index 2541743f4f..2905006856 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c @@ -464,16 +464,20 @@ TheKey2: }
if (MenuOption->Sequence == 0) {
+ ASSERT (EraseLen >= 2);
FormattedNumber[EraseLen - 2] = DATE_SEPARATOR;
} else if (MenuOption->Sequence == 1) {
+ ASSERT (EraseLen >= 1);
FormattedNumber[EraseLen - 1] = DATE_SEPARATOR;
}
} else if (Question->Operand == EFI_IFR_TIME_OP) {
UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", (UINT8) EditValue);
if (MenuOption->Sequence == 0) {
+ ASSERT (EraseLen >= 2);
FormattedNumber[EraseLen - 2] = TIME_SEPARATOR;
} else if (MenuOption->Sequence == 1) {
+ ASSERT (EraseLen >= 1);
FormattedNumber[EraseLen - 1] = TIME_SEPARATOR;
}
} else {
|