Eric Blake <[EMAIL PROTECTED]> writes:

>> +      if (do_chdir && dirpath[0] == '/')
>> +    {
>> +      /* POSIX says "//" might be special, so chdir to "//" if the
>> +         file name starts with exactly two slashes.  */
>> +      char const *root = "//" + (dirpath[1] != '/' || dirpath[2] == '/');
>
> Oops - buffer overflow bug.  dirpath[2] is past the end of the string on
> dirpath of "/",

If dirpath is "/", then dirpath[1] != '/' is true, so dirpath[2] isn't
evaluated.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to