Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  2 Apr 2004 17:12:06 -0700
From:      "Jie Gao" <gaoj@cpsc.ucalgary.ca>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/65101: [PATCH] Port database/dbf: segmentation fault 
Message-ID:  <200404030012.i330C6qW031894@imgw1.cpsc.ucalgary.ca>
Resent-Message-ID: <200404030020.i330KIYW088271@freefall.freebsd.org>

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

>Number:         65101
>Category:       ports
>Synopsis:       [PATCH] Port database/dbf: segmentation fault
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 02 16:20:17 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jie Gao
>Release:        FreeBSD 5.2.1-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD aibsd 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #2: Mon Mar 29 09:30:20 MST 2004 gaoj@aibsd:/usr/src/sys/i386/compile/AIBSD i386


	
>Description:
The port database/dbf crashes on start up. Get a sigmentation fault due to a
NULL pointer in strcmp function.
	
>How-To-Repeat:
Make database/dbf from ports, get a dbf file, say, test.dbf, and type:

	dbf test.dbf

at where the test.dbf file is, you will get the sigmentation fault.
	
>Fix:

See the attached patch. The fix is already in dbf author's CVS.

	

--- dbf.diff begins here ---
diff -ruN dbf.bak/files/patch-dbf.c dbf/files/patch-dbf.c
--- dbf.bak/files/patch-dbf.c	Fri Apr  2 17:02:40 2004
+++ dbf/files/patch-dbf.c	Fri Apr  2 17:02:21 2004
@@ -1,6 +1,15 @@
---- dbf.c.orig	Tue Nov 11 16:48:07 2003
-+++ dbf.c	Tue Nov 11 16:48:19 2003
-@@ -315,6 +315,7 @@
+--- dbf.c.orig	Thu Nov 20 05:22:03 2003
++++ dbf.c	Fri Apr  2 17:01:43 2004
+@@ -341,7 +341,7 @@
+ 	if (verbosity > 0)
+ 		banner();
+ 
+-	if(0 == strcmp(export_filename, "-"))
++	if(!export_filename || (0 == strcmp(export_filename, "-")))
+ 		output = stdout;
+ 	else
+ 		output = export_open(export_filename);
+@@ -357,6 +357,7 @@
  		exit(1);
  
  	if (writeLine) {
@@ -8,7 +17,7 @@
  		if ((record = malloc(record_length + 1)) == NULL)	{
  			perror("malloc"); exit(1);
  		}
-@@ -327,7 +328,6 @@
+@@ -369,7 +370,6 @@
  		//lseek(dbfhandle, rotate2b(db->header_length) + 1, SEEK_SET);
  		
  		/* At this point we look if the following data set is deleted */		
--- dbf.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?200404030012.i330C6qW031894>