bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor bug in fts cycle-detection code


From: Jim Meyering
Subject: minor bug in fts cycle-detection code
Date: Mon, 09 Oct 2006 14:16:11 +0200

I found what appears to be a probabilistically harmless bug in
fts-related code.  By that, I mean the odds of the bug resulting
in a malfunction (false-positive cycle detection) would seem to
be very small.

I've checked in this fix:

2006-10-09  Jim Meyering  <address@hidden>

        * fts-cycle.c (leave_dir): When "leaving" a top level directory due
        to FTS_SKIP, don't copy the parent's uninitialized dev/ino values.
        Trigger with e.g., mkdir d && valgrind ./chmod u+rwx d d

Index: lib/fts-cycle.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/fts-cycle.c,v
retrieving revision 1.7
diff -u -r1.7 fts-cycle.c
--- lib/fts-cycle.c     8 Oct 2006 07:24:56 -0000       1.7
+++ lib/fts-cycle.c     9 Oct 2006 12:14:44 -0000
@@ -140,7 +140,7 @@
   else
     {
       FTSENT *parent = ent->fts_parent;
-      if (parent != NULL)
+      if (parent != NULL && 0 <= parent->fts_level)
        CYCLE_CHECK_REFLECT_CHDIR_UP (fts->fts_cycle.state,
                                      *(parent->fts_statp), *st);
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]