You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is related to the following PR, I have some notices why:
If radare2 compiled with UNICODE support, WinAPI function names will be substituted as wide- version of them, like GetFullPathName -> GetFullPathNameW, CopyFile -> CopyFileW, etc.
at the following line
we pass utf8 string to the func, which expects wide string, and we say it will be MAX_PATH long, which means MAX_PATH * sizeof(wchar_t) which is wrong, heap gets corrupted. Note To support Unicode we have to use Wide-only WinAPI funcs, don't force to use ANSI ones!
r_str_argv_free has to be used to free files, cmd is not being freed -> here
expects wide-string there, so s and d have to be converted from utf8 to utf16 with help of appropriate function like r_sys_conv_utf8_to_utf16/r_sys_conv_utf8_to_utf16_l
Work environment
Expected behavior
Radare2 don't crash, copying of files works well even if they have unicode name or unicode characters in a full path to it
Actual behavior
Radare2 crashes because of heap corruption.
Steps to reproduce the behavior
Why
I think it is related to the following PR, I have some notices why:
If radare2 compiled with UNICODE support, WinAPI function names will be substituted as wide- version of them, like
GetFullPathName
->GetFullPathNameW
,CopyFile
->CopyFileW
, etc.at the following line
we pass utf8 string to the func, which expects wide string, and we say it will be MAX_PATH long, which means
MAX_PATH * sizeof(wchar_t)
which is wrong, heap gets corrupted. Note To support Unicode we have to use Wide-only WinAPI funcs, don't force to use ANSI ones!r_str_argv_free
has to be used to freefiles
,cmd
is not being freed -> hereCopyFileW
hereexpects wide-string there, so
s
andd
have to be converted from utf8 to utf16 with help of appropriate function liker_sys_conv_utf8_to_utf16/r_sys_conv_utf8_to_utf16_l
@GustavoLCR can you take a look?
The text was updated successfully, but these errors were encountered: