From f49eccef01263308652be64ec7ae5d8714ece08c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 14 Jan 2026 11:34:58 +0200 Subject: [PATCH] [KERNEL32] Fix alignment of a security descriptor Fixes boot of release builds. See CORE-20432 --- dll/win32/kernel32/winnls/string/nls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dll/win32/kernel32/winnls/string/nls.c b/dll/win32/kernel32/winnls/string/nls.c index 1acc8b5c585..4ee5dc48ae1 100644 --- a/dll/win32/kernel32/winnls/string/nls.c +++ b/dll/win32/kernel32/winnls/string/nls.c @@ -297,7 +297,11 @@ IntGetCodePageEntry(UINT CodePage) HANDLE SectionHandle = INVALID_HANDLE_VALUE, FileHandle; PBYTE SectionMapping; OBJECT_ATTRIBUTES ObjectAttributes; - UCHAR SecurityDescriptor[NLS_SECTION_SECURITY_DESCRIPTOR_SIZE]; + union + { + SECURITY_DESCRIPTOR AlignedSd; + UCHAR Buffer[NLS_SECTION_SECURITY_DESCRIPTOR_SIZE]; + } SecurityDescriptor; ANSI_STRING AnsiName; UNICODE_STRING UnicodeName; WCHAR FileName[MAX_PATH + 1]; @@ -389,7 +393,7 @@ IntGetCodePageEntry(UINT CodePage) &UnicodeName, OBJ_CASE_INSENSITIVE, NULL, - SecurityDescriptor); + &SecurityDescriptor); /* Try to open the section first */ Status = NtOpenSection(&SectionHandle,