forked from java-native-access/jna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`ffi_closure_alloc` may fail and return `NULL` if, for instance, we're running in a locked-down operating system that forbids FFI from allocating executable pages of memory in any of the ways that it tries. Today we pass this `NULL` on to `ffi_prep_closure_loc` which triggers a segmentation fault that takes down the whole JVM. With this change we check for a failure in this call and turn it into an `UnsupportedOperationException` so that the caller can handle it more gracefully. Relates elastic/elasticsearch#73309 Relates elastic/elasticsearch#18272
- Loading branch information
1 parent
030411b
commit 3f5e937
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters