From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 16 00:20:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B1163AF for ; Sun, 16 Feb 2014 00:20:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 331E31741 for ; Sun, 16 Feb 2014 00:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1G0K17Z095645 for ; Sun, 16 Feb 2014 00:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1G0K1ep095644; Sun, 16 Feb 2014 00:20:01 GMT (envelope-from gnats) Date: Sun, 16 Feb 2014 00:20:01 GMT Message-Id: <201402160020.s1G0K1ep095644@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: oliver Subject: Re: bin/186697: calendar(1): -A -B -t not working correctly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: oliver List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 00:20:01 -0000 The following reply was made to PR bin/186697; it has been noted by GNATS. From: oliver To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/186697: calendar(1): -A -B -t not working correctly Date: Sun, 16 Feb 2014 01:13:31 +0100 --MP_/wl6N.RZXvRZ5J9CjM=wVyF. Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline added a possible patch as attachment. --MP_/wl6N.RZXvRZ5J9CjM=wVyF. Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=patch.txt --- /usr/src/usr.bin/calendar/calendar.c 2014-01-16 21:36:28.000000000 +0100 +++ calendar.c 2014-02-16 01:07:06.000000000 +0100 @@ -96,10 +96,18 @@ case 'A': /* days after current date */ f_dayAfter = atoi(optarg); + if (f_dayAfter < 0) { + errno = EINVAL; + err(1, NULL); + } break; case 'B': /* days before current date */ f_dayBefore = atoi(optarg); + if (f_dayBefore < 0) { + errno = EINVAL; + err(1, NULL); + } break; case 'D': /* debug output of sun and moon info */ --MP_/wl6N.RZXvRZ5J9CjM=wVyF.--