Author: pfg
Date: Wed Jan  6 16:35:30 2016
New Revision: 293239
URL: https://svnweb.freebsd.org/changeset/base/293239

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

Modified:
  stable/9/bin/pax/pat_rep.c

Modified: stable/9/bin/pax/pat_rep.c
==============================================================================
--- stable/9/bin/pax/pat_rep.c  Wed Jan  6 16:32:39 2016        (r293238)
+++ stable/9/bin/pax/pat_rep.c  Wed Jan  6 16:35:30 2016        (r293239)
@@ -880,7 +880,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-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to