diff options
| author | lhchavez <[email protected]> | 2020-06-21 06:45:39 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-21 06:45:39 -0700 |
| commit | c78ae57de63857d53f05ed088f308699622360fe (patch) | |
| tree | a4979614e6100b81b5c827b31305fd9af0c366ea /git_system_static.go | |
| parent | 619a9c236bf79c63d955490c0803833004a47154 (diff) | |
Fix a potential use-after-free in DiffNotifyCallback (#579)
This change makes the DiffNotifyCallback always use an "unowned"
*git.Diff that does _not_ run the finalizer. Since the underlying
git_diff object is still owned by libgit2, we shouldn't be calling
Diff.Free() on it, even by accident, since that would cause a whole lot
of undefined behavior.
Now instead of storing a reference to a *git.Diff in the intermediate
state while the diff operation is being done, create a brand new
*git.Diff for every callback invocation, and only create a fully-owned
*git.Diff when the diff operation is done and the ownership is
transfered to Go.
Diffstat (limited to 'git_system_static.go')
0 files changed, 0 insertions, 0 deletions
