Commit 53a8d79
committed
Fix use-after-free of enum type id in set_int_display_type
`set_int_display_type` converted the optional enumeration type id to an owned
C string, then moved it into a closure to take its pointer. The C string was
dropped at the end of that closure, before `BNSetIntegerConstantDisplayType`
ran, so the FFI call read freed memory and stored a garbage type id for the
enumeration display. As a result an integer operand set to
EnumerationDisplayType never resolved to its enumeration and rendered as a
raw constant. Borrow the owned C string instead so it outlives the call.1 parent d01e768 commit 53a8d79
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
1948 | 1951 | | |
| 1952 | + | |
1949 | 1953 | | |
1950 | 1954 | | |
1951 | 1955 | | |
| |||
0 commit comments