diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-06 01:34:57 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-06 01:34:57 +0000 |
commit | 51fa0bffc9a9520f7861841185386491dbb033a0 (patch) | |
tree | 58097cb3e6bbd8df4036f97987e70a63e60ca3f8 | |
parent | 30ce59e9bcfe17fab3e01414dece6659d8c46df4 (diff) | |
download | edk2-51fa0bffc9a9520f7861841185386491dbb033a0.zip edk2-51fa0bffc9a9520f7861841185386491dbb033a0.tar.gz edk2-51fa0bffc9a9520f7861841185386491dbb033a0.tar.bz2 |
Fix two issues:
1. EDK II StrnCpy does not necessarily "0" terminate destination string if the source string length is larger than "n". Caller needs to terminate it itself.
2. The definition of EFI_HII_CALLBACK_PACKET has been changed to follow framework HII spec 0.92, we need to change the corresponding code correctly.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/24Oct07_r4206@4269 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | IntelFrameworkModulePkg/Universal/SetupBrowserDxe/InputHandler.c | 14 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Universal/SetupBrowserDxe/Presentation.c | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/InputHandler.c index bd0c853..3c0a078 100644 --- a/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/InputHandler.c +++ b/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/InputHandler.c @@ -290,7 +290,7 @@ ReadPassword ( SecondEntry = TRUE;
} else if (Status == EFI_NOT_READY) {
Error:
- if (Packet != NULL) {
+ if (Packet != NULL && Packet->String != NULL) {
//
// Upon error, we will likely receive a string to print out
// Display error popup
@@ -403,7 +403,7 @@ Error: //
if (Confirmation) {
if (EFI_ERROR (Status)) {
- if (Packet->String == NULL) {
+ if (Packet == NULL || Packet->String == NULL) {
WidthOfString = GetStringWidth (gConfirmError);
ScreenSize = MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, gConfirmError, gPressEnter, &NullCharacter);
@@ -513,12 +513,14 @@ Error: //
default:
if ((StringPtr[0] == CHAR_NULL) && (Key.UnicodeChar != CHAR_BACKSPACE)) {
+ StringPtr[0] = Key.UnicodeChar;
+ StringPtr[1] = CHAR_NULL;
if (!Confirmation) {
- StrnCpy (StringPtr, &Key.UnicodeChar, 1);
- StrnCpy (TempString, &Key.UnicodeChar, 1);
+ TempString[0] = Key.UnicodeChar;
+ TempString[1] = CHAR_NULL;
} else {
- StrnCpy (StringPtr, &Key.UnicodeChar, 1);
- StrnCpy (TempString2, &Key.UnicodeChar, 1);
+ TempString2[0] = Key.UnicodeChar;
+ TempString2[1] = CHAR_NULL;
ConfirmationComplete = FALSE;
}
} else if ((GetStringWidth (StringPtr) / 2 <= (UINTN) (MenuOption->ThisTag->Maximum - 1) / 2) &&
diff --git a/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/Presentation.c b/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/Presentation.c index 3452a8d..074b009 100644 --- a/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1236,7 +1236,7 @@ Returns: Selection->ThisTag->StorageWidth
);
- if (Packet != NULL) {
+ if (Packet != NULL && Packet->String != NULL) {
//
// Upon error, we will likely receive a string to print out
//
|