mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
ShellPkg: Fix check on OldArgv in UpdateArgcArgv()
The UpdateArgcArgv() function documentation says "If OldArgv or OldArgc is NULL then that value is not returned." However, only OldArgc was checked for NULL, probably because of copy-pasto. In case OldArgc was non-NULL, but OldArgv was null, it could cause a segmentation fault. Check OldArgv is not NULL before dereferencing the value. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
parent
6142f0a8a5
commit
800205678f
@ -1470,7 +1470,7 @@ UpdateArgcArgv (
|
||||
*OldArgc = ShellParameters->Argc;
|
||||
}
|
||||
|
||||
if (OldArgc != NULL) {
|
||||
if (OldArgv != NULL) {
|
||||
*OldArgv = ShellParameters->Argv;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user