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

[Bug] possible SEGFAULT in reverse_utf8() #44

Open
albrechtd opened this issue Sep 21, 2022 · 0 comments
Open

[Bug] possible SEGFAULT in reverse_utf8() #44

albrechtd opened this issue Sep 21, 2022 · 0 comments

Comments

@albrechtd
Copy link

A (half-broken?) EMF file I fed into the lib caused a segfault in function reverse_utf8() due to the argument value of char *in being NULL, which in turn has been caused by calling

ret = fontindex_to_utf8((uint16_t *)in, size_in, (char **)&string,

which fills the local string with NULL.

Trivial fix: perform the call

reverse_utf8((char *)string, *size_out);

iff ((string != NULL) && (*size_out > 0U)).

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

1 participant