1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-01 05:45:45 +00:00

- Fix some potential buffer overflows

- build cleanup

Submitted by: Pedro F. Giffuni
This commit is contained in:
Volker Stolz 2005-01-13 09:34:42 +00:00
parent dfe234968d
commit bd20520e49
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=126309
6 changed files with 91 additions and 47 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= urt
PORTVERSION= 3.1b1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= graphics
MASTER_SITES= ftp://ftp.iastate.edu/pub/utah-raster/
DISTNAME= urt

View File

@ -1,5 +1,5 @@
--- config/urt.orig Thu Jul 16 04:47:15 1992
+++ config/urt Fri Dec 27 23:19:11 2002
--- config/urt.orig Wed Jul 15 19:47:15 1992
+++ config/urt Wed Jan 12 17:22:42 2005
@@ -1,3 +1,7 @@
+# Configuration for HP 9000/300 series running BSD4.3
+
@ -45,7 +45,7 @@
# You can put any system dependent flags here.
-ExtraCFLAGS =
+ExtraCFLAGS = -fno-strength-reduce
+ExtraCFLAGS =
# System specific or configuration parameters. Define according to your
# environment and desires.
@ -65,20 +65,22 @@
-##define USE_L_FLAG Use -Llibdir -lrle instead of libdir/liblre.a.
-##define USE_PROTOTYPES Declare library functions with ANSI-C prototypes.
-##define USE_RANDOM Your libc has the BSD random() function.
-##define USE_STDARG Use 'stdarg' instead of 'varargs' (ANSI).
-##define USE_STDLIB_H You have "stdlib.h".
-##define USE_UNISTD_H You have "unistd.h".
+#define SYS_V_SETPGRP Your system has the SysV setpgrp() call.
+#define USE_L_FLAG Use -Llibdir -lrle instead of libdir/liblre.a.
+#define USE_PROTOTYPES Declare library functions with ANSI-C prototypes.
+#define USE_RANDOM Your libc has the BSD random() function.
##define USE_STDARG Use 'stdarg' instead of 'varargs' (ANSI).
-##define USE_STDLIB_H You have "stdlib.h".
-##define USE_UNISTD_H You have "unistd.h".
+#define USE_STDARG Use 'stdarg' instead of 'varargs' (ANSI).
+#define USE_STDLIB_H You have "stdlib.h".
+#define USE_UNISTD_H You have "unistd.h".
##define USE_STRING_H You have "string.h", not "strings.h"
-##define VOID_STAR Your C compiler understands the 'void *' declaration.
+#define VOID_STAR Your C compiler understands the 'void *' declaration.
##define USE_XLIBINT_H You have the include file <X11/Xlibint.h>.
-##define USE_XLIBINT_H You have the include file <X11/Xlibint.h>.
-##define X_SHARED_MEMORY You have the XShm extension.
+#define VOID_STAR Your C compiler understands the 'void *' declaration.
+#define USE_XLIBINT_H You have the include file <X11/Xlibint.h>.
+#define X_SHARED_MEMORY You have the XShm extension.
# DEST is where all programs will be put. Can be overridden for specific
@ -125,7 +127,7 @@
#ifdef FB
-LIBFB = /usr/brl/lib/libfb.a
+LIBFB = $(X11BASE)/lib/brl/libfb.a
+LIBFB = $(LOCALBASE)/lib/libfb.a
#endif
#ifdef GRINNELL

View File

@ -0,0 +1,8 @@
--- get/getx11/XGetHClrs.c.orig Wed Jan 12 17:03:11 2005
+++ get/getx11/XGetHClrs.c Wed Jan 12 17:06:40 2005
@@ -1,5 +1,4 @@
#ifndef XLIBINT_H_NOT_AVAILABLE
-#include <X11/copyright.h>
/* $XConsortium: XGetHClrs.c,v 11.10 88/09/06 16:07:50 martin Exp $ */
/* Copyright Massachusetts Institute of Technology 1986 */

View File

@ -0,0 +1,44 @@
--- lib/rle_open_f.c.orig Thu May 13 21:28:51 1993
+++ lib/rle_open_f.c Wed Jan 12 16:06:07 2005
@@ -56,6 +56,7 @@
CONST_DECL char *err_str;
register char *cp;
char *combuf;
+ size_t combuf_size;
#ifdef STDIO_NEEDS_BINARY
char mode_string[32]; /* Should be enough. */
@@ -63,7 +64,7 @@
/* Concatenate a 'b' onto the mode. */
mode_string[0] = mode[0];
mode_string[1] = 'b';
- strcpy( mode_string + 2, mode + 1 );
+ strncpy( mode_string + 2, mode + 1, sizeof(mode_string + 2) );
mode = mode_string;
#endif
@@ -150,7 +151,8 @@
else if ( cp > file_name && *cp == '.' && *(cp + 1) == 'Z' )
{
int thepid; /* PID from my_popen. */
- combuf = (char *)malloc( 20 + strlen( file_name ) );
+ combuf_size = 20 + strlen( file_name );
+ combuf = (char *)malloc( combuf_size );
if ( combuf == NULL )
{
err_str = "%s: out of memory opening (compressed) %s for %s";
@@ -158,11 +160,11 @@
}
if ( *mode == 'w' )
- sprintf( combuf, "compress > %s", file_name );
+ snprintf( combuf, combuf_size, "compress > %s", file_name );
else if ( *mode == 'a' )
- sprintf( combuf, "compress >> %s", file_name );
+ snprintf( combuf, combuf_size, "compress >> %s", file_name );
else
- sprintf( combuf, "compress -d < %s", file_name );
+ snprintf( combuf, combuf_size, "compress -d < %s", file_name );
fp = my_popen( combuf, mode, &thepid );
free( combuf );

View File

@ -1,10 +0,0 @@
--- lib/scanargs.c.orig Tue Oct 28 07:54:53 2003
+++ lib/scanargs.c Tue Oct 28 07:55:14 2003
@@ -43,6 +43,7 @@
#include "rle_config.h"
#include <stdio.h>
#include <ctype.h>
+#define USE_STDARG
#ifndef USE_STDARG
#include <varargs.h>
#else

View File

@ -76,30 +76,30 @@ include/rle_raw.h
lib/librle.a
lib/librle.so
lib/librle.so.1
%%PORTDOCS%%share/doc/urt/README
%%PORTDOCS%%share/doc/urt/pics/README
%%PORTDOCS%%share/doc/urt/pics/bullet_holes_and_shot_turb.ps.Z
%%PORTDOCS%%share/doc/urt/pics/center_masks_and_fin_turb.ps.Z
%%PORTDOCS%%share/doc/urt/pics/dart_and_strtch.ps.Z
%%PORTDOCS%%share/doc/urt/pics/dart_shadow_and_monkey.ps.Z
%%PORTDOCS%%share/doc/urt/pics/pahriah_final.ps.Z
%%PORTDOCS%%share/doc/urt/pics/scanned_and_cropped.ps.Z
%%PORTDOCS%%share/doc/urt/rle.doc
%%PORTDOCS%%share/doc/urt/rle.mss
%%PORTDOCS%%share/doc/urt/rle.ps
%%PORTDOCS%%share/doc/urt/rle_head.ps
%%PORTDOCS%%share/doc/urt/rleops.ps
%%PORTDOCS%%share/doc/urt/toolkit.bib
%%PORTDOCS%%share/doc/urt/toolkit.doc
%%PORTDOCS%%share/doc/urt/toolkit.mss
%%PORTDOCS%%share/doc/urt/toolkit.ps
%%PORTDOCS%%share/examples/urt/img/README
%%PORTDOCS%%share/examples/urt/img/christmas_ball.rle
%%PORTDOCS%%share/examples/urt/img/dart.rle
%%PORTDOCS%%share/examples/urt/img/lenna.rle
%%PORTDOCS%%share/examples/urt/img/mandrill.rle
%%PORTDOCS%%share/examples/urt/img/tack_w_shadow.rle
%%PORTDOCS%%@dirrm share/doc/urt/pics
%%PORTDOCS%%@dirrm share/doc/urt
%%PORTDOCS%%@dirrm share/examples/urt/img
%%PORTDOCS%%@dirrm share/examples/urt
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/pics/README
%%PORTDOCS%%%%DOCSDIR%%/pics/bullet_holes_and_shot_turb.ps.Z
%%PORTDOCS%%%%DOCSDIR%%/pics/center_masks_and_fin_turb.ps.Z
%%PORTDOCS%%%%DOCSDIR%%/pics/dart_and_strtch.ps.Z
%%PORTDOCS%%%%DOCSDIR%%/pics/dart_shadow_and_monkey.ps.Z
%%PORTDOCS%%%%DOCSDIR%%/pics/pahriah_final.ps.Z
%%PORTDOCS%%%%DOCSDIR%%/pics/scanned_and_cropped.ps.Z
%%PORTDOCS%%%%DOCSDIR%%/rle.doc
%%PORTDOCS%%%%DOCSDIR%%/rle.mss
%%PORTDOCS%%%%DOCSDIR%%/rle.ps
%%PORTDOCS%%%%DOCSDIR%%/rle_head.ps
%%PORTDOCS%%%%DOCSDIR%%/rleops.ps
%%PORTDOCS%%%%DOCSDIR%%/toolkit.bib
%%PORTDOCS%%%%DOCSDIR%%/toolkit.doc
%%PORTDOCS%%%%DOCSDIR%%/toolkit.mss
%%PORTDOCS%%%%DOCSDIR%%/toolkit.ps
%%PORTDOCS%%%%EXAMPLESDIR%%/img/README
%%PORTDOCS%%%%EXAMPLESDIR%%/img/christmas_ball.rle
%%PORTDOCS%%%%EXAMPLESDIR%%/img/dart.rle
%%PORTDOCS%%%%EXAMPLESDIR%%/img/lenna.rle
%%PORTDOCS%%%%EXAMPLESDIR%%/img/mandrill.rle
%%PORTDOCS%%%%EXAMPLESDIR%%/img/tack_w_shadow.rle
%%PORTDOCS%%@dirrm %%DOCSDIR%%/pics
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/img
%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%