summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_cache.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-09-10 16:18:21 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-09-10 16:18:21 -0700
commitf75b9143e2ea5cf487eb76e42f58f816c88e688a (patch)
treee247dfd58c6b17a9c56a92994fcba7d463ab88c2 /xrdp/xrdp_cache.c
parent06d92b787ad12b693ee174ce8885636c5511b31c (diff)
downloadxrdp-proprietary-f75b9143e2ea5cf487eb76e42f58f816c88e688a.tar.gz
xrdp-proprietary-f75b9143e2ea5cf487eb76e42f58f816c88e688a.zip
VUL: make sure cache entries are in range
Diffstat (limited to 'xrdp/xrdp_cache.c')
-rw-r--r--xrdp/xrdp_cache.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c
index f421371d..b5787763 100644
--- a/xrdp/xrdp_cache.c
+++ b/xrdp/xrdp_cache.c
@@ -33,16 +33,27 @@ xrdp_cache_create(struct xrdp_wm *owner,
self->wm = owner;
self->session = session;
self->use_bitmap_comp = client_info->use_bitmap_comp;
- self->cache1_entries = client_info->cache1_entries;
+
+ self->cache1_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX,
+ client_info->cache1_entries);
+ self->cache1_entries = MAX(self->cache1_entries, 0);
self->cache1_size = client_info->cache1_size;
- self->cache2_entries = client_info->cache2_entries;
+
+ self->cache2_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX,
+ client_info->cache2_entries);
+ self->cache2_entries = MAX(self->cache2_entries, 0);
self->cache2_size = client_info->cache2_size;
- self->cache3_entries = client_info->cache3_entries;
+
+ self->cache3_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX,
+ client_info->cache3_entries);
+ self->cache3_entries = MAX(self->cache3_entries, 0);
self->cache3_size = client_info->cache3_size;
+
self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable;
self->bitmap_cache_version = client_info->bitmap_cache_version;
self->pointer_cache_entries = client_info->pointer_cache_entries;
self->xrdp_os_del_list = list_create();
+
return self;
}