ShellPkg: Add checking for memory allocation and pointer returns from functions.

signed-off-by: jcarsey
reviewed-by: geekboy15a

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12540 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-10-14 19:21:13 +00:00
parent de2a15eebb
commit 532691c8ba
15 changed files with 253 additions and 168 deletions

View File

@ -79,11 +79,16 @@ DoTouchByHandle (
if (FS == NULL) {
FS = StrnCatGrow(&FS, NULL, Name, 0);
TempSpot = StrStr(FS, L"\\");
if (TempSpot != NULL) {
*TempSpot = CHAR_NULL;
if (FS != NULL) {
TempSpot = StrStr(FS, L"\\");
if (TempSpot != NULL) {
*TempSpot = CHAR_NULL;
}
}
}
if (FS == NULL) {
return (EFI_INVALID_PARAMETER);
}
//
// do it