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++;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to