From owner-svn-src-all@FreeBSD.ORG Sat Jun 5 11:32:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A29B3106566C; Sat, 5 Jun 2010 11:32:31 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 924728FC0C; Sat, 5 Jun 2010 11:32:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55BWVLj010385; Sat, 5 Jun 2010 11:32:31 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55BWVBG010383; Sat, 5 Jun 2010 11:32:31 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201006051132.o55BWVBG010383@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 5 Jun 2010 11:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208827 - head/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 11:32:31 -0000 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++;