evilpie / filepath

Get the filesystem path of a file
Apache License 2.0
12 stars 2 forks source link

Windows code is probably still not quite right #4

Open evilpie opened 6 years ago

evilpie commented 6 years ago

If the path length changes (file move?) between the GetFinalPathNameByHandleW calls we are going to be in trouble. I feel like I should just copy the fill_utf16_buf code in rust.

evilpie commented 6 years ago

I think 22bdbbf2546f47e7a12d1874284900a46f66ac36 should be enough to at least make this method safe by adding the len2 >= len check. Now we fail when the path length increases between the two calls.