aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/fontfile/filewr.c
diff options
context:
space:
mode:
authorMike DePaulo <mikedep333@gmail.com>2015-05-09 20:15:27 -0400
committerMike DePaulo <mikedep333@gmail.com>2015-05-09 20:20:02 -0400
commitbec4be4c48239613ed1c704ae71bf08754eef711 (patch)
tree3bcc6202527e53611fd6f66ea147bda48e6e6b14 /libXfont/src/fontfile/filewr.c
parent13c50b4df1dc97026afb7c783378ade4929f24f1 (diff)
downloadvcxsrv-bec4be4c48239613ed1c704ae71bf08754eef711.tar.gz
vcxsrv-bec4be4c48239613ed1c704ae71bf08754eef711.tar.bz2
vcxsrv-bec4be4c48239613ed1c704ae71bf08754eef711.zip
Updated to libXfont 1.5.1
In addition to some other changes, the following CVEs have been fixed: bdfReadProperties: property count needs range check [CVE-2015-1802] bdfReadCharacters: bailout if a char's bitmap cannot be read [CVE-2015-1803] bdfReadCharacters: ensure metrics fit into xCharInfo struct [CVE-2015-1804]
Diffstat (limited to 'libXfont/src/fontfile/filewr.c')
-rw-r--r--libXfont/src/fontfile/filewr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libXfont/src/fontfile/filewr.c b/libXfont/src/fontfile/filewr.c
index bcc7b1eda..859a0bec1 100644
--- a/libXfont/src/fontfile/filewr.c
+++ b/libXfont/src/fontfile/filewr.c
@@ -33,17 +33,19 @@ in this Software without prior written authorization from The Open Group.
#endif
#include <X11/fonts/fntfilio.h>
#include <X11/Xos.h>
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
FontFilePtr
FontFileOpenWrite (const char *name)
{
int fd;
-#if defined(WIN32) || defined(__CYGWIN__)
- fd = open (name, O_CREAT|O_TRUNC|O_RDWR|O_BINARY, 0666);
-#else
- fd = creat (name, 0666);
-#endif
+ fd = open (name, O_CREAT|O_TRUNC|O_RDWR|O_BINARY|O_CLOEXEC, 0666);
if (fd < 0)
return 0;
return (FontFilePtr) BufFileOpenWrite (fd);