]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
ShellPkg/TftpDynamicCommand: Fix the potentially uninitialized local variable used.
[mirror_edk2.git] / ShellPkg / DynamicCommand / TftpDynamicCommand / Tftp.c
index c66be6b9d97e5eb001373be22f08d813f5e6b7d5..d4391b9f33cd27adff0925ffec755aaf2da34740 100644 (file)
@@ -936,6 +936,8 @@ DownloadFile (
   UINT8                 BlksizeBuf[10];\r
   UINT8                 WindowsizeBuf[10];\r
 \r
+  ZeroMem (&Mtftp4Token, sizeof (EFI_MTFTP4_TOKEN));\r
+\r
   // Downloaded file can be large. BS.AllocatePages() is more faster\r
   // than AllocatePool() and avoid fragmentation.\r
   // The downloaded file could be an EFI application. Marking the\r
@@ -961,7 +963,6 @@ DownloadFile (
   TftpContext->DownloadedNbOfBytes   = 0;\r
   TftpContext->LastReportedNbOfBytes = 0;\r
 \r
-  ZeroMem (&Mtftp4Token, sizeof (EFI_MTFTP4_TOKEN));\r
   Mtftp4Token.Filename    = (UINT8*)AsciiFilePath;\r
   Mtftp4Token.BufferSize  = FileSize;\r
   Mtftp4Token.Buffer      = Buffer;\r