From db0bd81c851ff0aa92f2778f7810488714c059c2 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Fri, 13 Feb 2009 03:36:02 +0000 Subject: enhanced security check. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7516 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'MdeModulePkg/Bus') 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); -- cgit v1.1