REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1115
When the type of HiiValue is EFI_IFR_TYPE_BUFFER,
its question type is EFI_IFR_ORDERED_LIST_OP.
And the buffer size allocated for Statement->BufferValue
of orderedList is "Statement->StorageWidth"
in IfrParse.c.
So here when backup the buffer value and copy the size of
"Statement->StorageWidth + sizeof(CHAR16)" is incorrect.
This patch is to fix this issue.
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
//\r
if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
//\r
if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
- BackUpBuffer = AllocateCopyPool(Statement->StorageWidth + sizeof(CHAR16), Statement->BufferValue);\r
+ BackUpBuffer = AllocateCopyPool(Statement->StorageWidth, Statement->BufferValue);\r
ASSERT (BackUpBuffer != NULL);\r
} else {\r
CopyMem (&BackUpValue, &HiiValue->Value, sizeof (EFI_IFR_TYPE_VALUE));\r
ASSERT (BackUpBuffer != NULL);\r
} else {\r
CopyMem (&BackUpValue, &HiiValue->Value, sizeof (EFI_IFR_TYPE_VALUE));\r
//\r
if (Action == EFI_BROWSER_ACTION_CHANGING && Status == EFI_UNSUPPORTED) {\r
if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
//\r
if (Action == EFI_BROWSER_ACTION_CHANGING && Status == EFI_UNSUPPORTED) {\r
if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
- CopyMem (Statement->BufferValue, BackUpBuffer, Statement->StorageWidth + sizeof(CHAR16));\r
+ CopyMem (Statement->BufferValue, BackUpBuffer, Statement->StorageWidth);\r
} else {\r
CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));\r
}\r
} else {\r
CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));\r
}\r