Commit c36a154e authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

More off-by-one errors fixed.

parent a370ab4e
...@@ -198,7 +198,7 @@ BOOL32 HANDLE_SetObjPtr( PDB32 *pdb, HANDLE32 handle, K32OBJ *ptr, ...@@ -198,7 +198,7 @@ BOOL32 HANDLE_SetObjPtr( PDB32 *pdb, HANDLE32 handle, K32OBJ *ptr,
BOOL32 ret = FALSE; BOOL32 ret = FALSE;
SYSTEM_LOCK(); SYSTEM_LOCK();
if ((handle > 0) && (handle <= pdb->handle_table->count)) if ((handle > 0) && (handle < pdb->handle_table->count))
{ {
HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle]; HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle];
K32OBJ *old_ptr = entry->ptr; K32OBJ *old_ptr = entry->ptr;
...@@ -222,7 +222,7 @@ static BOOL32 HANDLE_GetAccess( PDB32 *pdb, HANDLE32 handle, LPDWORD access ) ...@@ -222,7 +222,7 @@ static BOOL32 HANDLE_GetAccess( PDB32 *pdb, HANDLE32 handle, LPDWORD access )
BOOL32 ret = FALSE; BOOL32 ret = FALSE;
SYSTEM_LOCK(); SYSTEM_LOCK();
if ((handle > 0) && (handle <= pdb->handle_table->count)) if ((handle > 0) && (handle < pdb->handle_table->count))
{ {
HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle]; HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle];
if (entry->ptr) if (entry->ptr)
...@@ -246,7 +246,7 @@ static BOOL32 HANDLE_Close( PDB32 *pdb, HANDLE32 handle ) ...@@ -246,7 +246,7 @@ static BOOL32 HANDLE_Close( PDB32 *pdb, HANDLE32 handle )
K32OBJ *ptr; K32OBJ *ptr;
SYSTEM_LOCK(); SYSTEM_LOCK();
if ((handle > 0) && (handle <= pdb->handle_table->count)) if ((handle > 0) && (handle < pdb->handle_table->count))
{ {
HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle]; HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle];
if ((ptr = entry->ptr)) if ((ptr = entry->ptr))
...@@ -314,7 +314,7 @@ BOOL32 WINAPI GetHandleInformation( HANDLE32 handle, LPDWORD flags ) ...@@ -314,7 +314,7 @@ BOOL32 WINAPI GetHandleInformation( HANDLE32 handle, LPDWORD flags )
PDB32 *pdb = PROCESS_Current(); PDB32 *pdb = PROCESS_Current();
SYSTEM_LOCK(); SYSTEM_LOCK();
if ((handle > 0) && (handle <= pdb->handle_table->count)) if ((handle > 0) && (handle < pdb->handle_table->count))
{ {
HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle]; HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle];
if (entry->ptr) if (entry->ptr)
...@@ -341,7 +341,7 @@ BOOL32 WINAPI SetHandleInformation( HANDLE32 handle, DWORD mask, DWORD flags ) ...@@ -341,7 +341,7 @@ BOOL32 WINAPI SetHandleInformation( HANDLE32 handle, DWORD mask, DWORD flags )
mask = (mask << RESERVED_SHIFT) & RESERVED_ALL; mask = (mask << RESERVED_SHIFT) & RESERVED_ALL;
flags = (flags << RESERVED_SHIFT) & RESERVED_ALL; flags = (flags << RESERVED_SHIFT) & RESERVED_ALL;
SYSTEM_LOCK(); SYSTEM_LOCK();
if ((handle > 0) && (handle <= pdb->handle_table->count)) if ((handle > 0) && (handle < pdb->handle_table->count))
{ {
HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle]; HANDLE_ENTRY *entry = &pdb->handle_table->entries[handle];
if (entry->ptr) if (entry->ptr)
......
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