Skip to content

Commit

Permalink
Fix segfault in the Java API.
Browse files Browse the repository at this point in the history
A missing `return` in `ddlog_1transaction_1commit_1dump_1changes` caused
the method to access invalid memory locations on the error path.

Fixes #967.
  • Loading branch information
ryzhyk committed May 11, 2021
1 parent 4ea551a commit 13a84d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [Unreleased]

### Bug fix

- Segfault in the Java API in `transactionCommitDumpChanges`.

## [0.40.2] - May 10, 2021

### Libraries
Expand Down
2 changes: 2 additions & 0 deletions java/ddlogapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ JNIEXPORT void JNICALL Java_ddlogapi_DDlogAPI_ddlog_1transaction_1commit_1dump_1

ddlog_delta *delta = ddlog_transaction_commit_dump_changes((ddlog_prog)handle);
if (delta == NULL) {
free(cbinfo);
throwDDlogException(env, NULL);
return;
};
ddlog_delta_enumerate(delta, commit_dump_callback, (uintptr_t)cbinfo);
ddlog_free_delta(delta);
Expand Down

0 comments on commit 13a84d5

Please sign in to comment.