Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jun 2010 11:32:31 +0000 (UTC)
From:      Edwin Groothuis <edwin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208827 - head/usr.bin/calendar
Message-ID:  <201006051132.o55BWVBG010383@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: edwin
Date: Sat Jun  5 11:32:31 2010
New Revision: 208827
URL: http://svn.freebsd.org/changeset/base/208827

Log:
  Fix: when unable to parse the sequence string, erase everything.
  
  Found with:   Coverity Prevent(tm)
  CID:          7888

Modified:
  head/usr.bin/calendar/locale.c

Modified: head/usr.bin/calendar/locale.c
==============================================================================
--- head/usr.bin/calendar/locale.c	Sat Jun  5 11:12:35 2010	(r208826)
+++ head/usr.bin/calendar/locale.c	Sat Jun  5 11:32:31 2010	(r208827)
@@ -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++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006051132.o55BWVBG010383>