From corecode@corecode.ath.cx  Tue Jul 16 11:36:34 2002
Return-Path: <corecode@corecode.ath.cx>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 8E67D37B447; Tue, 16 Jul 2002 11:36:26 -0700 (PDT)
Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id B4CCA43E4A; Tue, 16 Jul 2002 11:36:25 -0700 (PDT)
	(envelope-from corecode@corecode.ath.cx)
Received: from fwd05.sul.t-online.de 
	by mailout09.sul.t-online.com with smtp 
	id 17UXBQ-00063a-05; Tue, 16 Jul 2002 20:36:24 +0200
Received: from spirit.zuhause.stoert.net (320050403952-0001@[80.128.113.66]) by fmrl05.sul.t-online.com
	with esmtp id 17UXBN-1XkarQC; Tue, 16 Jul 2002 20:36:21 +0200
Received: from terrorfish.uni.stoert.net (terrorfish.uni.stoert.net [10.150.180.178])
	by spirit.zuhause.stoert.net (8.11.6/8.11.6) with ESMTP id g6GIaKQ01599;
	Tue, 16 Jul 2002 20:36:20 +0200 (CEST)
	(envelope-from corecode@corecode.ath.cx)
Received: from terrorfish.uni.stoert.net (localhost [127.0.0.1])
	by terrorfish.uni.stoert.net (8.12.5/8.12.4) with ESMTP id g6GIZIut019878;
	Tue, 16 Jul 2002 20:35:18 +0200 (CEST)
	(envelope-from corecode@terrorfish.uni.stoert.net)
Received: (from corecode@localhost)
	by terrorfish.uni.stoert.net (8.12.5/8.12.4/Submit) id g6GIZIPr019877;
	Tue, 16 Jul 2002 20:35:18 +0200 (CEST)
Message-Id: <200207161835.g6GIZIPr019877@terrorfish.uni.stoert.net>
Date: Tue, 16 Jul 2002 20:35:18 +0200 (CEST)
From: "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
Reply-To: "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To: FreeBSD-gnats-submit@freebsd.org
Cc: pat@freebsd.org
Subject: unbreak x11/wmcliphist
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40662
>Category:       ports
>Synopsis:       unbreak x11/wmcliphist
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pat
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 16 11:40:01 PDT 2002
>Closed-Date:    Tue Jul 16 15:38:21 PDT 2002
>Last-Modified:  Tue Jul 16 15:41:49 PDT 2002
>Originator:     Simon 'corecode' Schubert
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD terrorfish.uni.stoert.net 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sat Jul 13 17:16:24 CEST 2002 corecode@terrorfish.uni.stoert.net:/usr/obj/k7/usr/src/sys/TERRORFISH i386


	
>Description:
wmcliphist segfaults under certain conditions when reading the history file

this is caused by feeding an unterminated string to regexec(3)

upstream author has been notified seperately
	
>How-To-Repeat:
have something in ~/.wmcliphist.data and start wmcliphist
	
>Fix:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11/wmcliphist/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	17 Feb 2002 03:52:27 -0000	1.3
+++ Makefile	16 Jul 2002 18:25:29 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	wmcliphist
 PORTVERSION=	0.3
+PORTREVISION=	1
 CATEGORIES=	x11 windowmaker
 MASTER_SITES=	http://linux.nawebu.cz/wmcliphist/
 
Index: files/patch-history.c
===================================================================
RCS file: files/patch-history.c
diff -N files/patch-history.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-history.c	16 Jul 2002 18:20:21 -0000
@@ -0,0 +1,17 @@
+--- history.c.orig	Sun Dec 16 23:42:47 2001
++++ history.c	Tue Jul 16 20:14:38 2002
+@@ -123,12 +123,13 @@
+ 			break;
+ 		}
+ 
+-		buf = g_new0(gchar, len);
++		buf = g_new0(gchar, len + 1);
+ 		if (fread(buf, len, 1, f) != 1) {
+ 			g_free(buf);
+ 			tmp_errno = E_INVALID;
+ 			break;
+ 		}
++		buf[len] = '\0';
+ 
+ 		if (fread(&locked, sizeof(gint), 1, f) != 1) {
+ 			g_free(buf);
	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->pat 
Responsible-Changed-By: petef 
Responsible-Changed-When: Tue Jul 16 11:42:14 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40662 
State-Changed-From-To: open->closed 
State-Changed-By: pat 
State-Changed-When: Tue Jul 16 15:36:52 PDT 2002 
State-Changed-Why:  
Committed, Thanks! Nice catch :) 

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