Subject: pkg/14745: gnapster segv - fail to check return value
To: None <gnats-bugs@gnats.netbsd.org>
From: john heasley <heas@shrubbery.net>
List: netbsd-bugs
Date: 11/27/2001 06:42:49
>Number:         14745
>Category:       pkg
>Synopsis:       gnapster segv - fail to check return value
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 26 22:43:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     john heasley
>Release:        NetBSD 1.5X
>Organization:
	
>Environment:
	NetBSD roome 1.5Y NetBSD 1.5Y (heas) #0: Mon Oct  8 18:07:29 UTC 2001     root@roome:/home/src/sys/arch/i386/compile/heas i386
System: NetBSD roome 1.5Y NetBSD 1.5Y (heas) #0: Mon Oct  8 18:07:29 UTC 2001     root@roome:/home/src/sys/arch/i386/compile/heas i386
Architecture: i386
Machine: i396
>Description:
	remove_slash() fails to check the return value of strrchr(),
	leading to a segv.
>How-To-Repeat:
	i'm not sure exactly what triggered it, but suspect it was related
	to missing download directory.
>Fix:
	gnapster 5.0 src/upload.c line 265 should be

		   if (ptr && !ptr[1])
	rather than
		   if (!ptr[1])
>Release-Note:
>Audit-Trail:
>Unformatted: