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

Call Native.toString() in #getFileName() & #getAlternateFileName() #747

Merged
merged 1 commit into from
Dec 31, 2016

Conversation

jhult
Copy link
Contributor

@jhult jhult commented Dec 29, 2016

The custom logic which I removed, did not account for a missing NUL terminator. Plus, it is better to use logic already in the code base (e.g. Native.toString()).

@matthiasblaesing matthiasblaesing merged commit 58fef22 into java-native-access:master Dec 31, 2016
@matthiasblaesing
Copy link
Member

Thank you Jonathan. I merged this, though I have some doubts, that there is really a bug hidden here (from my perspective only filename could overflow). If you want to look further into this, this structure currently can only be used if w32.ascii is not set to true (this is the default).

The problem is, that a TCHAR either maps to char or a wchar depending on the calling function.

@twall
Copy link
Contributor

twall commented Jan 1, 2017

The structure in question wouldn't be valid for use with an ASCII function, which would require a byte[] field instead of char[].

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

Successfully merging this pull request may close these issues.

3 participants