NetBSD Problem Report #11685

Received: (qmail 9706 invoked from network); 10 Dec 2000 23:56:24 -0000
Message-Id: <200012110211.eBB2Bef00784@free-1-26.dyn.nic.fi>
Date: Mon, 11 Dec 2000 02:11:40 GMT
From: petri.koistinen@iki.fi
To: gnats-bugs@gnats.netbsd.org
Subject: grfconfig checks only that first line in mode definion file is valid
X-Send-Pr-Version: 3.95

>Number:         11685
>Category:       port-amiga
>Synopsis:       grfconfig checks only that first line in mode definition file is valid
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amiga-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 10 23:57:00 +0000 2000
>Closed-Date:    Wed Jan 24 19:38:21 +0000 2001
>Last-Modified:  Wed Jan 24 19:38:21 +0000 2001
>Originator:     Petri Koistinen
>Release:        1.5BETA2.5
>Organization:
>Environment:
System: NetBSD kissakala 1.5_BETA2 NetBSD 1.5_BETA2 (INSTWDCPCM) #13:
Wed Nov 15 04:42:09 MET 2000 is@jocelyn:/var/obj/kernel/INSTWDCPCM amiga

>Description:
grfconfig does only error checking on first line of mode definition file.

>How-To-Repeat:
bash-2.03$ cat foobar.conf
1 24499996 640 400 8 640 680 744 736 399 400 403
2 24499996 640 400 8 640 680 744 736 399 400 403 420 default

bash-2.03$ cat barfoo.conf
1 24499996 640 400 8 640 680 744 736 399 400 403 420 default
2 24499996 640 400 8 640 680 744 736 399 400 403

bash-2.03$ grfconfig /dev/grf3 foobar.conf
grfconfig: too few values in mode definition file:
 1 24499996 640 400 8 640 680 744 736 399 400 403

bash-2.03$ grfconfig /dev/grf3 barfoo.conf
Segmentation fault (core dumped)

bash-2.03$ gdb -core grfconfig.core `which grfconfig`
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "m68k--netbsd"...(no debugging symbols found)...
Core was generated by `grfconfig'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/ld.so...(no debugging symbols
found)...done
.
Reading symbols from /usr/lib/libc.so.12.62.1...(no debugging symbols
found).
..
done.
#0  0x806f97c in strtol ()
(gdb) where
#0  0x806f97c in strtol ()
#1  0x806f118 in atoi ()
#2  0x2f52 in main ()
#3  0x20e0 in __start ()
(gdb) quit


>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: is 
State-Changed-When: Mon Jan 22 12:59:37 PST 2001 
State-Changed-Why:  
Seems to be the sanity check around line 175. 
cps[13] == NULL is only a valid check for exactly 12 values, unless cps[] is  
freshly zeroed. 
The correct test should be i < 14. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: is 
State-Changed-When: Wed Jan 24 11:37:53 PST 2001 
State-Changed-Why:  
Submitter says the fix works for him, too. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.