Author: truckman
Date: Mon May 23 05:21:55 2016
New Revision: 300459
URL: https://svnweb.freebsd.org/changeset/base/300459

Log:
  MFC r299953
  
  Fix an off by one error to avoid overflowing rp[].
  
  Reported by:  Coverity
  CID:          1007579

Modified:
  stable/10/usr.sbin/makefs/mtree.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/makefs/mtree.c
==============================================================================
--- stable/10/usr.sbin/makefs/mtree.c   Mon May 23 05:19:37 2016        
(r300458)
+++ stable/10/usr.sbin/makefs/mtree.c   Mon May 23 05:21:55 2016        
(r300459)
@@ -150,7 +150,7 @@ mtree_file_path(fsnode *node)
 
        depth = 0;
        rp[depth] = node->name;
-       for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH;
+       for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH - 1;
             pnode = pnode->parent) {
                if (strcmp(pnode->name, ".") == 0)
                        break;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"

Reply via email to