Date: Sun, 13 Aug 2000 13:10:26 +1000 (EST) From: andrew@ugh.net.au To: FreeBSD-gnats-submit@freebsd.org Subject: bin/20569: libvgl tries to free global array Message-ID: <20000813031026.8DA9CA84B@starbug.ugh.net.au>
next in thread | raw e-mail | index | archive | help
>Number: 20569
>Category: bin
>Synopsis: libvgl tries to free global array
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Aug 12 20:10:00 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000813031026.8DA9CA84B>
