]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/PciRootBridgeNoEnumerationDxe/DeviceIo.c
Fix a security hole in shell binaries:
[mirror_edk2.git] / DuetPkg / PciRootBridgeNoEnumerationDxe / DeviceIo.c
index 286c03ef4c11b54df8d77a3066c8e2251966b947..67a46b9759b2a366a4cb36fec5b22535234d5b0f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -137,11 +137,11 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
   if (Width >= MMIO_COPY_UINT8) {\r
-    Width = Width - MMIO_COPY_UINT8;\r
+    Width = (EFI_IO_WIDTH) (Width - MMIO_COPY_UINT8);\r
     Status = Private->PciRootBridgeIo->CopyMem (\r
                                          Private->PciRootBridgeIo,\r
                                          (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,\r
-                                         (UINT64) Buffer,\r
+                                         (UINT64)(UINTN) Buffer,\r
                                          Address,\r
                                          Count\r
                                          );\r
@@ -201,12 +201,12 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
   if (Width >= MMIO_COPY_UINT8) {\r
-    Width = Width - MMIO_COPY_UINT8;\r
+    Width = (EFI_IO_WIDTH) (Width - MMIO_COPY_UINT8);\r
     Status = Private->PciRootBridgeIo->CopyMem (\r
                                          Private->PciRootBridgeIo,\r
                                          (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,\r
                                          Address,\r
-                                         (UINT64) Buffer,\r
+                                         (UINT64)(UINTN) Buffer,\r
                                          Count\r
                                          );\r
   } else {\r