mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[cache,pointer] ignore pointer cache index violations
If a pointer cache index is out of range for the corresponding size announced by the capability but within range of the total cache size only print a warning but do not abort.
This commit is contained in:
10
libfreerdp/cache/pointer.c
vendored
10
libfreerdp/cache/pointer.c
vendored
@@ -301,7 +301,7 @@ BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer*
|
||||
WINPR_ASSERT(pointer_cache->context);
|
||||
|
||||
const UINT32 size = freerdp_settings_get_uint32(pointer_cache->context->settings, id);
|
||||
if ((index >= pointer_cache->cacheSize) || (index >= size))
|
||||
if (index >= pointer_cache->cacheSize)
|
||||
{
|
||||
WLog_ERR(TAG,
|
||||
"invalid pointer index:%" PRIu32 " [allocated %" PRIu32 ", %s size %" PRIu32 "]",
|
||||
@@ -309,6 +309,14 @@ BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer*
|
||||
colorCache ? "color-pointer-cache" : "pointer-cache", size);
|
||||
return FALSE;
|
||||
}
|
||||
if (index >= size)
|
||||
{
|
||||
WLog_WARN(TAG,
|
||||
"suspicious pointer index:%" PRIu32 " [allocated %" PRIu32 ", %s size %" PRIu32
|
||||
"]",
|
||||
index, pointer_cache->cacheSize,
|
||||
colorCache ? "color-pointer-cache" : "pointer-cache", size);
|
||||
}
|
||||
|
||||
WINPR_ASSERT(pointer_cache->entries);
|
||||
prevPointer = pointer_cache->entries[index];
|
||||
|
||||
Reference in New Issue
Block a user