3
0
forked from pool/findutils
findutils/findutils-init_stat_buf.patch

29 lines
967 B
Diff
Raw Normal View History

From: Philipp Thomas <pth@suse.de>
Date: 2012-11-13 11:58:38+01:00
Subject: Find by inode fails because of uninitialized structure
References: bnc#780928
Upstream: http://savannah.gnu.org/bugs/?37683
stat_buf in find.c(process_path) wasn't initialized and always contained the
inode no. of the first file. util.c(get_info) then thought it already
had the inode information and the following comparison in pred.c(pred_inum) in
fails of cause.
---
find/find.c | 1 +
1 file changed, 1 insertion(+)
Index: find/find.c
===================================================================
--- find/find.c.orig 2011-04-04 00:53:11.000000000 +0200
+++ find/find.c 2012-11-13 11:57:46.161844128 +0100
@@ -1131,6 +1131,7 @@ process_path (char *pathname, char *name
eval_tree = get_eval_tree ();
/* Assume it is a non-directory initially. */
+ memset(&stat_buf,'\0',sizeof(stat_buf));
stat_buf.st_mode = 0;
state.rel_pathname = name;
state.type = 0;