diff options
author | Jeff Fan <jeff.fan@intel.com> | 2014-08-08 05:52:01 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-08-08 05:52:01 +0000 |
commit | 1a45b15eae48d9bf498daf5b0c0771659d75faa2 (patch) | |
tree | 0e45806a5952e5993d8499ea68c92672fd91715e /IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint | |
parent | 31fc7b4d6a86e13687d57bd330a1e3e125ba1b94 (diff) | |
download | edk2-platforms-1a45b15eae48d9bf498daf5b0c0771659d75faa2.tar.xz |
Add type cast on variable before operation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Eric Dong <Eric.Dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15778 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c | 4 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c index 22c2eb3c7e..0d3b489e35 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c @@ -1761,12 +1761,12 @@ GetLegacyDeviceOrder ( break;
}
- WorkingVarData += sizeof (BBS_TYPE);
+ WorkingVarData = (UINT8 *)((UINTN)WorkingVarData + sizeof (BBS_TYPE));
WorkingVarData += *(UINT16 *) WorkingVarData;
DevOrder = (LEGACY_DEV_ORDER_ENTRY *) WorkingVarData;
}
for (OptionIndex = 0; OptionIndex < OptionMenu->MenuNumber; OptionIndex++) {
- VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + OptionIndex * sizeof (UINT16));
+ VarDevOrder = *(UINT16 *) ((UINTN) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + OptionIndex * sizeof (UINT16));
if (0xFF00 == (VarDevOrder & 0xFF00)) {
LegacyOrder[OptionIndex] = 0xFF;
Pos = (VarDevOrder & 0xFF) / 8;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c index a3b9dd8928..20e17dd858 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c @@ -1303,7 +1303,7 @@ UpdateSetLegacyDeviceOrderPage ( break;
}
- VarData += sizeof (BBS_TYPE);
+ VarData = (UINT8 *)((UINTN)VarData + sizeof (BBS_TYPE));
VarData += *(UINT16 *) VarData;
DevOrder = (LEGACY_DEV_ORDER_ENTRY *) VarData;
}
@@ -1333,7 +1333,7 @@ UpdateSetLegacyDeviceOrderPage ( NULL
);
- VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
+ VarDevOrder = *(UINT16 *) ((UINTN) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
if (0xFF00 == (VarDevOrder & 0xFF00)) {
LegacyOrder[Index] = 0xFF;
|