]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
MdeModulePkg/PrintLib: Add missing return status check for Print APIs
authorHao Wu <hao.a.wu@intel.com>
Fri, 23 Dec 2016 05:04:38 +0000 (13:04 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 3 Jan 2017 08:32:52 +0000 (16:32 +0800)
commit7c6075e2546dd818b7b87090a983429b1942796a
tree007895dfe3b0a0c6f16f333a9e275060d96f4946
parent8ad05bd26b4850b5ed89867039fa989d4f256348
MdeModulePkg/PrintLib: Add missing return status check for Print APIs

https://bugzilla.tianocore.org/show_bug.cgi?id=307

For the following APIs in PrintLib instance
MdeModulePkg\Library\DxePrintLibPrint2Protocol:
UnicodeVSPrint
UnicodeSPrint
UnicodeVSPrintAsciiFormat
UnicodeSPrintAsciiFormat
AsciiVSPrint
AsciiSPrint
AsciiVSPrintUnicodeFormat
AsciiSPrintUnicodeFormat

The internal function DxePrintLibPrint2ProtocolVaListToBaseList() will be
called to convert a VA_LIST to a BASE_LIST. However, those APIs miss
checking the return value of the internal function.

This commit adds codes to check the return value. If the VA_LIST fails to
be converted to a BASE_LIST, those PrintLib APIs will return 0 and leave
the output 'StartOfBuffer' unmodified.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c