ports/110018: graphics/sdl_image: SIGSEGV from IMG_ReadXPMFromArray()

Eric P. Scott eps+pbug0703 at ana.com
Tue Mar 6 23:30:06 UTC 2007


>Number:         110018
>Category:       ports
>Synopsis:       graphics/sdl_image: SIGSEGV from IMG_ReadXPMFromArray()
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 06 23:30:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Eric P. Scott
>Release:        FreeBSD 6.2-RELEASE-p2 i386
>Organization:
ana-systems, Inc.
>Environment:
System: FreeBSD sixofone 6.2-RELEASE-p2 FreeBSD 6.2-RELEASE-p2 #0: Tue Feb 27 22:41:06 UTC 2007 root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
>Description:
While attempting to port lcdtest to FreeBSD, I seem to have
stumbled upon a NULL pointer dereference "land mine" inside
SDL_image.

[lcdtest-1.0.2/lcdtest.c:116] 
  help_font_surface = IMG_ReadXPMFromArray (help_font_xpm);

[SDL_image-1.2.5/IMG_xpm.c:479-482]
SDL_Surface *IMG_ReadXPMFromArray(char **xpm)
{
	return load_xpm(xpm, NULL);
}

[SDL_image-1.2.5/IMG_xpm.c:308-311]
/* read XPM from either array or RWops */
static SDL_Surface *load_xpm(char **xpm, SDL_RWops *src)
{
	int start;

[SDL_image-1.2.5/IMG_xpm.c:329]
	start = SDL_RWtell(src);

[SDL/SDL_rwops.h:110]
#define SDL_RWtell(ctx)			(ctx)->seek(ctx, 0, RW_SEEK_CUR)
>How-To-Repeat:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	sysutils/lcdtest
#	sysutils/lcdtest/Makefile
#	sysutils/lcdtest/distinfo
#	sysutils/lcdtest/pkg-descr
#
echo c - sysutils/lcdtest
mkdir -p sysutils/lcdtest > /dev/null 2>&1
echo x - sysutils/lcdtest/Makefile
sed 's/^X//' >sysutils/lcdtest/Makefile << 'END-of-sysutils/lcdtest/Makefile'
X# New ports collection makefile for:	lcdtest
X# Date created:			6 Mar 2007
X# Whom:				Your Name Here <yourname at example.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	lcdtest
XPORTVERSION=	1.02
XCATEGORIES=	sysutils
XMASTER_SITES=	http://www.brouhaha.com/%7Eeric/software/lcdtest/download/
X
XMAINTAINER=	ports at FreeBSD.org
XCOMMENT=	LCD monitor test pattern generator
X
XBUILD_DEPENDS=	pngtopnm:${PORTSDIR}/graphics/netpbm
X
XUSE_GMAKE=	yes
XUSE_SDL=	sdl image
X
XMAN1=		lcdtest.1
X.if !defined(NOPORTDOCS)
XPORTDOCS=	README
X.endif
XMAKE_ENV+=	CPPFLAGS="`sdl-config --cflags`" LOADLIBES="`sdl-config --libs`"
XMAKE_ARGS=	-o SDL/SDL.h -o SDL/SDL_image.h CFLAGS="${CFLAGS}"
XPLIST_FILES=	bin/lcdtest
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/lcdtest ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/lcdtest.1 ${MAN1PREFIX}/man/man1
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
X.endif
X
X.include	<bsd.port.mk>
END-of-sysutils/lcdtest/Makefile
echo x - sysutils/lcdtest/distinfo
sed 's/^X//' >sysutils/lcdtest/distinfo << 'END-of-sysutils/lcdtest/distinfo'
XMD5 (lcdtest-1.02.tar.gz) = faa33d39a895be1987cf981a8e8cede7
XSHA256 (lcdtest-1.02.tar.gz) = 996e6da43b2d0c1e4a5cb49160e6f6a1c40326f378e38abeeccb1f286d7cb748
XSIZE (lcdtest-1.02.tar.gz) = 29058
END-of-sysutils/lcdtest/distinfo
echo x - sysutils/lcdtest/pkg-descr
sed 's/^X//' >sysutils/lcdtest/pkg-descr << 'END-of-sysutils/lcdtest/pkg-descr'
Xlcdtest is a utility to display LCD monitor test patterns.  It may be
Xuseful for adjusting the pixel clock frequency and phase on LCD
Xmonitors when using analog inputs, and for finding pixels that are
Xstuck on or off.
X
XWWW: http://www.brouhaha.com/%7Eeric/software/lcdtest/
END-of-sysutils/lcdtest/pkg-descr
exit

>Fix:
None yet.

Bonus points for fixing the problem and committing a working lcdtest port.  ;-)
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list