summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/UefiHiiLib
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-17 01:46:37 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-17 01:46:37 +0000
commitb8215f465c5a05789ee3b53aefa7b5314e04c9d2 (patch)
tree53672d8f9908ef713dfae592d19dc2a92553c932 /MdeModulePkg/Library/UefiHiiLib
parentad5a96ab2daeeac53f0c924113f23dc931f965c5 (diff)
downloadedk2-b8215f465c5a05789ee3b53aefa7b5314e04c9d2.zip
edk2-b8215f465c5a05789ee3b53aefa7b5314e04c9d2.tar.gz
edk2-b8215f465c5a05789ee3b53aefa7b5314e04c9d2.tar.bz2
Fix Insert opcode error.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8105 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib')
-rw-r--r--MdeModulePkg/Library/UefiHiiLib/HiiLib.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index e337b23..e1d8a64 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -1158,10 +1158,10 @@ HiiIsConfigHdrMatch (
buffer. The returned buffer is allocated using AllocatePool(). The caller
is responsible for freeing the returned buffer using FreePool().
- @param[in] VariableName Pointer to a Null-terminated Unicode string. This
- is an optional parameter that may be NULL.
@param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional
parameter that may be NULL.
+ @param[in] VariableName Pointer to a Null-terminated Unicode string. This
+ is an optional parameter that may be NULL.
@param[in] BufferSize Length in bytes of buffer to hold retrived data.
@retval NULL The uncommitted data could not be retrieved.
@@ -2267,17 +2267,19 @@ InternalHiiUpdateFormPackageData (
// Insert the updated data
//
UpdateIfrOpHdr = (EFI_IFR_OP_HEADER *) OpCodeBufferStart->Buffer;
- AddOpCode = (EFI_IFR_OP_HEADER *) (OpCodeBufferStart->Buffer + UpdateIfrOpHdr->Length);
AddSize = UpdateIfrOpHdr->Length;
+ AddOpCode = (EFI_IFR_OP_HEADER *) (OpCodeBufferStart->Buffer + AddSize);
while (AddSize < OpCodeBufferStart->Position) {
CopyMem (BufferPos, AddOpCode, AddOpCode->Length);
BufferPos += AddOpCode->Length;
UpdatePackageLength += AddOpCode->Length;
-
- AddOpCode = (EFI_IFR_OP_HEADER *) ((UINT8 *) (AddOpCode) + AddOpCode->Length);
- AddSize += AddOpCode->Length;
+
+ AddSize += AddOpCode->Length;
+ AddOpCode = (EFI_IFR_OP_HEADER *) (OpCodeBufferStart->Buffer + AddSize);
}
+ ASSERT (AddSize == OpCodeBufferStart->Position);
+
if (OpCodeBufferEnd != NULL) {
//
// Add the end opcode