History log of /device/linaro/bootloader/edk2/MdePkg/Library/BaseLib/SafeString.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2ad9cf37a492e69a4e1b7624d92d9a35fce083fc 13-Jul-2015 Leif Lindholm <leif.lindholm@linaro.org> MdePkg: ensure SafeString length functions don't access beyond MaxSize

The StrnLenS and AsciiStrnLenS functions, when presented with a string
with no terminating NULL in the first MaxSize characters will check
the character at String[MaxSize] before checking if Length < MaxSize.
(They return the correct value, but have accessed beyond the stated
limit in the process.)

Flip the order of the tests to prevent this behaviour.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17936 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdePkg/Library/BaseLib/SafeString.c
0e93edbbc09be02585c21cb022b4f34add67c79e 06-May-2015 Yao, Jiewen <Jiewen.Yao@intel.com> Add ASSERT comment for SafeString API in BaseLib for MdePkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Carsey, Jaben" <jaben.carsey@intel.com>
Reviewed-by: "Justen, Jordan L" <jordan.l.justen@intel.com>
Reviewed-by: "Gao, Liming" <Liming.Gao@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17310 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdePkg/Library/BaseLib/SafeString.c
c058d59f40b4a95c218cd171ff976bee1ff487e2 07-Nov-2014 jyao1 <jyao1@Edk2> Add safe string function to base lib.

Contributed-under: TianoCore Contribution Agreement 1.0

signed off by: Yao, Jiewen <jiewen.yao@intel.com>
reviewed by: Ni, Ruiyu <ruiyu.ni@intel.com>
reviewed by: Long, Qin <qin.long@intel.com>
reviewed by: Kinney, Michael D <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16312 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdePkg/Library/BaseLib/SafeString.c