Error in dll/win32/syssetup/security.c

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
Ohnemichel
Posts: 10
Joined: Wed Sep 21, 2011 5:04 pm

Error in dll/win32/syssetup/security.c

Post by Ohnemichel »

commit ca1814f2c94c61404ade0f7d54c8d313e68911d4 inserted a bug in line 103 of dll/win32/syssetup/security.c

usually, you multiply the length with the datatype size, instead of adding the type size, right?
While before the commit, the old length was multiplied with sizeof(WCHAR_T), but now, it is added to the new length definition.
User avatar
binarymaster
Posts: 481
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: Error in dll/win32/syssetup/security.c

Post by binarymaster »

Ohnemichel wrote: Sat Mar 27, 2021 11:25 am commit ca1814f2c94c61404ade0f7d54c8d313e68911d4 inserted a bug in line 103 of dll/win32/syssetup/security.c

usually, you multiply the length with the datatype size, instead of adding the type size, right?
While before the commit, the old length was multiplied with sizeof(WCHAR_T), but now, it is added to the new length definition.
It seems DomainNameInfo.DomainName.Length variable has length in bytes, so...

Code: Select all

// this
DomainNameInfo.DomainName.Length + sizeof(WCHAR);

// is equal to
(DomainNameInfo.DomainName.Length / sizeof(WCHAR) + 1) * sizeof(WCHAR);

// previously it was
(wcslen(DomainName) + 1) * sizeof(WCHAR);
Note that I can be wrong, since I didn't checked it in details, so in this case report this bug to our Jira bugtracker.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 11 guests