aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11')
-rw-r--r--nx-X11/lib/X11/XrmI.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/nx-X11/lib/X11/XrmI.h b/nx-X11/lib/X11/XrmI.h
index a1615f4e5..63ed257ed 100644
--- a/nx-X11/lib/X11/XrmI.h
+++ b/nx-X11/lib/X11/XrmI.h
@@ -35,11 +35,13 @@ from The Open Group.
#include <nx-X11/Xos.h>
#include <sys/stat.h>
+#include <limits.h>
#define GetSizeOfFile(fd,size) \
{ \
struct stat status_buffer; \
- if ( (fstat((fd), &status_buffer)) == -1 ) \
+ if ( ((fstat((fd), &status_buffer)) == -1 ) || \
+ (status_buffer.st_size >= INT_MAX) ) \
size = -1; \
else \
size = status_buffer.st_size; \