Skip to content

Commit adb53fa

Browse files
committed
merge: upstream/master into master
2 parents 9ee0b81 + 0690072 commit adb53fa

File tree

5 files changed

+43
-12
lines changed

5 files changed

+43
-12
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Change Log
22

3+
## <a name="v0-28-0-alpha.27" href="#v0-28-0-alpha-27">v0.28.0-alpha.27</a> [(2024-06-06)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.27)
4+
5+
[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.26...v0.28.0-alpha.27)
6+
7+
#### Summary of changes
8+
- Build on Electron 29+
9+
10+
#### Merged PRs into NodeGit
11+
- [Fix build failure on electron 29+](https://github.com/nodegit/nodegit/pull/1998)
12+
13+
## <a name="v0-28-0-alpha.26" href="#v0-28-0-alpha-26">v0.28.0-alpha.26</a> [(2024-04-19)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.26)
14+
15+
[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.25...v0.28.0-alpha.26)
16+
17+
#### Summary of changes
18+
- Fix use-after-free in getRemotes
19+
20+
#### Merged PRs into NodeGit
21+
- [Fix double-free introduced trying to fix other double-free](https://github.com/nodegit/nodegit/pull/1996)
22+
23+
## <a name="v0-28-0-alpha.25" href="#v0-28-0-alpha-25">v0.28.0-alpha.25</a> [(2024-04-15)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.25)
24+
25+
[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.24...v0.28.0-alpha.25)
26+
27+
#### Summary of changes
28+
- Fix use-after-free in getReferences
29+
30+
#### Merged PRs into NodeGit
31+
- [Don't free the given repo on error in getReferences and getRemotes](https://github.com/nodegit/nodegit/pull/1995)
32+
333
## <a name="v0-28-0-alpha.24" href="#v0-28-0-alpha-24">v0.28.0-alpha.24</a> [(2024-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.24)
434

535
[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.23...v0.28.0-alpha.24)

generate/templates/manual/repository/get_references.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ void GitRepository::GetReferencesWorker::Execute()
6161
}
6262

6363
git_strarray_free(&reference_names);
64-
git_repository_free(repo);
6564
delete baton->out;
6665
baton->out = NULL;
6766
return;
@@ -80,6 +79,8 @@ void GitRepository::GetReferencesWorker::Execute()
8079
baton->out->push_back(reference);
8180
}
8281
}
82+
83+
git_strarray_free(&reference_names);
8384
}
8485

8586
void GitRepository::GetReferencesWorker::HandleErrorCallback() {

generate/templates/manual/repository/get_remotes.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ void GitRepository::GetRemotesWorker::Execute()
2929
{
3030
giterr_clear();
3131

32-
git_repository *repo;
33-
{
34-
nodegit::LockMaster lockMaster(true, baton->repo);
35-
baton->error_code = git_repository_open(&repo, git_repository_workdir(baton->repo));
36-
}
32+
git_repository *repo = baton->repo;
3733

3834
if (baton->error_code != GIT_OK) {
3935
if (giterr_last() != NULL) {
@@ -51,6 +47,7 @@ void GitRepository::GetRemotesWorker::Execute()
5147
if (giterr_last() != NULL) {
5248
baton->error = git_error_dup(giterr_last());
5349
}
50+
5451
delete baton->out;
5552
baton->out = NULL;
5653
return;
@@ -74,14 +71,15 @@ void GitRepository::GetRemotesWorker::Execute()
7471
}
7572

7673
git_strarray_free(&remote_names);
77-
git_repository_free(repo);
7874
delete baton->out;
7975
baton->out = NULL;
8076
return;
8177
}
8278

8379
baton->out->push_back(remote);
8480
}
81+
82+
git_strarray_free(&remote_names);
8583
}
8684

8785
void GitRepository::GetRemotesWorker::HandleErrorCallback() {

lifecycleScripts/install.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ module.exports = function install() {
2929
}
3030

3131
return new Promise(function(resolve, reject) {
32+
const gypPath = path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js");
3233
var spawnedNodePreGyp = spawn(nodePreGyp, args, {
33-
env: Object.assign({}, process.env, {
34-
npm_config_node_gyp: path.join(__dirname, "..", "node_modules",
35-
"node-gyp", "bin", "node-gyp.js")
36-
})
34+
env: {
35+
...process.env,
36+
npm_config_node_gyp: gypPath
37+
},
38+
shell: process.platform === "win32"
3739
});
3840

3941
spawnedNodePreGyp.stdout.on("data", function(data) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"node": ">= 16"
3939
},
4040
"dependencies": {
41-
"@axosoft/nan": "git://github.com/MikeJerred/nan.git",
41+
"@axosoft/nan": "^2.19.0-gk.1",
4242
"@mapbox/node-pre-gyp": "^1.0.11",
4343
"fs-extra": "^10.0.0",
4444
"got": "^11.8.6",

0 commit comments

Comments
 (0)