Commit 3b5107d0 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

advapi32: Prevent buffer overrun.

parent 453d71b9
...@@ -4512,13 +4512,15 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor( ...@@ -4512,13 +4512,15 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(
{ {
BOOL bret = FALSE; BOOL bret = FALSE;
WCHAR toktype; WCHAR toktype;
WCHAR tok[MAX_PATH]; WCHAR *tok;
LPCWSTR lptoken; LPCWSTR lptoken;
LPBYTE lpNext = NULL; LPBYTE lpNext = NULL;
DWORD len; DWORD len;
*cBytes = sizeof(SECURITY_DESCRIPTOR); *cBytes = sizeof(SECURITY_DESCRIPTOR);
tok = heap_alloc( (lstrlenW(StringSecurityDescriptor) + 1) * sizeof(WCHAR));
if (SecurityDescriptor) if (SecurityDescriptor)
lpNext = (LPBYTE)(SecurityDescriptor + 1); lpNext = (LPBYTE)(SecurityDescriptor + 1);
...@@ -4640,6 +4642,7 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor( ...@@ -4640,6 +4642,7 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(
bret = TRUE; bret = TRUE;
lend: lend:
heap_free(tok);
return bret; return bret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment