diff options
author | Eric Dong <eric.dong@intel.com> | 2014-06-25 05:17:32 +0000 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2016-04-06 23:22:43 -0700 |
commit | 944ac8ab53ada1da0ad6068e33fdd9b8469b89e7 (patch) | |
tree | 73d8ad7714b1cadd3ba107c0f5e301379d796782 /FatPkg/EnhancedFatDxe | |
parent | 71debf97fed60c5464010ad9b8fd7ca1a2f015f5 (diff) | |
download | edk2-944ac8ab53ada1da0ad6068e33fdd9b8469b89e7.zip edk2-944ac8ab53ada1da0ad6068e33fdd9b8469b89e7.tar.gz edk2-944ac8ab53ada1da0ad6068e33fdd9b8469b89e7.tar.bz2 |
Refine code to make it more safely.
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>
Diffstat (limited to 'FatPkg/EnhancedFatDxe')
-rw-r--r-- | FatPkg/EnhancedFatDxe/Open.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/FatPkg/EnhancedFatDxe/Open.c b/FatPkg/EnhancedFatDxe/Open.c index 0519e54..1d864d1 100644 --- a/FatPkg/EnhancedFatDxe/Open.c +++ b/FatPkg/EnhancedFatDxe/Open.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
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;
|