SecurityPkg OpalPasswordDxe:Fix wrong BufferSize input to UnicodeSPrint
authorStar Zeng <star.zeng@intel.com>
Thu, 15 Mar 2018 05:50:31 +0000 (13:50 +0800)
committerStar Zeng <star.zeng@intel.com>
Sat, 17 Mar 2018 07:49:01 +0000 (15:49 +0800)
commitaa0857304e83801ce8c673504625aa3307abb82f
tree11755c3009cc880f46d0e68bade040cb5c300a08
parente3df050e5127e9857f90f9322c7f2d0458518955
SecurityPkg OpalPasswordDxe:Fix wrong BufferSize input to UnicodeSPrint

Current code uses string length as BufferSize input to UnicodeSPrint,
it is wrong and makes the pop up string trimmed. The BufferSize input
to UnicodeSPrint should be the size, in bytes, of the output buffer.

This is to use sizeof (mPopUpString) as the BufferSize input to
UnicodeSPrint, it also updates array size of mPopUpString from 256 to
100 that is enough, otherwise the pop up string may be too long.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c