From nobody@FreeBSD.org  Wed Sep 14 22:07:32 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0FBE816A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Sep 2005 22:07:32 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D3A6643D45
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Sep 2005 22:07:31 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j8EM7VFQ098068
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Sep 2005 22:07:31 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j8EM7Vio098067;
	Wed, 14 Sep 2005 22:07:31 GMT
	(envelope-from nobody)
Message-Id: <200509142207.j8EM7Vio098067@www.freebsd.org>
Date: Wed, 14 Sep 2005 22:07:31 GMT
From: Nick Fishman <kwlogical@bellsouth.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: fly 2.0 segfaults when using "copy" function to copy in gif digits for a counter.
X-Send-Pr-Version: www-2.3

>Number:         86137
>Category:       ports
>Synopsis:       graphics/fly 2.0 segfaults when using "copy" function to copy in gif digits for a counter.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lawrance
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 14 22:10:12 GMT 2005
>Closed-Date:    Mon Oct 17 14:01:53 GMT 2005
>Last-Modified:  Mon Oct 17 14:01:53 GMT 2005
>Originator:     Nick Fishman
>Release:        5.4
>Organization:
N/A
>Environment:
FreeBSD argon.bsdlogical.com 5.4-STABLE FreeBSD 5.4-STABLE #0: Sun Jul 10 17:23:22 EDT 2005     bsdlogical@argon.bsdlogical.com:/usr/src/sys/i386/compile/GENERIC  i386

>Description:
      When using the "copy" function inside a script file for fly, fly dumps core and exits with a segmentation fault. Other functions appear to be working, but further testing is needed.

      This problem was initially mentioned on the ports@freebsd.org mailing list by Warren Block. It affects his FreeBSD 4.11 system, as well.
>How-To-Repeat:
      Prepare a sample GIF file, about 32x32 pixels in size. Generate the following script file:
new
size 26,20
copy 0,0,-1,-1,-1,-1,/path/to/your.gif
copy 13,0,-1,-1,-1,-1,/path/to/your.gif

Run "fly -i scriptfile". It will dump core.
>Fix:
      Unknown.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lawrance 
Responsible-Changed-By: lawrance 
Responsible-Changed-When: Thu Sep 15 04:45:26 GMT 2005 
Responsible-Changed-Why:  
Take it 

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

From: Simon Barner <barner@FreeBSD.org>
To: Nick Fishman <kwlogical@bellsouth.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/86137: fly 2.0 segfaults when using "copy" function to copy in gif digits for a counter.
Date: Thu, 15 Sep 2005 14:49:14 +0200

 The lastest version of graphics/fly seems to be 2.0.0:
 http://martin.gleeson.com/fly/
 
 Since this port has no maintainer, please try to do the update to see if
 the bug is fixed there, and submit it as an follow-up to this PR.
 
 If you have questions, feel free to ask on the freebsd-ports@ mailing
 list, but please consult the Porter's Handbook first.

From: Simon Barner <barner@FreeBSD.org>
To: Nick Fishman <kwlogical@bellsouth.net>, lawrance@FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/86137: fly 2.0 segfaults when using "copy" function to copy in gif digits for a counter.
Date: Thu, 15 Sep 2005 14:53:06 +0200

 I did not two things:
  - fly is already at 2.0
  - Sam Lawrance began working on this PR five minutes before me :-)
 
 Please disregard my last email.
 
 Simon

From: Warren Block <wblock@wonkity.com>
To: bug-followup@FreeBSD.org, kwlogical@bellsouth.net
Cc:  
Subject: Re: ports/86137: graphics/fly 2.0 segfaults when using "copy" function
 to copy in gif digits for a counter.
Date: Fri, 16 Sep 2005 08:19:36 -0600

 As reported by Mario Hoerich:
 
 The problem here seems to be the image-type:  the default type
 is set to PNG and the program seems to never check the type of
 the image loaded with copy.  As a result, the gif file runs through
 
 1271    img_file = gdImageCreateFromPng(img_to_copy);
                                     ^^^
 That returns an unchecked NULL, which is dereferenced just
 a couple of lines down:
 
 1298    arg[4] = img_file->sx;
 
 Program received signal SIGSEGV, Segmentation fault.
 0x0804cf46 in copy_to_img (infile=0x281a22c0, img=0x8053000, resize=0)
     at fly.c:1298

From: wblock@wonkity.com
To: bug-followup@FreeBSD.org, kwlogical@bellsouth.net
Cc:  
Subject: Re: ports/86137: graphics/fly 2.0 segfaults when usi
Date: Fri, 16 Sep 2005 08:22:06 -0600 (MDT)

 As reported by Mario Hoerich <spambox@MHoerich.de>:
 
 The problem here seems to be the image-type:  the default type
 is set to PNG and the program seems to never check the type of
 the image loaded with copy.  As a result, the gif file runs through
 
 1271    img_file = gdImageCreateFromPng(img_to_copy);
                                     ^^^
 That returns an unchecked NULL, which is dereferenced just
 a couple of lines down:
 
 1298    arg[4] = img_file->sx;
 
 Program received signal SIGSEGV, Segmentation fault.
 0x0804cf46 in copy_to_img (infile=0x281a22c0, img=0x8053000, resize=0)
     at fly.c:1298
State-Changed-From-To: open->closed 
State-Changed-By: lawrance 
State-Changed-When: Mon Oct 17 13:59:45 GMT 2005 
State-Changed-Why:  
An extra check was added to fail gracefully.  As before, 
you must still supply the file type in the script file 
for fly to work correctly. 

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