:p
atchew
Login
AsciiStrLen was one byte too short (though with alignment up from an odd size would probably always have had the required space in practice). AsciiStrSize matches usage elsewhere in this file and in the codebase. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com> --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index XXXXXXX..XXXXXXX 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -XXX,XX +XXX,XX @@ GetNameFromId ( NULL ); if (BestLanguage == NULL) { - BestLanguage = AllocateCopyPool (AsciiStrLen ("en-US"), "en-US"); + BestLanguage = AllocateCopyPool (AsciiStrSize ("en-US"), "en-US"); ASSERT (BestLanguage != NULL); } -- 2.41.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108322): https://edk2.groups.io/g/devel/message/108322 Mute This Topic: https://groups.io/mt/101189764/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
AsciiStrLen is one byte too short, thus whether the space allocated is really sufficient and whether the resultant string is really null-terminated becomes implementation-dependent. An explicitly compile-time string length calculation might be even more ideal, but AsciiStrSize matches usage elsewhere in the codebase. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com> --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index XXXXXXX..XXXXXXX 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -XXX,XX +XXX,XX @@ GetNameFromId ( NULL ); if (BestLanguage == NULL) { - BestLanguage = AllocateCopyPool (AsciiStrLen ("en-US"), "en-US"); + BestLanguage = AllocateCopyPool (AsciiStrSize ("en-US"), "en-US"); ASSERT (BestLanguage != NULL); } -- 2.41.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108345): https://edk2.groups.io/g/devel/message/108345 Mute This Topic: https://groups.io/mt/101204385/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-