audk/MdePkg
Hao Wu 9fdf31789a MdePkg/BaseLib: Avoid reading content beyond string boundary
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=705

As mentioned in the above Bugzilla link by Steven, within the function
PathCleanUpDirectories(), when executing command:
"cd ."

under Shell, the input parameter 'Path' string will have string length
less than 2. Hence, it is possible for the below statement:
"if (StrCmp (Path + StrLen (Path) - 2, L"\\.") == 0) {"

to read contents before the string boundary.

This commit adds additional checks to avoid this.

Cc: Steven Shi <steven.shi@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-09-21 14:06:28 +08:00
..
Include MdePkg/include: Add Acpi.h to DMAR table. 2017-09-20 14:45:41 +08:00
Library MdePkg/BaseLib: Avoid reading content beyond string boundary 2017-09-21 14:06:28 +08:00
MdePkg.dec MdePkg: Add new definitions for Management Mode. 2017-08-29 09:37:36 +08:00
MdePkg.dsc MdePkg/S3PciSegmentLib: Add S3PciSegmentLib class and instance. 2017-08-28 16:47:05 +08:00
MdePkg.uni MdePkg/MdePkg.uni: Add description for PcdUartDefaultReceiveFifoDepth 2016-04-05 14:09:32 +08:00
MdePkgExtra.uni MdePkg: Convert all .uni files to utf-8 2015-12-15 04:53:50 +00:00