bug-findutils
[Top][All Lists]
Advanced

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

[PATCH 2/3] find: avoid using undefined statbuf


From: Jim Meyering
Subject: [PATCH 2/3] find: avoid using undefined statbuf
Date: Fri, 26 Dec 2008 18:31:34 +0100

* find/ftsfind.c (consider_visiting): Use local variable, mode,
rather than possibly undefined statbuf.st_mode.
---
Without this, and with some soon-to-be-posted changes to fts.c,
find would read from the uninitialized statbuf.st_mode.
But "mode" is already guaranteed to be set in the preceding code.

 find/ftsfind.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/find/ftsfind.c b/find/ftsfind.c
index f14b2af..b3d44f8 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -498,7 +498,7 @@ consider_visiting(FTS *p, FTSENT *ent)

   /* examine this item. */
   ignore = 0;
-  isdir = S_ISDIR(statbuf.st_mode)
+  isdir = S_ISDIR(mode)
     || (FTS_D  == ent->fts_info)
     || (FTS_DP == ent->fts_info)
     || (FTS_DC == ent->fts_info);
--
1.6.1.302.gccd4d




reply via email to

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