From sub_0@unbreakable.homeunix.org  Tue Sep  9 21:29:35 2003
Return-Path: <sub_0@unbreakable.homeunix.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C72C216A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Sep 2003 21:29:35 -0700 (PDT)
Received: from unbreakable.homeunix.org (a213-22-141-83.netcabo.pt [213.22.141.83])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2C16043FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Sep 2003 21:29:35 -0700 (PDT)
	(envelope-from sub_0@unbreakable.homeunix.org)
Message-Id: <20030910042938.BB59A209C@suzy.unbreakable.homeunix.org>
Date: Wed, 10 Sep 2003 05:29:38 +0100 (WEST)
From: Mrio Freitas <sub_0@netcabo.pt>
Reply-To: Mrio Freitas <sub_0@netcabo.pt>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Port update: www/elinks Elinks crashes on frameset webpages
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56668
>Category:       ports
>Synopsis:       Port update: www/elinks Elinks crashes on frameset webpages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 09 21:30:11 PDT 2003
>Closed-Date:    Tue Oct 07 20:45:20 PDT 2003
>Last-Modified:  Mon Nov 24 14:10:22 PST 2003
>Originator:     Mrio Freitas
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD suzy.unbreakable.homeunix.org 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Tue Sep 9 23:39:24 WEST 2003 sub_0@suzy.unbreakable.homeunix.org:/usr/obj/usr/src/sys/SUZY i386


>Description:
I noticed elinks crashes most of the times after parsing a web
page which includes framesets (try loading a frameset with for example
rows="200,*"). This occurs because it tries to free some arbitrary block
of memory without checking if the previous functions returned errors.

>How-To-Repeat:
Try opening a webpage with some frameset including rows="200,*" for example.
>Fix:

Please, place this patch in www/elinks/files directory and update the 
port revision.

--- patch-parse.c begins here ---
--- src/document/html/parser.c.orig	Sat Sep  6 02:09:37 2003
+++ src/document/html/parser.c	Sat Sep  6 02:10:14 2003
@@ -2330,8 +2330,8 @@
 	parse_frame_widths(d, y, HTML_FRAME_CHAR_HEIGHT, &fp.yw, &fp.y);
 	fp.parent = html_top.frameset;
 	if (fp.x && fp.y) html_top.frameset = special_f(ff, SP_FRAMESET, &fp);
-	mem_free(fp.xw);
-	mem_free(fp.yw);
+	if (fp.x) mem_free(fp.xw);
+	if (fp.y) mem_free(fp.yw);
 
 free_cd:
 	mem_free(c);
--- patch-parse.c ends here ---


>Release-Note:
>Audit-Trail:

From: Edwin Groothuis <edwin@freebsd.org>
To: jharris@widomaker.com
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>
Subject: ports/56668 - Elinks crashes on frameset webpages
Date: Wed, 8 Oct 2003 08:49:03 +1000

 Hello,
 
 Please see ports/56668 regarding a patch for elinks:
 	http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/56668
 
 Do you approve this patch?
 If so, please reply and forward it to the authors of elinks too. 
 
 Edwin
 
 -- 
 Edwin Groothuis
 edwin@freebsd.org
 http://www.mavetju.org

From: Jason Harris <jharris@widomaker.com>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>
Cc: Mario Freitas <sub_0@netcabo.pt>,
	Edwin Groothuis <edwin@freebsd.org>
Subject: Re: ports/56668 - Elinks crashes on frameset webpages
Date: Tue, 7 Oct 2003 23:31:47 -0400

 --qyHYMwAXsHLOQihY
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Wed, Oct 08, 2003 at 08:49:03AM +1000, Edwin Groothuis wrote:
 
 > Please see ports/56668 regarding a patch for elinks:
 > 	http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/56668
 >=20
 > Do you approve this patch?
 
 Yes.
 
 --=20
 Jason Harris          | NIC:  JH329, PGP:  This _is_ PGP-signed, isn't it?
 jharris@widomaker.com | web:  http://keyserver.kjsl.com/~jharris/
 
 --qyHYMwAXsHLOQihY
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (FreeBSD)
 
 iD8DBQE/g4UhSypIl9OdoOMRAv9UAKCZOfs5ojbJU0ShxBNULCPGK2oDWwCgz5Cd
 1nd7TXeSt0UAMN8jM/fq+24=
 =0fXH
 -----END PGP SIGNATURE-----
 
 --qyHYMwAXsHLOQihY--
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Tue Oct 7 20:45:02 PDT 2003 
State-Changed-Why:  
Commited, thanks! 
Please can you forward this patch to the authors of the software too? 

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

From: Petr Baudis <pasky@ucw.cz>
To: Jason Harris <jharris@widomaker.com>
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>,
	Mario Freitas <sub_0@netcabo.pt>, Edwin Groothuis <edwin@freebsd.org>
Subject: Re: Re: ports/56668 - Elinks crashes on frameset webpages
Date: Mon, 24 Nov 2003 23:03:48 +0100

 --ibTvN161/egqYuK8
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Dear diary, on Wed, Oct 08, 2003 at 05:31:47AM CEST, I got a letter,
 where Jason Harris <jharris@widomaker.com> told me, that...
 > On Wed, Oct 08, 2003 at 08:49:03AM +1000, Edwin Groothuis wrote:
 >=20
 > > Please see ports/56668 regarding a patch for elinks:
 > > 	http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/56668
 > >=20
 > > Do you approve this patch?
 >=20
 > Yes.
 
 Thanks a lot. Slightly extended and applied to 0.4 (the last thing which
 was holding 0.4.3, actually ;).
 
 This is called fast, flexible and cooperative mainstream :^). Sorry it
 took so long.
 
 --=20
 =20
 				Petr "Pasky" Baudis
 =2E
 To get something done, a committee should consist of no more than three
 persons, two of them absent.
 =2E
 Stuff: http://pasky.ji.cz/
 
 --ibTvN161/egqYuK8
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.0.6 (GNU/Linux)
 Comment: For info see http://www.gnupg.org
 
 iD8DBQE/woBD0AcyGYIvwF8RAhGJAJ9+6SGWIUbTxbw2fsLAxANxcpj+HwCfWRL2
 97+32AwDpWTsx30UJseGl48=
 =ljgy
 -----END PGP SIGNATURE-----
 
 --ibTvN161/egqYuK8--
>Unformatted:
