diff options
4 files changed, 13 insertions, 9 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c index 15fdad5..f80895b 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c @@ -14,14 +14,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "UsbMassImpl.h"
+#define USB_MASS_TRANSPORT_COUNT 3
//
// Array of USB transport interfaces.
//
-USB_MASS_TRANSPORT *mUsbMassTransport[] = {
+USB_MASS_TRANSPORT *mUsbMassTransport[USB_MASS_TRANSPORT_COUNT] = {
&mUsbCbi0Transport,
&mUsbCbi1Transport,
&mUsbBotTransport,
- NULL
};
EFI_DRIVER_BINDING_PROTOCOL gUSBMassDriverBinding = {
@@ -424,7 +424,7 @@ UsbMassInitTransport ( // If not found, return EFI_UNSUPPORTED.
// If found, execute USB_MASS_TRANSPORT.Init() to initialize the transport context.
//
- for (Index = 0; mUsbMassTransport[Index] != NULL; Index++) {
+ for (Index = 0; Index < USB_MASS_TRANSPORT_COUNT; Index++) {
*Transport = mUsbMassTransport[Index];
if (Interface.InterfaceProtocol == (*Transport)->Protocol) {
@@ -780,7 +780,7 @@ USBMassDriverBindingSupported ( // If not found, return EFI_UNSUPPORTED.
// If found, execute USB_MASS_TRANSPORT.Init() to initialize the transport context.
//
- for (Index = 0; mUsbMassTransport[Index] != NULL; Index++) {
+ for (Index = 0; Index < USB_MASS_TRANSPORT_COUNT; Index++) {
Transport = mUsbMassTransport[Index];
if (Interface.InterfaceProtocol == Transport->Protocol) {
Status = Transport->Init (UsbIo, NULL);
diff --git a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c index 24abaa6..86c1891 100644 --- a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c +++ b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c @@ -82,7 +82,7 @@ LIST_ENTRY mMappingDataBase = INITIALIZE_LIST_HEAD_VARIABLE (m EFI_HANDLE *mDevicePathHandleBuffer;
EFI_HANDLE *mDriverImageHandleBuffer;
-UINTN mSelectedCtrIndex;
+INTN mSelectedCtrIndex;
EFI_STRING_ID mControllerToken[MAX_CHOICE_NUM];
UINTN mDriverImageHandleCount;
EFI_STRING_ID mDriverImageToken[MAX_CHOICE_NUM];
@@ -630,7 +630,8 @@ 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;
//
// Clear all the content in dynamic page
@@ -927,6 +928,7 @@ UpdatePrioritySelectPage ( // Check the driver DriverImage's order number in mapping database
//
DriverImageNO = 0;
+ ASSERT (mSelectedCtrIndex < MAX_CHOICE_NUM);
CheckMapping (
mControllerDevicePathProtocol[mSelectedCtrIndex],
LoadedImageDevicePath,
@@ -1027,6 +1029,7 @@ CommintChanges ( // Following code will be run if user select 'commint changes' in third page
// user enter 'Commit Changes' to save the mapping database
//
+ ASSERT (mSelectedCtrIndex < MAX_CHOICE_NUM);
DeleteDriverImage (mControllerDevicePathProtocol[mSelectedCtrIndex], NULL, &mMappingDataBase);
for (SelectedDriverImageNum = 0; SelectedDriverImageNum < mSelectedDriverImageNum; SelectedDriverImageNum++) {
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index e9fd15e..a136757 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -188,8 +188,8 @@ DisplayPageFrame ( CHAR16 *StrFrontPageBanner;
UINTN Row;
EFI_SCREEN_DESCRIPTOR LocalScreen;
- UINTN RowIdx;
- UINTN ColumnIdx;
+ UINT8 RowIdx;
+ UINT8 ColumnIdx;
ZeroMem (&LocalScreen, sizeof (EFI_SCREEN_DESCRIPTOR));
gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &LocalScreen.RightColumn, &LocalScreen.BottomRow);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index c1a79ab..83feb0f 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -2166,7 +2166,8 @@ GetIfrBinaryData ( if (EFI_ERROR (Status)) {
return Status;
}
-
+ ASSERT (HiiPackageList != NULL);
+
//
// Get Form package from this HII package List
//
|