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.
Error in dll/win32/syssetup/security.c
Moderator: Moderator Team
- binarymaster
- Posts: 481
- Joined: Sun Nov 16, 2014 7:05 pm
- Location: Russia, Moscow
- Contact:
Re: Error in dll/win32/syssetup/security.c
It seems DomainNameInfo.DomainName.Length variable has length in bytes, so...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.
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);
by Stas'M | https://github.com/binarymaster
Who is online
Users browsing this forum: Ahrefs [Bot] and 55 guests