Correct the code to use SIZE_OF_EFI_FILE_INFO instead of sizeof (EFI_FILE_INFO) to fix a bug when creating a file/directory with single char as file name in root directory.

Signed-off-by: niruiyu
Reviewed-by: jcarsey

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12728 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niruiyu 2011-11-17 01:59:30 +00:00
parent e45e09c75b
commit 82b760433d
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/**@file
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2011, 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
@ -2404,7 +2404,7 @@ Returns:
//
NewFileInfo = (EFI_FILE_INFO *) Buffer;
if (NewFileInfo->Size <= sizeof (EFI_FILE_INFO) ||
if ((NewFileInfo->Size <= SIZE_OF_EFI_FILE_INFO) ||
(NewFileInfo->Attribute &~(EFI_FILE_VALID_ATTR)) ||
(sizeof (UINTN) == 4 && NewFileInfo->Size > 0xFFFFFFFF)
) {