> Date: Fri, 18 Aug 2000 02:08:34 +0200
> From: Josip Rodin <[EMAIL PROTECTED]>
> 
> ----- Forwarded message from "H. Nanosecond" <[EMAIL PROTECTED]> -----
> 
> Subject: Bug#68937: info '(.)any'
> Reply-To: "H. Nanosecond" <[EMAIL PROTECTED]>,
>         [EMAIL PROTECTED]
> X-Debian-PR-Package: texinfo
> Date: Fri, 11 Aug 2000 03:38:21 -0400 (EDT)
> To: [EMAIL PROTECTED]
> From: "H. Nanosecond" <[EMAIL PROTECTED]>
> 
> Package: texinfo
> Version: 4.0-4
> 
> Hello,
> info '(.)any' gets the program stuck.

Thank you for your report.  This is because Info enters an infinite
recursion, due to a feature that if the specified file is actually a
directory, the reader looks into that directory.  That is, for
example, "info -f foo" where `foo' is a directory, will look inside
that directory for a file named `foo', recursively.

Here's a patch to solve the problem:

2000-08-21  Eli Zaretskii  <[EMAIL PROTECTED]>

        * info/filesys.c (info_file_in_path): Reject FILENAME if it is
        empty, or ".", or "..".

--- info/filesys.c~0    Mon Jul  5 23:42:04 1999
+++ info/filesys.c      Mon Aug 21 14:54:52 2000
@@ -163,6 +163,11 @@
   char *temp_dirname;
   int statable, dirname_index;
 
+  /* Reject ridiculous cases up front, to prevent infinite recursion
+     later on.  E.g., someone might say "info '(.)foo'"...  */
+  if (!*filename || STREQ (filename, ".") || STREQ (filename, ".."))
+    return NULL;
+
   dirname_index = 0;
 
   while ((temp_dirname = extract_colon_unit (path, &dirname_index)))

Reply via email to