]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Refine code to make it more safely.
authorEric Dong <eric.dong@intel.com>
Wed, 25 Jun 2014 05:17:32 +0000 (05:17 +0000)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 7 Apr 2016 06:22:43 +0000 (23:22 -0700)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
(based on FatPkg commit 059c24212d10c63351e377636b73a22e480a024b)

[jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Mark Doran <mark.doran@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
FatPkg/EnhancedFatDxe/Open.c

index 0519e54981696a752b0b74f2f2071e27d9188259..1d864d1248c8d30d85560515e337af0a99933c9c 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
 distribution. The full text of the license may be found at\r
@@ -124,6 +124,7 @@ Returns:
   UINT8       FileAttributes;\r
   BOOLEAN     WriteMode;\r
 \r
+  DirEnt = NULL;\r
   Volume = OFile->Volume;\r
   ASSERT_VOLUME_LOCKED (Volume);\r
   WriteMode = (BOOLEAN) (OpenMode & EFI_FILE_MODE_WRITE);\r
@@ -159,6 +160,7 @@ Returns:
       return Status;\r
     }\r
 \r
+    ASSERT (DirEnt != NULL);\r
     Status = FatOpenDirEnt (OFile, DirEnt);\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r