Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wstr_to_utf8buf throw exception #3038

Closed
Tomas-Zhu opened this issue Mar 13, 2024 · 1 comment
Closed

wstr_to_utf8buf throw exception #3038

Tomas-Zhu opened this issue Mar 13, 2024 · 1 comment

Comments

@Tomas-Zhu
Copy link
Contributor

In "wstr_to_utf8buf" function, memory_buf_t 's size is a const value of 250, (wstr_size+1)*2 is less than 250, so there is no resizing of the result_size. In next WideCharToMultiByte call, this step went wrong.The last error is ERROR_INSUFFICIENT_BUFFER(122)(0x7A).
My test string is"OnPlayerStateChanged:state not changed 〈1〉叶心音的父亲遭人陷害入狱,男友不救反而出国,反而被他弟弟陆景霄救下。可她不知道就是男友陷害的父亲,而自己却已经爱上男友的弟弟!《总裁的金丝雀》,2,1", and can reproduce of this issue.

wstr_to_utf8buf

@tt4g
Copy link
Contributor

tt4g commented Mar 13, 2024

PR is welcome.

Tomas-Zhu pushed a commit to Tomas-Zhu/spdlog that referenced this issue Mar 19, 2024
Tomas-Zhu pushed a commit to Tomas-Zhu/spdlog that referenced this issue Mar 21, 2024
@gabime gabime closed this as completed in 73e2e02 Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants