Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: glibc glob_filename() recurse call stack overflow (Re[2]: Bash Blues )

From: Ali Saifullah Khan <saifullah(at)gamebox.net>
Date: Sun Feb 16 2003 - 04:16:56 EST


file : bash-VERSION/lib/glob/glob.c
char ** glob_filename(pathname)
char * pathname;
{
.
.

	{
                directory_len = (filename - pathname) + 1;
                directory_name = (char *) alloca (directory_len + 1);

                bcopy (pathname, directory_name, directory_len);
                directory_name[directory_len] = '\0';
                ++filename;
        }

.
.

As Vladimir pointed out, instead of copying a large source string of length 'directory_len' why not simply copy strlen(pathname) bytes to directory_name. Would this produce a fix ?....I'm not an expert when it comes to C, but so far this is what i conclude.

Regards.

  • application/pgp-signature attachment: stored
Received on Sun Feb 16 13:15:41 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:38 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library