[Python-Dev] os.listdir("") bug on Windows

Neil Hodgson nhodgson@bigpond.net.au
Tue, 8 Jan 2002 14:04:01 +1100


   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';

   Neil