Skip to content

Commit f49ecce

Browse files
committed
[KERNEL32] Fix alignment of a security descriptor
Fixes boot of release builds. See CORE-20432
1 parent ae3aee6 commit f49ecce

File tree

1 file changed

+6
-2
lines changed
  • dll/win32/kernel32/winnls/string

1 file changed

+6
-2
lines changed

dll/win32/kernel32/winnls/string/nls.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,11 @@ IntGetCodePageEntry(UINT CodePage)
297297
HANDLE SectionHandle = INVALID_HANDLE_VALUE, FileHandle;
298298
PBYTE SectionMapping;
299299
OBJECT_ATTRIBUTES ObjectAttributes;
300-
UCHAR SecurityDescriptor[NLS_SECTION_SECURITY_DESCRIPTOR_SIZE];
300+
union
301+
{
302+
SECURITY_DESCRIPTOR AlignedSd;
303+
UCHAR Buffer[NLS_SECTION_SECURITY_DESCRIPTOR_SIZE];
304+
} SecurityDescriptor;
301305
ANSI_STRING AnsiName;
302306
UNICODE_STRING UnicodeName;
303307
WCHAR FileName[MAX_PATH + 1];
@@ -389,7 +393,7 @@ IntGetCodePageEntry(UINT CodePage)
389393
&UnicodeName,
390394
OBJ_CASE_INSENSITIVE,
391395
NULL,
392-
SecurityDescriptor);
396+
&SecurityDescriptor);
393397

394398
/* Try to open the section first */
395399
Status = NtOpenSection(&SectionHandle,

0 commit comments

Comments
 (0)