diff options
author | Jiaxin Wu <Jiaxin.wu@intel.com> | 2018-09-27 18:43:23 +0800 |
---|---|---|
committer | Jiaxin Wu <Jiaxin.wu@intel.com> | 2018-09-28 10:46:28 +0800 |
commit | 61d3f1000eaad4f359f1a949c2de2217241344d9 (patch) | |
tree | 5cbdd57bb9f4a365aa1aa994e16408b4e925bc24 /ShellPkg | |
parent | cf320090fa52317250a75120b87f6c7f5c0ae6b4 (diff) | |
download | edk2-61d3f1000eaad4f359f1a949c2de2217241344d9.tar.gz edk2-61d3f1000eaad4f359f1a949c2de2217241344d9.tar.bz2 edk2-61d3f1000eaad4f359f1a949c2de2217241344d9.zip |
ShellPkg/TftpDynamicCommand: Fix the potentially uninitialized local variable used.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1217
Local variable 'Mtftp4Token' might be uninitialized when error happen. This patch is to
resolve the issue.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c index c66be6b9d9..d4391b9f33 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c @@ -936,6 +936,8 @@ DownloadFile ( UINT8 BlksizeBuf[10];
UINT8 WindowsizeBuf[10];
+ ZeroMem (&Mtftp4Token, sizeof (EFI_MTFTP4_TOKEN));
+
// Downloaded file can be large. BS.AllocatePages() is more faster
// than AllocatePool() and avoid fragmentation.
// The downloaded file could be an EFI application. Marking the
@@ -961,7 +963,6 @@ DownloadFile ( TftpContext->DownloadedNbOfBytes = 0;
TftpContext->LastReportedNbOfBytes = 0;
- ZeroMem (&Mtftp4Token, sizeof (EFI_MTFTP4_TOKEN));
Mtftp4Token.Filename = (UINT8*)AsciiFilePath;
Mtftp4Token.BufferSize = FileSize;
Mtftp4Token.Buffer = Buffer;
|