From: Eric Dong Date: Wed, 25 Jun 2014 05:17:32 +0000 (+0000) Subject: Refine code to make it more safely. X-Git-Tag: edk2-stable201903~7400^2~11 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=944ac8ab53ada1da0ad6068e33fdd9b8469b89e7;p=mirror_edk2.git Refine code to make it more safely. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Ruiyu Ni (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 Acked-by: Mark Doran Acked-by: Laszlo Ersek --- diff --git a/FatPkg/EnhancedFatDxe/Open.c b/FatPkg/EnhancedFatDxe/Open.c index 0519e54981..1d864d1248 100644 --- a/FatPkg/EnhancedFatDxe/Open.c +++ b/FatPkg/EnhancedFatDxe/Open.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -124,6 +124,7 @@ Returns: UINT8 FileAttributes; BOOLEAN WriteMode; + DirEnt = NULL; Volume = OFile->Volume; ASSERT_VOLUME_LOCKED (Volume); WriteMode = (BOOLEAN) (OpenMode & EFI_FILE_MODE_WRITE); @@ -159,6 +160,7 @@ Returns: return Status; } + ASSERT (DirEnt != NULL); Status = FatOpenDirEnt (OFile, DirEnt); if (EFI_ERROR (Status)) { return Status;