Title: Fix git_tree_entry double free by kurtb · Pull Request #1332 · nodegit/nodegit · GitHub
Open Graph Title: Fix git_tree_entry double free by kurtb · Pull Request #1332 · nodegit/nodegit
X Title: Fix git_tree_entry double free by kurtb · Pull Request #1332 · nodegit/nodegit
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. This PR updates the default to make this not self freeing. It also updates the treebuilder side to mark itself as the owner. The docs indicate https://libgit2.github.com/libgit2/#HEAD/group/treebuilder/git_treebuilder_insert that the returned tree_entry in a git_treebuilder_insert may not be valid past the next builder call. I couldn't find a way with the current generator to either fill this field in with NULL to not return the entry at all. Or duplicate it prior to returning.
Open Graph 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 ex...
X 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 i...
Opengraph URL: https://github.com/nodegit/nodegit/pull/1332
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a00fe8d5-8916-75ac-d19b-16b4b6f89d58 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D758:2BEA3E:1AD939A:2549D47:6A5F358B |
| html-safe-nonce | bf63ee62e509efc05fe0e73c900f5934d4070cbfcc0b217240650e1d39bdbab6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzU4OjJCRUEzRToxQUQ5MzlBOjI1NDlENDc6NkE1RjM1OEIiLCJ2aXNpdG9yX2lkIjoiMzM0ODM3NjM2OTk2OTk2ODUyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 84dd5d334345a9bdf01f0fc22a901a113eb9264e990c6198829c21a3bc989654 |
| hovercard-subject-tag | pull_request:132619982 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodegit/nodegit/pull/1332/files |
| twitter:image | https://avatars.githubusercontent.com/u/457558?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/457558?s=400&v=4 |
| og:image:alt | 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 ex... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c80a2cb0221395c7c3987d7891fcde45641e27ea0bd3917b247d8fe154cf710f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4cf24abec96dc3a7b39f364f737aca1e50991904 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width