summaryrefslogtreecommitdiff
path: root/src/XRes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XRes.c')
-rw-r--r--src/XRes.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/XRes.c b/src/XRes.c
index ae86206..5117321 100644
--- a/src/XRes.c
+++ b/src/XRes.c
@@ -129,7 +129,12 @@ Status XResQueryClients (
}
if(rep.num_clients) {
- if((clnts = Xmalloc(sizeof(XResClient) * rep.num_clients))) {
+ if (rep.num_clients < (INT_MAX / sizeof(XResClient)))
+ clnts = Xmalloc(sizeof(XResClient) * rep.num_clients);
+ else
+ clnts = NULL;
+
+ if (clnts != NULL) {
xXResClient scratch;
int i;