diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-10 02:17:31 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-10 02:17:31 +0000 |
commit | e35eb8af7b27e0c035f668787d366d05c608ac81 (patch) | |
tree | 8502044fef260195a9f2cc479860c39aeae57911 /MdeModulePkg/Universal/DriverSampleDxe | |
parent | 61f0f4375b35dd9b3ab6f1e1803385b57a22c7fb (diff) | |
download | edk2-platforms-e35eb8af7b27e0c035f668787d366d05c608ac81.tar.xz |
1. Use the max string size to compare password string.
2. Check whether the local variable is valid as the array index.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10473 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe')
-rw-r--r-- | MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index 14ac72fe1d..ff9e4b2179 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -187,7 +187,7 @@ ValidatePassword ( ASSERT (EncodedPassword != NULL);
StrnCpy (EncodedPassword, Password, StrLen (Password));
EncodePassword (EncodedPassword, StrLen (EncodedPassword) * sizeof (CHAR16));
- if (CompareMem (EncodedPassword, PrivateData->Configuration.WhatIsThePassword2, StrLen (EncodedPassword) * sizeof (CHAR16)) != 0) {
+ if (CompareMem (EncodedPassword, PrivateData->Configuration.WhatIsThePassword2, PasswordMaxSize) != 0) {
//
// Old password mismatch, return EFI_NOT_READY to prompt for error message
//
@@ -355,7 +355,7 @@ LoadNameValueNames ( @retval EFI_SUCCESS The Results is filled with the requested values.
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
- @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
+ @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this
driver.
|