-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
VARDESC: Premature invocation of _VARDESC.setType("lpvarValue") #1644
Comments
Agreed - this is a bug. I suggest that you create a PR for this and we get this fixed. Looking at the For the fix, yes overriding |
Awesome reaction time. I didn't expect that. Thank you! PR created. |
Version of JNA: 5.15.0
Windows 10
While using TlbImp, I stumbled across a bug in VARDESC and _VARDESC. Constructors of both classes set the union's type to "lpvarValue", which can lead to an invalid memory access. This can be easily reproduced:
The problem can be fixed by changing all instances of setType("lpvarValue") to setType("oInst") and setting the union's type to "lpvarValue" only after checking VARDESC's varkind. For this we have to override the read() method in VARDESC:
The text was updated successfully, but these errors were encountered: