summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2010-06-05 11:32:31 +0000
committeredwin <edwin@FreeBSD.org>2010-06-05 11:32:31 +0000
commit4648b3610816f371dfb653bcb512b5192705f1f0 (patch)
tree0204b6af3c3bee630c492c41b6b8f3aff85be640 /usr.bin/calendar
parent387baf087f842f48a31472c0b70ce96117d69153 (diff)
downloadFreeBSD-src-4648b3610816f371dfb653bcb512b5192705f1f0.zip
FreeBSD-src-4648b3610816f371dfb653bcb512b5192705f1f0.tar.gz
Fix: when unable to parse the sequence string, erase everything.
Found with: Coverity Prevent(tm) CID: 7888
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r--usr.bin/calendar/locale.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/calendar/locale.c b/usr.bin/calendar/locale.c
index 57839ac..2fe3101 100644
--- a/usr.bin/calendar/locale.c
+++ b/usr.bin/calendar/locale.c
@@ -141,12 +141,12 @@ setnsequences(char *seq)
for (i = 0; i < 5; i++) {
nsequences[i].name = p;
if ((p = strchr(p, ' ')) == NULL) {
+ /* Oh oh there is something wrong. Erase! Erase! */
for (i = 0; i < 5; i++) {
nsequences[i].name = NULL;
nsequences[i].len = 0;
- return;
}
-
+ return;
}
*p = '\0';
p++;
OpenPOWER on IntegriCloud