]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UdfDxe: Check 'Component Type' within a Path Component
authorHao Wu <hao.a.wu@intel.com>
Tue, 30 Oct 2018 01:06:48 +0000 (09:06 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 31 Oct 2018 00:57:04 +0000 (08:57 +0800)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1279

According to the ECMA-167 standard (3rd Edition - June 1997), Section
14.16.1.1, valid values are 1 to 5. All other values will be treated as a
corrupted volume.

This commit will add such check within function ResolveSymlink().

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c

index b9ebddfe6293ad8a353297168acf390f2aa3657f..fed3da1fa18a93adc57813189cc63b137bb00202 100644 (file)
@@ -2257,6 +2257,13 @@ ResolveSymlink (
       }\r
       FileName[Index] = L'\0';\r
       break;\r
+    default:\r
+      //\r
+      // According to the ECMA-167 standard (3rd Edition - June 1997), Section\r
+      // 14.16.1.1, all other values are reserved.\r
+      //\r
+      Status = EFI_VOLUME_CORRUPTED;\r
+      goto Error_Find_File;\r
     }\r
 \r
     //\r