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

Unexplained code in unicode_to_ansi_alloc() #145

Open
pkopylov opened this issue Aug 10, 2023 · 2 comments
Open

Unexplained code in unicode_to_ansi_alloc() #145

pkopylov opened this issue Aug 10, 2023 · 2 comments

Comments

@pkopylov
Copy link

pkopylov commented Aug 10, 2023

Can anyone explain why a Unicode is expected to be put in the buffer there?

Nonetheless, 4*len+1 bytes are allocated in the code mentioned above, why are just 4*len bytes passed as the target buffer length to the function filling the aptr buffer there ?

When len is zero, it leads to allocating exactly one byte of the memory, but the buffer pointed by aptr will not be filled at all in the called function unicode_to_ansi_copy() if HAVE_ICONV is undefined or connection is not given, right? See: this loop has no iteration and this condition is false.

@v-chojas
Copy link
Contributor

Why do you ask? Are you trying to track down a bug?

@pkopylov
Copy link
Author

Why do you ask? Are you trying to track down a bug?

I am studying CVE-2018-7409. It seems that mentioned functions are a scope of this CVE.

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