Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Sep 2005 20:57:26 -0300
From:      "Alejandro Pulver" <alejandro@varnet.biz>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/86480: [MAINTAINER UPDATE] games/warzone2100: fix segmentation fault and wrapper script
Message-ID:  <1127433446.0@phobos.mars.bsd>
Resent-Message-ID: <200509230000.j8N00Vbo078458@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         86480
>Category:       ports
>Synopsis:       [MAINTAINER UPDATE] games/warzone2100: fix segmentation fault and wrapper script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 23 00:00:30 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Alejandro Pulver
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
>Environment:





>Description:


Changes:
* Fix segmentation fault (it was calling "closedir()" with a NULL pointer as an argument, in Linux "closedir()" ignores it, but in FreeBSD it crashes).
* Fix wrapper script (arguments weren't passed to the real executable).


>How-To-Repeat:





>Fix:


--- warzone2100.diff begins here ---
diff -urN /usr/ports/games/warzone2100/Makefile warzone2100/Makefile
--- /usr/ports/games/warzone2100/Makefile	Fri Sep 16 08:07:08 2005
+++ warzone2100/Makefile	Wed Sep 21 11:19:38 2005
@@ -2,7 +2,7 @@
 # Date created:				21 Aug 2005
 # Whom:					Alejandro Pulver <alejandro@varnet.biz>
 #
-# $FreeBSD: ports/games/warzone2100/Makefile,v 1.1 2005/09/16 11:07:08 barner Exp $
+# $FreeBSD$
 #
 
 PORTNAME=	warzone2100
diff -urN /usr/ports/games/warzone2100/files/patch-src_loadsave.c warzone2100/files/patch-src_loadsave.c
--- /usr/ports/games/warzone2100/files/patch-src_loadsave.c	Wed Dec 31 21:00:00 1969
+++ warzone2100/files/patch-src_loadsave.c	Thu Sep 22 15:41:21 2005
@@ -0,0 +1,22 @@
+--- src/loadsave.c.orig	Wed Jul 27 13:33:56 2005
++++ src/loadsave.c	Thu Sep 22 15:40:54 2005
+@@ -341,7 +341,8 @@
+ 				}
+ 			}
+ 		}
+-		closedir(d);
++		if (d)
++			closedir(d);
+ 	}
+ #endif
+ 	bLoadSaveUp = TRUE;
+@@ -444,7 +445,8 @@
+ 			DeleteFile(entry->d_name);
+ 		}
+ 
+-		closedir(d);
++		if (d)
++			closedir(d);
+ 	}
+ #endif
+ 
diff -urN /usr/ports/games/warzone2100/files/warzone.in warzone2100/files/warzone.in
--- /usr/ports/games/warzone2100/files/warzone.in	Fri Sep 16 08:07:08 2005
+++ warzone2100/files/warzone.in	Thu Sep 22 16:11:28 2005
@@ -4,4 +4,4 @@
 
 cd %%DATADIR%% || exit 1
 
-exec %%PREFIX%%/libexec/warzone
+exec %%PREFIX%%/libexec/warzone "$@"
--- warzone2100.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1127433446.0>