diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2014-09-23 06:20:59 +0000 |
---|---|---|
committer | shenshushi <shenshushi@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-09-23 06:20:59 +0000 |
commit | 427d61ad4ad1462b5f4370a78eb58c1ba73680b4 (patch) | |
tree | ece24651e1c08bb3c45a09765f2dddae7612d5b6 /ShellPkg | |
parent | b4dfada85dad3ff3022f83d0ac1cd6b0c185cdd5 (diff) | |
download | edk2-platforms-427d61ad4ad1462b5f4370a78eb58c1ba73680b4.tar.xz |
ShellPkg: Refine code style to avoid potential NullPointer dereference.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16161 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 4 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index 63808424b0..a576f83446 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -326,7 +326,9 @@ ValidateAndCopyFiles( } else {
return SHELL_INVALID_PARAMETER;
}
- }
+ }
+
+ ASSERT (CleanFilePathStr != NULL);
//
// If we are trying to copy multiple files... make sure we got a directory for the target...
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c index 772cbd27f1..666cedb49d 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c @@ -289,6 +289,8 @@ ValidateAndMoveFiles( }
}
+ ASSERT (CleanFilePathStr != NULL);
+
//
// Get and validate the destination location
//
|