Author: pfg
Date: Tue Dec 29 16:31:28 2015
New Revision: 292877
URL: https://svnweb.freebsd.org/changeset/base/292877

Log:
  pax: prevent possible buffer overflow
  
  Or at least quiet down some static analyzers about it.
  
  CID:  978835
  MFC after:    1 week
  Obtained from:        OpenBSD

Modified:
  head/bin/pax/pat_rep.c

Modified: head/bin/pax/pat_rep.c
==============================================================================
--- head/bin/pax/pat_rep.c      Tue Dec 29 16:29:42 2015        (r292876)
+++ head/bin/pax/pat_rep.c      Tue Dec 29 16:31:28 2015        (r292877)
@@ -878,7 +878,7 @@ rep_name(char *name, int *nlen, int prnt
         * (the user already saw that substitution go by)
         */
        pt = rephead;
-       (void)strcpy(buf1, name);
+       (void)strlcpy(buf1, name, sizeof(buf1));
        inpt = buf1;
        outpt = nname;
        endpt = outpt + PAXPATHLEN;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to