From 4648b3610816f371dfb653bcb512b5192705f1f0 Mon Sep 17 00:00:00 2001 From: edwin Date: Sat, 5 Jun 2010 11:32:31 +0000 Subject: [PATCH] Fix: when unable to parse the sequence string, erase everything. Found with: Coverity Prevent(tm) CID: 7888 --- usr.bin/calendar/locale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/calendar/locale.c b/usr.bin/calendar/locale.c index 57839acee1df..2fe310117599 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++;