audk/MdeModulePkg/Library/DxePrintLibPrint2Protocol
Hao Wu 213da0b540 MdeModulePkg/PrintLib: Avoid reading content beyond the format string
https://bugzilla.tianocore.org/show_bug.cgi?id=567

In functions DxePrintLibPrint2ProtocolVaListToBaseList() and
InternalPrintLibSPrintMarker(), when processing ASCII format strings, if
the format string walker pointer 'Format' is pointing at the end of the
format string (i.e. '\0'), the following expression:
*(Format + 1)
will read an undefined value.

Though this value won't affect the functionality, since it will be masked
by variable 'FormatMask':
(*(Format + 1) << 8)) & FormatMask
(FormatMask is 0xff for ASCII format string)

This commit adds additional logic to avoid reading undefined content.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-06-01 08:46:40 +08:00
..
DxePrintLibPrint2Protocol.inf MdeModulePkg/PrintLib: Use EFI_PRINT2S_PROTOCOL for this instance 2017-02-21 13:56:31 +08:00
DxePrintLibPrint2Protocol.uni MdeModulePkg/PrintLib: Use EFI_PRINT2S_PROTOCOL for this instance 2017-02-21 13:56:31 +08:00
PrintLib.c MdeModulePkg/PrintLib: Avoid reading content beyond the format string 2017-06-01 08:46:40 +08:00