Author: tkreuzer
Date: Sat May 24 09:53:24 2014
New Revision: 63428
URL:
http://svn.reactos.org/svn/reactos?rev=63428&view=rev
Log:
[DDRAW]
Avoid buffer overrun in IDirectDraw::GetCaps. Patch by Jérôme Gardou.
CORE-4623 #resolve
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/Ge…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c [iso-8859-1] Sat May 24 09:53:24 2014
@@ -101,7 +101,7 @@
if (CoreCaps->dwSize == sizeof(DDCORECAPS))
{
- memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps,
sizeof(DDCAPS_DX3));
+ memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX3));
}
myCaps->dwVidMemFree = dwFree;
@@ -126,7 +126,7 @@
if (CoreCaps->dwSize == sizeof(DDCORECAPS))
{
- memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps,
sizeof(DDCORECAPS));
+ memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS));
}
myCaps->dwVidMemFree = dwFree;
@@ -152,7 +152,7 @@
if (CoreCaps->dwSize == sizeof(DDCORECAPS))
{
- memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps,
sizeof(DDCORECAPS));
+ memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS));
}
myCaps->dwVidMemFree = dwFree;
@@ -208,7 +208,7 @@
if (CoreCaps->dwSize == sizeof(DDCORECAPS))
{
- memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps,
sizeof(DDCAPS_DX3));
+ memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX3));
}
myCaps->dwVidMemFree = dwFree;
@@ -233,7 +233,7 @@
if (CoreCaps->dwSize == sizeof(DDCORECAPS))
{
- memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps,
sizeof(DDCORECAPS));
+ memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS));
}
myCaps->dwVidMemFree = dwFree;
@@ -259,7 +259,7 @@
if (CoreCaps->dwSize == sizeof(DDCORECAPS))
{
- memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps,
sizeof(DDCORECAPS));
+ memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS));
}
myCaps->dwVidMemFree = dwFree;