diff options
-rw-r--r-- | ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c | 4 | ||||
-rw-r--r-- | ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c index b4e88e7635..37afefd80b 100644 --- a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c +++ b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c @@ -1815,6 +1815,10 @@ DownloadFile ( Context->Uri,
StrLen (Context->Uri)
);
+ if (DownloadUrl == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto ON_EXIT;
+ }
PRINT_HII (STRING_TOKEN (STR_HTTP_DOWNLOADING), DownloadUrl);
diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c index 7e5c73b3da..a60d6be2d6 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c @@ -395,7 +395,11 @@ RunTftp ( }
RemoteFilePath = ShellCommandLineGetRawValue (CheckPackage, 2);
- ASSERT (RemoteFilePath != NULL);
+ if (RemoteFilePath == NULL) {
+ ASSERT (RemoteFilePath != NULL);
+ goto Error;
+ }
+
FilePathSize = StrLen (RemoteFilePath) + 1;
AsciiRemoteFilePath = AllocatePool (FilePathSize);
if (AsciiRemoteFilePath == NULL) {
|