Hi,

there seems to be a bug in the function parse_samefile() in find/parser.c... if 
I am not mistaken, after the call to collect_arg_stat_info(), argv[*arg_ptr] 
becomes NULL.  I enclose a little patch to fix this problem.

Roberto Reale
[email protected]
--- findutils/find/parser.c	2010-04-05 13:18:59.000000000 +0200
+++ findutils-new/find/parser.c	2010-04-09 12:07:27.000000000 +0200
@@ -2414,7 +2414,7 @@
        * symbolic link in between out call to stat and
        * the call to open.
        */
-      fd = open (argv[*arg_ptr], openflags);
+      fd = open (filename, openflags);
 
       if (fd >= 0)
 	{
@@ -2423,7 +2423,7 @@
 	   */
 	  if (0 != fstat (fd, &fst))
 	    {
-	      fatal_file_error (argv[*arg_ptr]);
+	      fatal_file_error (filename);
 	    }
 	  else
 	    {
@@ -2432,8 +2432,8 @@
 	       * open, fst may contain the stat information for the
 	       * destination of the link, not the link itself.
 	       */
-	      if ((*options.xstat) (argv[*arg_ptr], &st))
-		fatal_file_error (argv[*arg_ptr]);
+	      if ((*options.xstat) (filename, &st))
+		fatal_file_error (filename);
 
 	      if ((options.symlink_handling == SYMLINK_NEVER_DEREF)
 		  && (!options.open_nofollow_available))

Reply via email to