bin/186697: calendar(1): -A -B -t not working correctly
oliver
oliver at beefrankly.org
Sun Feb 16 00:20:01 UTC 2014
The following reply was made to PR bin/186697; it has been noted by GNATS.
From: oliver <oliver at beefrankly.org>
To: bug-followup at 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.--
More information about the freebsd-bugs
mailing list