From llwang@infor.ck.tp.edu.tw  Mon Jul  5 17:18:58 2004
Return-Path: <llwang@infor.ck.tp.edu.tw>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BB8A816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Jul 2004 17:18:58 +0000 (GMT)
Received: from infor.ck.tp.edu.tw (infor.ck.tp.edu.tw [203.64.26.200])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 83DF543D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Jul 2004 17:18:58 +0000 (GMT)
	(envelope-from llwang@infor.ck.tp.edu.tw)
Received: by infor.ck.tp.edu.tw (Postfix, from userid 1001)
	id C7B7A92C1; Tue,  6 Jul 2004 01:18:56 +0800 (CST)
Message-Id: <20040705171856.C7B7A92C1@infor.ck.tp.edu.tw>
Date: Tue,  6 Jul 2004 01:18:56 +0800 (CST)
From: Leland Wang <llwang@infor.org>
Reply-To: Leland Wang <llwang@infor.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: x11-wm/skippy fails to read configuration file and crashes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         68705
>Category:       ports
>Synopsis:       x11-wm/skippy fails to read configuration file and crashes
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 05 17:20:14 GMT 2004
>Closed-Date:    Mon Jul 12 11:56:54 GMT 2004
>Last-Modified:  Mon Jul 12 11:56:54 GMT 2004
>Originator:     Leland Wang
>Release:        FreeBSD 4.9-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD ll-X31 5.2-CURRENT FreeBSD 5.2-CURRENT #21: Sun Jul 4 10:28:48 CST 2004 root@ll-X31:/usr/obj/usr/src/sys/X31 i386


	
>Description:
If the sample configuration file is copied to ~/.skippyrc, when skippy runs,
it complains that every non-comment line is invalid and crashes.
The complaint results from two failed regcomp()'s, and the crash results
from the unability to find the end of config string.
	
>How-To-Repeat:
cd /usr/ports/x11-wm/skippy
make install
cp /usr/local/share/skippy/skippyrc-default ~/.skippyrc
skippy
	
>Fix:
diff -urN skippy.orig/files/patch-config.c skippy/files/patch-config.c
--- skippy.orig/files/patch-config.c	Thu Jan  1 08:00:00 1970
+++ skippy/files/patch-config.c	Mon Jul  5 23:33:45 2004
@@ -0,0 +1,22 @@
+--- config.c.orig	Mon Jul  5 22:36:39 2004
++++ config.c	Mon Jul  5 23:32:25 2004
+@@ -72,9 +72,9 @@
+ 	int ix = 0, l_ix = 0;
+ 	dlist *new_config = 0;
+ 	
+-	regcomp(&re_section, "^[[:space:]]*\\[[[:space:]]*([[:alnum:]]*?)[[:space:]]*\\][[:space:]]*$", REG_EXTENDED);
++	regcomp(&re_section, "^[[:space:]]*\\[[[:space:]]*([[:alnum:]]*)[[:space:]]*\\][[:space:]]*$", REG_EXTENDED);
+ 	regcomp(&re_empty, "^[[:space:]]*#|^[[:space:]]*$", REG_EXTENDED);
+-	regcomp(&re_entry, "^[[:space:]]*([[:alnum:]]+)[[:space:]]*=[[:space:]]*(.*?)[[:space:]]*$", REG_EXTENDED);
++	regcomp(&re_entry, "^[[:space:]]*([[:alnum:]]+)[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$", REG_EXTENDED);
+ 	
+ 	while(1)
+ 	{
+@@ -148,6 +148,7 @@
+ 		fclose(fin);
+ 		return 0;
+ 	}
++	data[flen] = '\0';
+ 	
+ 	fclose(fin);
+ 	

	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Tue Jul 6 13:16:48 GMT 2004 
State-Changed-Why:  
Forwarded PR to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68705 

From: "Volker Stolz" <vs@freebsd.org>
To: freebsd-gnats-submit@freebsd.org, llwang@infor.org, ahze@ahze.net
Cc:  
Subject: Re: ports/68705: x11-wm/skippy fails to read configuration file and crashes
Date: Tue, 06 Jul 2004 15:17:43 +0200

 Forward PR to maintainer for reviewing.
 
 Volker

From: michael johnson <ahze@ahze.net>
To: llwang@infor.org, freebsd-gnats-submit@FreeBSD.org
Cc: Volker Stolz <vs@freebsd.org>
Subject: Re: ports/68705: x11-wm/skippy fails to read configuration file and crashes
Date: Fri, 9 Jul 2004 12:31:53 -0400

 with or with out the patch seem to work for me, so please go ahead and 
 commit this patch
 
 Thanks for the patch
 Michael
 
State-Changed-From-To: feedback->closed 
State-Changed-By: vs 
State-Changed-When: Mon Jul 12 11:56:36 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68705 
>Unformatted:
