openbsd-ports/graphics/tiff/patches/patch-tools_fax2ps_c
naddy fab96bfad1 SECURITY fixes for CVE-2006-2656 and CVE-2006-3459 through 3465.
Man page fixes.

Mostly via FreeBSD.  Approving noises from bernd@ and jasper@
2008-10-25 09:39:29 +00:00

20 lines
644 B
Plaintext

$OpenBSD: patch-tools_fax2ps_c,v 1.5 2008/10/25 09:39:29 naddy Exp $
--- tools/fax2ps.c.orig Fri Oct 24 18:41:45 2008
+++ tools/fax2ps.c Fri Oct 24 18:44:21 2008
@@ -373,11 +373,12 @@ main(int argc, char** argv)
int n;
FILE* fd;
char buf[16*1024];
+ char temp[22];
- fd = tmpfile();
+ strlcpy(temp, "/tmp/fax2psXXXXXXXXXX", sizeof(temp));
+ fd = fdopen(mkstemp(temp), "w+");
if (fd == NULL) {
- fprintf(stderr, "Could not create temporary file, exiting.\n");
- fclose(fd);
+ fprintf(stderr, "Could not create temporary file \"%s\".\n", temp);
exit(-2);
}
while ((n = read(fileno(stdin), buf, sizeof (buf))) > 0)