diff options
author | Mike Beaton <mjsbeaton@gmail.com> | 2023-09-07 11:34:42 +0800 |
---|---|---|
committer | Liming Gao <gaoliming@byosoft.com.cn> | 2023-09-11 08:43:01 +0800 |
commit | 3e38573dd4a3371fe621dc821cb998f8e6de82ac (patch) | |
tree | 9e4c731196cfb010aa28a29616fe9b85301c7743 /Nt32Pkg/SnpNt32Dxe/SnpNt32.h | |
parent | b240eab03530f063ef5438497d70a731b19a201e (diff) | |
download | edk2-9m11_23.tar.gz edk2-9m11_23.tar.bz2 edk2-9m11_23.zip |
MdeModulePkg/HiiDatabase: Fix incorrect AllocateCopyPool size9m11_23
The immediately preceding call, GetBestLanguage, plus the implementation of
HiiGetString, which is called immediately afterwards, make it clear that
BestLanguage is a null-terminated ASCII string, and not just a five byte,
non-null terminated buffer.
Therefore AsciiStrLen is one byte too short, meaning that whether the space
allocated is really sufficient and whether the resultant string is really
null-terminated becomes implementation-dependent. Rather than switching to
AsciiStrSize, we use an explicitly compile-time string length calculation
(both compile-time and run-time approaches are currently used elsewhere in
the codebase for copying static strings).
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Diffstat (limited to 'Nt32Pkg/SnpNt32Dxe/SnpNt32.h')
0 files changed, 0 insertions, 0 deletions