From vd@datamax.bg  Wed Nov  9 13:57:14 2005
Return-Path: <vd@datamax.bg>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7DAD516A41F;
	Wed,  9 Nov 2005 13:57:14 +0000 (GMT)
	(envelope-from vd@datamax.bg)
Received: from jengal.datamax.bg (jengal.datamax.bg [82.103.104.21])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A61A843D46;
	Wed,  9 Nov 2005 13:57:13 +0000 (GMT)
	(envelope-from vd@datamax.bg)
Received: from qlovarnika.bg.datamax (qlovarnika.bg.datamax [192.168.10.2])
	by jengal.datamax.bg (Postfix) with SMTP id 88F2AB830;
	Wed,  9 Nov 2005 15:57:12 +0200 (EET)
Received: (nullmailer pid 44564 invoked by uid 1002);
	Wed, 09 Nov 2005 13:57:12 -0000
Message-Id: <20051109135712.GA44313@qlovarnika.bg.datamax>
Date: Wed, 9 Nov 2005 15:57:12 +0200
From: Vasil Dimov <vd@datamax.bg>
Reply-To: vd@datamax.bg
To: FreeBSD-gnats-submit@freebsd.org
Cc: obrien@FreeBSD.org, me@cs.hmc.edu, roessler@does-not-exist.org
Subject: [patch] textproc/urlview segfaults on amd64
X-Send-Pr-Version: 3.113

>Number:         88729
>Category:       ports
>Synopsis:       [patch] textproc/urlview segfaults on amd64
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 09 14:00:26 GMT 2005
>Closed-Date:    Wed Nov 30 12:01:08 GMT 2005
>Last-Modified:  Wed Nov 30 12:01:08 GMT 2005
>Originator:     Vasil Dimov
>Release:        FreeBSD 6.0-STABLE amd64
>Organization:
DataMax
>Environment:

System: FreeBSD qlovarnika.bg.datamax 6.0-STABLE FreeBSD 6.0-STABLE #0: Tue Nov  8 09:24:59 EET 2005     root@qlovarnika.bg.datamax:/usr/obj/usr/src/sys/QLOVARNIKA  amd64

>Description:

textproc/urlview uses its internal function char *quote() without it being
declared so its return type defaults to int, which results in a segmentation
fault on machines where sizeof(int) != sizeof(char *)

>How-To-Repeat:

$ uname -m
amd64
$ cd /usr/ports/textproc/urlview
$ make install clean
$ echo 'http://www.a.b' |urlview
<enter>
<enter>
Segmentation fault: 11 (core dumped)
$

>Fix:

--- urlview_quote.diff begins here ---
diff -urN --exclude=CVS --exclude=work --exclude=README.html urlview.orig/Makefile urlview/Makefile
--- urlview.orig/Makefile	Wed Oct 15 19:59:12 2003
+++ urlview/Makefile	Wed Nov  9 15:39:13 2005
@@ -8,7 +8,7 @@
 
 PORTNAME=	urlview
 PORTVERSION=	0.9
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	textproc www
 MASTER_SITES=	ftp://ftp.mutt.org/mutt/contrib/ \
 		ftp://ftp.sunsite.auc.dk/pub/mail/mutt/contrib/ \
diff -urN --exclude=CVS --exclude=work --exclude=README.html urlview.orig/files/patch-urlview.c urlview/files/patch-urlview.c
--- urlview.orig/files/patch-urlview.c	Thu Jan  1 02:00:00 1970
+++ urlview/files/patch-urlview.c	Wed Nov  9 15:35:53 2005
@@ -0,0 +1,11 @@
+--- urlview.c.orig	Wed Nov  9 15:34:39 2005
++++ urlview.c	Wed Nov  9 15:35:06 2005
+@@ -46,6 +46,8 @@
+ #include <rx/rxposix.h>
+ #endif
+ 
++#include "quote.h"
++
+ #define DEFAULT_REGEXP "(((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>\"]+|(www|web|w3)\\.[-a-z0-9.]+)[^' \t.,;<>\"\\):]"
+ #define DEFAULT_COMMAND "url_handler.sh %s"
+ #define SYSTEM_INITFILE "/usr/local/etc/urlview.conf"
--- urlview_quote.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->obrien 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Nov 9 14:03:13 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88729 
State-Changed-From-To: open->closed 
State-Changed-By: flz 
State-Changed-When: Wed Nov 30 12:01:07 GMT 2005 
State-Changed-Why:  
Committed. Thanks! 

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