Author: janderwald
Date: Tue Jul 18 17:44:39 2006
New Revision: 23142
URL:
http://svn.reactos.org/svn/reactos?rev=23142&view=rev
Log:
* check parameters in CreateAcceleratorTableA/W and DestroyAcceleratorTable
Modified:
trunk/reactos/dll/win32/user32/windows/accel.c
Modified: trunk/reactos/dll/win32/user32/windows/accel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/a…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/accel.c (original)
+++ trunk/reactos/dll/win32/user32/windows/accel.c Tue Jul 18 17:44:39 2006
@@ -187,6 +187,9 @@
U32_ACCEL_CACHE_ENTRY ** ppEntry;
ULONG_PTR nUsage = 0;
+ if (!hAccel)
+ return FALSE;
+
EnterCriticalSection(&U32AccelCacheLock);
/* see if this accelerator table has been cached */
@@ -281,6 +284,8 @@
*/
HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccl, int cEntries)
{
+ if (!cEntries || !lpaccl) return (HACCEL)0;
+
return NtUserCreateAcceleratorTable(lpaccl, cEntries);
}
@@ -325,6 +330,8 @@
HACCEL WINAPI CreateAcceleratorTableA(LPACCEL lpaccl, int cEntries)
{
int i;
+
+ if (!cEntries || !lpaccl) return (HACCEL)0;
for(i = 0; i < cEntries; ++ i)
if(!lpaccl[i].fVirt)