/** @file\r
The realization of EFI_RAM_DISK_PROTOCOL.\r
\r
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
//\r
// Add check to prevent data read across the memory boundary\r
//\r
- if (RamDiskBase + RamDiskSize > ((UINTN) -1) - RAM_DISK_BLOCK_SIZE + 1) {\r
+ if ((RamDiskSize > MAX_UINTN) ||\r
+ (RamDiskBase > MAX_UINTN - RamDiskSize + 1)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r