]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
MdeModulePkg/ScsiDiskDxe: Fix undefined behavior in signed left shift
[mirror_edk2.git] / MdeModulePkg / Bus / Scsi / ScsiDiskDxe / ScsiDisk.c
index b5eff25b9b900e8111b7e64f5fd599d59b84da5f..2289f20152d309505c788dd77f781d9bdf88b7d2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SCSI disk driver that layers on every SCSI IO protocol in the system.\r
 \r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -2754,7 +2754,7 @@ GetMediaInfo (
   UINT8       *Ptr;\r
 \r
   if (!ScsiDiskDevice->Cdb16Byte) {\r
-    ScsiDiskDevice->BlkIo.Media->LastBlock =  (Capacity10->LastLba3 << 24) |\r
+    ScsiDiskDevice->BlkIo.Media->LastBlock =  ((UINT32) Capacity10->LastLba3 << 24) |\r
                                               (Capacity10->LastLba2 << 16) |\r
                                               (Capacity10->LastLba1 << 8)  |\r
                                                Capacity10->LastLba0;\r