freebsd-ports/lang/f2c/files/patch-better-security
Maho Nakata 0c195ec951 Patch from security/flawfinder, and bump portrevision.
Submitted by:	Pedro Giffuni
2008-08-13 07:51:51 +00:00

76 lines
2.3 KiB
Text

diff -ruN f2c.orig/files/patch-libf2c+lwrite.c f2c/files/patch-libf2c+lwrite.c
--- f2c.orig/files/patch-libf2c+lwrite.c 1969-12-31 19:00:00.000000000 -0500
+++ f2c/files/patch-libf2c+lwrite.c 2008-07-29 14:05:35.000000000 -0500
@@ -0,0 +1,24 @@
+--- libf2c/lwrite.c.orig 2008-07-29 13:57:49.000000000 -0500
++++ libf2c/lwrite.c 2008-07-29 14:02:33.000000000 -0500
+@@ -107,10 +107,10 @@
+ absn = -absn;
+ fmt = LLOW <= absn && absn < LHIGH ? LFFMT : LEFMT;
+ #ifdef USE_STRLEN
+- sprintf(buf, fmt, n);
++ snprintf(buf, sizeof(buf), fmt, n);
+ return strlen(buf);
+ #else
+- return sprintf(buf, fmt, n);
++ return snprintf(buf, sizeof(buf), fmt, n);
+ #endif
+
+ #else
+@@ -134,7 +134,7 @@
+ *b = 0;
+ goto f__ret;
+ }
+- sprintf(b, LGFMT, n);
++ snprintf(b, sizeof(b), LGFMT, n);
+ switch(*b) {
+ #ifndef WANT_LEAD_0
+ case '0':
diff -ruN f2c.orig/files/patch-libf2c+open.c f2c/files/patch-libf2c+open.c
--- f2c.orig/files/patch-libf2c+open.c 1969-12-31 19:00:00.000000000 -0500
+++ f2c/files/patch-libf2c+open.c 2008-07-29 14:08:51.000000000 -0500
@@ -0,0 +1,29 @@
+--- libf2c/open.c.orig 2008-07-29 13:58:04.000000000 -0500
++++ libf2c/open.c 2008-07-29 14:08:30.000000000 -0500
+@@ -12,7 +12,7 @@
+ #ifdef KR_headers
+ extern char *malloc();
+ #ifdef NON_ANSI_STDIO
+-extern char *mktemp();
++extern int mkstemp();
+ #endif
+ extern integer f_clos();
+ #else
+@@ -187,7 +187,7 @@
+ opnerr(a->oerr,107,"open")
+ }
+ else
+- sprintf(buf, "fort.%ld", (long)a->ounit);
++ snprintf(buf, sizeof(buf), "fort.%ld", (long)a->ounit);
+ b->uscrtch = 0;
+ b->uend=0;
+ b->uwrt = 0;
+@@ -211,7 +211,7 @@
+ b->uscrtch=1;
+ #ifdef NON_ANSI_STDIO
+ (void) strcpy(buf,"tmp.FXXXXXX");
+- (void) mktemp(buf);
++ (void) mkstemp(buf);
+ goto replace;
+ #else
+ if (!(b->ufd = tmpfile()))
diff -ruN f2c.orig/files/patch-libf2c+rawio.h f2c/files/patch-libf2c+rawio.h
--- f2c.orig/files/patch-libf2c+rawio.h 1969-12-31 19:00:00.000000000 -0500
+++ f2c/files/patch-libf2c+rawio.h 2008-07-29 14:09:17.000000000 -0500
@@ -0,0 +1,11 @@
+--- libf2c/rawio.h.orig 2008-07-29 14:07:02.000000000 -0500
++++ libf2c/rawio.h 2008-07-29 14:08:08.000000000 -0500
+@@ -26,7 +26,7 @@
+ #endif
+ #endif /*KR_HEADERS*/
+
+-extern char *mktemp(char*);
++extern int mkstemp(char*);
+
+ #ifdef __cplusplus
+ }