diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2004-11-25 21:19:11 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2004-11-25 21:19:11 +0000 |
commit | 50986a34f231fbc7a4b62466bd89bd4ae4027d2e (patch) | |
tree | 99344977192a8fc0820713b562c704016da6554e /src/RdFToBuf.c | |
parent | a983dafac59dcb425666a5a5556da4734e50c6c5 (diff) |
Fixes for CAN-2004-0914 (Thomas Biege).xprint_packagertest_20041125_basexprint_packagertest_20041125
Diffstat (limited to 'src/RdFToBuf.c')
-rw-r--r-- | src/RdFToBuf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/RdFToBuf.c b/src/RdFToBuf.c index 898a9fc..f6ad75d 100644 --- a/src/RdFToBuf.c +++ b/src/RdFToBuf.c @@ -37,6 +37,8 @@ * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ +/* October 2004, source code review by Thomas Biege <thomas@suse.de> */ + #include "XpmI.h" #include <sys/stat.h> #if !defined(FOR_MSW) && !defined(WIN32) @@ -58,7 +60,8 @@ XpmReadFileToBuffer(filename, buffer_return) char *filename; char **buffer_return; { - int fd, fcheck, len; + int fd, fcheck; + off_t len; char *ptr; struct stat stats; FILE *fp; @@ -82,7 +85,7 @@ XpmReadFileToBuffer(filename, buffer_return) close(fd); return XpmOpenFailed; } - len = (int) stats.st_size; + len = stats.st_size; ptr = (char *) XpmMalloc(len + 1); if (!ptr) { fclose(fp); |