Skip to content

Commit

Permalink
Fix bug in VARDESC (#1644)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Mücke authored and Stefan Mücke committed Dec 15, 2024
1 parent 3befd7f commit 7206769
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Features

Bug Fixes
---------
* [#1644](https://github.com/java-native-access/jna/issues/1644): Fix bug in VARDESC causing an illegal memory access - [@stmuecke](https://github.com/stmuecke)

Release 5.15.0
==============
Expand Down
12 changes: 7 additions & 5 deletions contrib/platform/src/com/sun/jna/platform/win32/OaIdl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1398,14 +1398,10 @@ public static class ByReference extends _VARDESC implements
public VARIANT.ByReference lpvarValue;

public _VARDESC() {
setType("lpvarValue");
this.read();
}

public _VARDESC(Pointer pointer) {
super(pointer);
setType("lpvarValue");
this.read();
}

/**
Expand All @@ -1431,9 +1427,15 @@ public VARDESC() {

public VARDESC(Pointer pointer) {
super(pointer);
this._vardesc.setType("lpvarValue");
this.read();
}

@Override
public void read() {
readField("varkind");
this._vardesc.setType(varkind.value == VARKIND.VAR_CONST ? "lpvarValue" : "oInst");
super.read();
}
}

@FieldOrder({"tdesc", "_elemdesc"})
Expand Down

0 comments on commit 7206769

Please sign in to comment.