ShellPkg/for: Fix potential null pointer deference
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 5 Feb 2018 07:53:20 +0000 (15:53 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 6 Feb 2018 09:30:24 +0000 (17:30 +0800)
commit7162fdb037fb9385f6bd7d0dc55d54029b810de2
tree4188a7f228483caf91b2a8cbd039936bcd7ab3f8
parente0db09cd1cd35a1e2ae627e305d903652555aef2
ShellPkg/for: Fix potential null pointer deference

When "FOR %a %a IN A B C" is executed,
CurrentScriptFile->CurrentCommand->Data is NULL.
But the code assumes it's not NULL and tries to
deference it.

The patch fixes this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiShellLevel1CommandsLib/For.c