Author: cwittich
Date: Tue Dec 30 09:12:17 2008
New Revision: 38472
URL:
http://svn.reactos.org/svn/reactos?rev=38472&view=rev
Log:
fix some security winetests
Modified:
trunk/reactos/dll/win32/advapi32/sec/misc.c
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] Tue Dec 30 09:12:17 2008
@@ -1261,9 +1261,9 @@
WideCharToMultiByte(CP_ACP,
0,
lpReferencedDomainNameW,
- *hReferencedDomainNameLength,
+ *hReferencedDomainNameLength + 1,
ReferencedDomainName,
- *hReferencedDomainNameLength,
+ *hReferencedDomainNameLength + 1,
NULL,
NULL);
}
@@ -1343,13 +1343,16 @@
if (ReferencedDomainName != NULL && (*cchReferencedDomainName >
wcslen(dm)))
wcscpy(ReferencedDomainName, dm);
- if (*cchReferencedDomainName <= wcslen(dm))
+ if ((*cchReferencedDomainName <= wcslen(dm)) || (!ret))
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
ret = FALSE;
- }
-
- *cchReferencedDomainName = wcslen(dm)+1;
+ *cchReferencedDomainName = wcslen(dm) + 1;
+ }
+ else
+ {
+ *cchReferencedDomainName = wcslen(dm);
+ }
FreeSid(pSid);