[GH-ISSUE #440] client crushed when local user profile path contains non-ascii characters #135

Open
opened 2026-10-13 20:13:28 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @OlkhinAG on GitHub (Nov 27, 2023).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/440

Describe the bug
Client crash when installing any service on server.
event log shows error code 0xc0000409

Spotted on windows 10.
Tracked it to sftpFileCopy function, exception raises on accessing localPath.
Problem is that QTemporaryFile created in user profile and when path converted to std::string it makes it utf8, but std file functions on windows do not understand uft8.

replaced line

error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName().toStdString(), remotePath.toStdString(),
                                     "non_desc");

with

error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName().toLocal8Bit().toStdString(), remotePath.toStdString(),
                                     "non_desc");

in \client\core\servercontroller.cpp and error gone

maybe using std::filesystem::path in sftpFileCopy is better idea

Originally created by @OlkhinAG on GitHub (Nov 27, 2023). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/440 **Describe the bug** Client crash when installing any service on server. event log shows error code 0xc0000409 Spotted on windows 10. Tracked it to sftpFileCopy function, exception raises on accessing localPath. Problem is that QTemporaryFile created in user profile and when path converted to std::string it makes it utf8, but std file functions on windows do not understand uft8. replaced line ``` error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName().toStdString(), remotePath.toStdString(), "non_desc"); ``` with ``` error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName().toLocal8Bit().toStdString(), remotePath.toStdString(), "non_desc"); ``` in \client\core\servercontroller.cpp and error gone maybe using std::filesystem::path in sftpFileCopy is better idea
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#135
No description provided.