Author: vangyzen
Date: Mon May 28 02:31:49 2018
New Revision: 334268
URL: https://svnweb.freebsd.org/changeset/base/334268

Log:
  fts_stat: fix buffer overrun on error path
  
  Reported by:  Coverity
  CID:          1375582
  MFC after:    1 week
  Sponsored by: Dell EMC

Modified:
  head/lib/libc/gen/fts-compat.c

Modified: head/lib/libc/gen/fts-compat.c
==============================================================================
--- head/lib/libc/gen/fts-compat.c      Mon May 28 02:10:35 2018        
(r334267)
+++ head/lib/libc/gen/fts-compat.c      Mon May 28 02:31:49 2018        
(r334268)
@@ -934,7 +934,7 @@ fts_stat(FTS *sp, FTSENT *p, int follow)
                }
        } else if (freebsd11_lstat(p->fts_accpath, sbp)) {
                p->fts_errno = errno;
-err:           memset(sbp, 0, sizeof(struct stat));
+err:           memset(sbp, 0, sizeof(*sbp));
                return (FTS_NS);
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to