Date: Sun, 16 Feb 2014 00:20:01 GMT From: oliver <oliver@beefrankly.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/186697: calendar(1): -A -B -t not working correctly Message-ID: <201402160020.s1G0K1ep095644@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/186697; it has been noted by GNATS.
From: oliver <oliver@beefrankly.org>
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.--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402160020.s1G0K1ep095644>
