NetBSD Problem Report #39627

From wiz@danbala.tuwien.ac.at  Thu Sep 25 10:15:04 2008
Return-Path: <wiz@danbala.tuwien.ac.at>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8B2EF63BCFC
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 25 Sep 2008 10:15:04 +0000 (UTC)
Message-Id: <20080925101502.03633390862@danbala.tuwien.ac.at>
Date: Thu, 25 Sep 2008 12:15:01 +0200 (MEST)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: calendar segfault
X-Send-Pr-Version: 3.95

>Number:         39627
>Category:       bin
>Synopsis:       calendar segfault
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 25 10:20:00 +0000 2008
>Closed-Date:    Tue Sep 30 05:55:29 +0000 2008
>Last-Modified:  Tue Sep 30 05:55:29 +0000 2008
>Originator:     Thomas Klausner
>Release:        NetBSD 4.99.72
>Organization:

>Environment:


Architecture: x86_64
Machine: amd64
>Description:
calendar segfaults on the following input line:
Monday 1500-1600 something
The backtrace is:
(gdb) r -f ~/calendar.test
Starting program: /usr/src/usr.bin/calendar/calendar -f ~/calendar.test

Program received signal SIGSEGV, Segmentation fault.
0x0000000000401cc3 in isnow (endp=0x7f7ffda0906c "1600 something")
    at calendar.c:297
297             day = cumdays[month] + day;
(gdb) bt
#0  0x0000000000401cc3 in isnow (endp=0x7f7ffda0906c "1600 something")
    at calendar.c:297
#1  0x00000000004018ea in cal () at calendar.c:199
#2  0x0000000000401867 in main (argc=0, argv=0x7f7fffffd558) at calendar.c:176
(gdb) p month
$1 = 1500

This is a regression -- it worked in 2.0.
>How-To-Repeat:
See above.
>Fix:


>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39627 CVS commit: src/usr.bin/calendar
Date: Tue, 30 Sep 2008 05:51:41 +0000 (UTC)

 Module Name:	src
 Committed By:	dholland
 Date:		Tue Sep 30 05:51:41 UTC 2008

 Modified Files:
 	src/usr.bin/calendar: calendar.c

 Log Message:
 If the parser scrapes up something it thinks is positionally a month, but
 is numerically out of range, do something reasonable instead of crashing.
 PR bin/39627.


 To generate a diff of this commit:
 cvs rdiff -r1.46 -r1.47 src/usr.bin/calendar/calendar.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 30 Sep 2008 05:55:29 +0000
State-Changed-Why:
fixed, thanks


>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.