Author: eadler
Date: Wed Dec 11 14:54:58 2013
New Revision: 259219
URL: http://svnweb.freebsd.org/changeset/base/259219

Log:
  calendar(1): use strlcpy instead of strncpy
  
  use strlcpy instead of strncpy which avoids non-null-termination if the 
string is MAXPATHLEN bytes or longer.

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

Modified: head/usr.bin/calendar/calcpp.c
==============================================================================
--- head/usr.bin/calendar/calcpp.c      Wed Dec 11 13:20:32 2013        
(r259218)
+++ head/usr.bin/calendar/calcpp.c      Wed Dec 11 14:54:58 2013        
(r259219)
@@ -133,7 +133,7 @@ tokenscpp(char *buf, char *string)
                s = p;
                while(!isspace((unsigned char)*p))
                        p++;
-               strncpy(string, s, MAXPATHLEN);
+               strlcpy(string, s, MAXPATHLEN);
                return(T_DEFINE);
        } else if ((p = strstr(buf, "#ifndef")) != NULL) {
                p += 8;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to