From andrew@ugh.net.au  Sat Aug 12 20:09:24 2000
Return-Path: <andrew@ugh.net.au>
Received: from starbug.ugh.net.au (starbug.ugh.net.au [203.31.238.37])
	by hub.freebsd.org (Postfix) with ESMTP id F2A9637BB0B
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Aug 2000 20:09:22 -0700 (PDT)
	(envelope-from andrew@ugh.net.au)
Received: by starbug.ugh.net.au (Postfix, from userid 1000)
	id 8DA9CA84B; Sun, 13 Aug 2000 13:10:26 +1000 (EST)
Message-Id: <20000813031026.8DA9CA84B@starbug.ugh.net.au>
Date: Sun, 13 Aug 2000 13:10:26 +1000 (EST)
From: andrew@ugh.net.au
Reply-To: andrew@ugh.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: libvgl tries to free global array
X-Send-Pr-Version: 3.2

>Number:         20569
>Category:       bin
>Synopsis:       libvgl tries to free global array
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 12 20:10:00 PDT 2000
>Closed-Date:    Wed May 30 00:49:35 PDT 2001
>Last-Modified:  Wed May 30 00:52:20 PDT 2001
>Originator:     Andrew
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
UgH!
>Environment:

4.1-STABLE a week or so old

>Description:

I have a program trying to use libvgl. When VGLInit is called it calls
VGLTextSetFontFile((byte *)0). This causes VGLTextFont to point to some
allocated memory and VGLTextFont->BitmapArray to point to VGLFont which is a
global array defined in text.c.

Later, when my program calls VGLTextSetFontFile VGLTextSetFontFile tries to
free this array causing "free(): warning: junk pointer, too high to make sense"

Also there are a few style(9) things...specifically the use of (type *)0 rather
than NULL.

>How-To-Repeat:

if (VGLInit(VIDEO_MODE) != 0) {
        err(EX_UNAVAILABLE, "failed to initialise video display");
}

if (VGLTextSetFontFile(FONT) != 0) {
	reset_and_err(EX_UNAVAILABLE, "failed to load font (%s)", FONT);
}

>Fix:

I guess a flag needs to be set to indicate if the builtin font is being used
or a user set font. There may be a better way.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Aug 14 03:32:15 PDT 2000 
Responsible-Changed-Why:  
Over to the maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20569 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Wed May 30 00:49:35 PDT 2001 
State-Changed-Why:  
fixed  in current 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=20569 
>Unformatted:
