mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 09:41:23 +00:00
Don't write outside buffer
svn path=/trunk/; revision=12349
This commit is contained in:
parent
0afb1fb12d
commit
8bbd20efdc
1 changed files with 9 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: reg.c,v 1.66 2004/12/25 11:18:50 navaraf Exp $
|
/* $Id: reg.c,v 1.67 2004/12/26 23:09:51 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -2505,9 +2505,16 @@ RegQueryValueExA (HKEY hKey,
|
||||||
Length = Length / sizeof(WCHAR);
|
Length = Length / sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
else if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL)
|
else if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL)
|
||||||
|
{
|
||||||
|
if (*lpcbData < Length)
|
||||||
|
{
|
||||||
|
ErrorCode = ERROR_MORE_DATA;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
RtlMoveMemory(lpData, ValueData.Buffer, Length);
|
RtlMoveMemory(lpData, ValueData.Buffer, Length);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (lpcbData != NULL)
|
if (lpcbData != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue