]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
MdeModulePkg/EbcDebugger: Add check for invalid 'CommandArg'
[mirror_edk2.git] / MdeModulePkg / Universal / DisplayEngineDxe / ProcessOptions.c
index f55fb2e26361270f215786596bb2d2bcf5d141e6..557e8ecd9466af49ec051db2e34fb5dd16fb41f2 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for handling the User Interface option processing.\r
 \r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   Concatenate a narrow string to another string.\r
 \r
   @param Destination The destination string.\r
+  @param DestMax     The Max length of destination string.\r
   @param Source      The source string. The string to be concatenated.\r
                      to the end of Destination.\r
 \r
@@ -567,7 +568,6 @@ PrintFormattedNumber (
 \r
   default:\r
     return EFI_UNSUPPORTED;\r
-    break;\r
   }\r
 \r
   UnicodeSPrint (FormattedNumber, BufferSize, Format, Value);\r
@@ -814,6 +814,11 @@ PasswordProcess (
     //\r
     // Password can't be set now. \r
     //\r
+    if (Status == EFI_UNSUPPORTED) {\r
+      do {\r
+        CreateDialog (&Key, gEmptyString, gPasswordUnsupported, gPressEnter, gEmptyString, NULL);\r
+      } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);\r
+    }\r
     FreePool (StringPtr);\r
     return EFI_SUCCESS;\r
   }\r
@@ -885,18 +890,8 @@ PasswordProcess (
     gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;\r
     gUserInput->InputValue.Type = Question->CurrentValue.Type;\r
     gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, gUserInput->InputValue.Value.string, StringPtr, NULL);\r
-    FreePool (StringPtr); \r
 \r
     Status = EFI_SUCCESS;\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Reset state machine for password\r
-      //\r
-      Question->PasswordCheck (gFormData, Question, NULL);\r
-    }\r
-\r
-    return Status;\r
   } else {\r
     //\r
     // Reset state machine for password\r
@@ -912,7 +907,8 @@ PasswordProcess (
 \r
     Status = EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+  ZeroMem (TempString, (Maximum + 1) * sizeof (CHAR16));\r
+  ZeroMem (StringPtr, (Maximum + 1) * sizeof (CHAR16));\r
   FreePool (TempString);\r
   FreePool (StringPtr);\r
 \r