[Python-bugs-list] [ python-Bugs-500705 ] os.listdir("") bug on Windows

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Mar 2002 12:52:41 -0800


Bugs item #500705, was opened at 2002-01-08 03:28
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=500705&group_id=5470

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Neil Hodgson (nyamatongwe)
Assigned to: Nobody/Anonymous (nobody)
>Summary: os.listdir("") bug on Windows

Initial Comment:
   There is an out-of-bounds error on Windows when 
using os.listdir("") which could result in 
indeterminate behaviour. After parsing the args, it
does
 ch = namebuf[len-1];
   which indexes before the array as len = 0.
   Possibly change this to
 ch = (len > 0) ? namebuf[len-1] : '\0';


----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2002-03-22 20:52

Message:
Logged In: YES 
user_id=35752

Fixed in posixmodule.c 2.226.  Untested but I'm sure
Tim will scream if the Windows build breaks.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=500705&group_id=5470