FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

git_tree_entry should not be selfFreeing · Issue #1333 · nodegit/nodegit · GitHub

Repository navigation

git_tree_entry should not be selfFreeing #1333

Description

git_tree_entry is marked as self freeing. But libgit2 only requires free'ing these in cases where the entry is retrieved from git_tree_entry_dup or git_tree_entry_bypath. Neither of which is exposed by nodegit. This can lead to memory corruption and/or double free.

I created #1332 to fix the issue.

Fairly easy to reproduce with the below running in a loop.

const builder = await git.Treebuilder.create(repository, null);

const oid = git.Oid.fromString("b45ef6fec89518d314f546fd6c3025367b721684");
for (let i = 0; i < 100; i++) {
    builder.insert(
        moniker.choose(),
        oid,
        parseInt("100644", 8));
}
builder.write();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL