diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-13 02:37:35 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-13 02:37:35 +0000 |
commit | 0c1950ba5e6c0a982a763ccd5d325ddbf236ad28 (patch) | |
tree | e4973a816b092f38e1936951464f7a286e305c75 /ShellPkg/Library | |
parent | 90f6df07f8a800352bb5402166b050eee804789e (diff) | |
download | edk2-platforms-0c1950ba5e6c0a982a763ccd5d325ddbf236ad28.tar.xz |
Check the pointer before use it to avoid potential access violation.
Signed-off-by: ydong10
Reviewed-by: jcarsey
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12533 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 474aecb7ae..42ae6e9bb0 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -2236,14 +2236,9 @@ ShellCommandLineGetFlag ( CHAR16 *TempString;
//
- // ASSERT that both CheckPackage and KeyString aren't NULL
+ // return FALSE for no package or KeyString is NULL
//
- ASSERT(KeyString != NULL);
-
- //
- // return FALSE for no package
- //
- if (CheckPackage == NULL) {
+ if (CheckPackage == NULL || KeyString == NULL) {
return (FALSE);
}
@@ -2305,9 +2300,9 @@ ShellCommandLineGetValue ( CHAR16 *TempString;
//
- // check for CheckPackage == NULL
+ // return NULL for no package or KeyString is NULL
//
- if (CheckPackage == NULL) {
+ if (CheckPackage == NULL || KeyString == NULL) {
return (NULL);
}
|