summaryrefslogtreecommitdiff
path: root/modules/im/ximcp/imLcPrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/im/ximcp/imLcPrs.c')
-rw-r--r--modules/im/ximcp/imLcPrs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/im/ximcp/imLcPrs.c b/modules/im/ximcp/imLcPrs.c
index 4c7d6f0d..bcf45791 100644
--- a/modules/im/ximcp/imLcPrs.c
+++ b/modules/im/ximcp/imLcPrs.c
@@ -41,6 +41,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
#include <sys/stat.h>
#include <stdio.h>
+#include <limits.h>
#define XLC_BUFSIZE 256
@@ -688,6 +689,8 @@ parsestringfile(
if (fstat (fileno (fp), &st) != -1) {
unsigned long size = (unsigned long) st.st_size;
+ if (st.st_size >= INT_MAX)
+ return;
if (size <= sizeof tb) tbp = tb;
else tbp = malloc (size);