cygwin_conv_path with size 0

Jeremy Drake cygwin@jdrake.com
Tue Apr 29 05:45:00 GMT 2025


I was just describing cygwin_conv_path on a rust issue
(https://github.com/rust-lang/backtrace-rs/pull/704).  I was saying that
the pointer `to` is not accessed when `size` is 0, but it turns out on
circa line 4022 in path.cc

to = (void *) wcpcpy ((wchar_t *) to, ro_u_globalroot.Buffer);

This is before `size` is checked and lsiz returned if it was zero, or
ENOSPC set if size is too small, circa line 4060.  This seems like a bug
to me.



More information about the Cygwin mailing list