commit_msg
stringlengths 1
24.2k
| commit_hash
stringlengths 2
84
⌀ | project
stringlengths 2
40
| source
stringclasses 4
values | labels
int64 0
1
| repo_url
stringlengths 26
70
⌀ | commit_url
stringlengths 74
118
⌀ | commit_date
stringlengths 25
25
⌀ |
---|---|---|---|---|---|---|---|
*/version.h: Add note/recommandition about bumping major
Reviewed-by: Andreas Cadhalpun <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
| 0b7829901bc93af8407bfb832049d3d97c881c62 | ffmpeg | neuralsentry | 0 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/0b7829901bc93af8407bfb832049d3d97c881c62 | 2015-08-18 12:28:17+02:00 |
8svx: convert to new channel layout API
Signed-off-by: Vittorio Giovara <[email protected]>
Signed-off-by: Anton Khirnov <[email protected]>
Signed-off-by: James Almer <[email protected]>
| 2350a50bed6bd71c67947604f117a4dff73ebe35 | ffmpeg | neuralsentry | 0 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/2350a50bed6bd71c67947604f117a4dff73ebe35 | 2013-05-07 07:20:32+02:00 |
3dostr: convert to new channel layout API
Signed-off-by: James Almer <[email protected]>
| b49e80a6498431b11fc14f5b00bd36c23351e92b | ffmpeg | neuralsentry | 0 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/b49e80a6498431b11fc14f5b00bd36c23351e92b | 2019-05-13 11:11:26+02:00 |
AAC encoder: avoid assertion failure on PNS
In rare corner cases it could still fail an assert on sf_diff due
to failure to update prev_sf in some code paths. Fix that case.
| 00d481b2c37552634490443b3af6dc04e6b42239 | ffmpeg | neuralsentry | 1 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/00d481b2c37552634490443b3af6dc04e6b42239 | 2016-01-08 04:39:02-03:00 |
AAC encoder: cosmetics from last commit
Reindent
| 323d37521d66233c8d9405dba902100ef146b5ec | ffmpeg | neuralsentry | 0 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/323d37521d66233c8d9405dba902100ef146b5ec | 2015-10-11 18:06:02-03:00 |
AAC encoder: Fix application of M/S with PNS
When both M/S coding and PNS are enabled, scalefactors
and coding books would be mistakenly clobbered when setting
the M/S flag on PNS'd bands. The flag needs to be set to
signal the generation of correlated noise, but the scalefactors,
coefficients and the coding books need to be kept intact.
| fc36d852ee3413f7cd00ce531ba985925fa7a749 | ffmpeg | neuralsentry | 1 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/fc36d852ee3413f7cd00ce531ba985925fa7a749 | 2015-11-26 03:27:06-03:00 |
AAC encoder: TNS fixes on short windows
TNS was computing filter coefficients incorrectly for short windows
due to a few coefficient addressing bugs. Fixing them fixes lots of
instability with transients (short windows).
| 3d0849cc90a7098e9992317248a53ef5f29ceffc | ffmpeg | neuralsentry | 1 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/3d0849cc90a7098e9992317248a53ef5f29ceffc | 2016-01-16 23:02:41-03:00 |
4xm: convert to new channel layout API
Signed-off-by: Vittorio Giovara <[email protected]>
Signed-off-by: James Almer <[email protected]>
| c465791d3b9b7cf67be440ee06daf2eeb9f1c9fa | ffmpeg | neuralsentry | 0 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/c465791d3b9b7cf67be440ee06daf2eeb9f1c9fa | 2017-03-31 13:22:18+02:00 |
4xm: Convert to the new bitstream reader
Signed-off-by: Anton Khirnov <[email protected]>
| ed006ae4e2534084552a791a6fe9ebce1fa27a23 | ffmpeg | neuralsentry | 0 | https://github.com/ffmpeg/ffmpeg | https://github.com/ffmpeg/ffmpeg/commit/ed006ae4e2534084552a791a6fe9ebce1fa27a23 | 2016-04-07 12:32:52+02:00 |
t/lib-rebase: update the documentation of FAKE_LINES
FAKE_LINES helper function use underscore to embed a space in a single
command. Let's document it and also update the list of commands.
Mentored-by: Christian Couder <[email protected]>
Mentored-by: Phillip Wood <[email protected]>
Helped-by: Eric Sunshine <[email protected]>
Signed-off-by: Charvi Mendiratta <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 75ace8329c730571281357dd40718a8aefc50db7 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/75ace8329c730571281357dd40718a8aefc50db7 | 2021-02-10 17:06:44+05:30 |
t4015: test the output of "diff --color-moved -b"
Commit fa5ba2c1dd (diff: fix infinite loop with
--color-moved --ignore-space-change, 2017-10-12) added a
test to make sure that "--color-moved -b" doesn't run
forever, but the test in question doesn't actually have any
moved lines in it.
Let's scrap that test and add a variant of the existing
"--color-moved -w" test, but this time we'll check that we
find the move with whitespace changes, but not arbitrary
whitespace additions.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| d5aae1f7cdcb6211d7884838f30e3cd1266b605f | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/d5aae1f7cdcb6211d7884838f30e3cd1266b605f | 2017-10-19 16:26:31-04:00 |
l10n: correct indentation of show-branch usage
An indentation error was found right after we started l10n round 2, and
commit d6589d1 (show-branch: fix indentation of usage string) and this
update would fix it.
Signed-off-by: Jiang Xin <[email protected]>
| 1e607449135792dd117bd528432fc1fbc1115667 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/1e607449135792dd117bd528432fc1fbc1115667 | 2015-01-21 15:05:03+08:00 |
gitk: Update German translation
Signed-off-by: Ralf Thielow <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
| fec7b51ec4bea33b6e6512f9d445be14eeee5ca6 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/fec7b51ec4bea33b6e6512f9d445be14eeee5ca6 | 2016-02-12 19:40:39+01:00 |
mingw: fix launching of externals from Unicode paths
If Git were installed in a path containing non-ASCII characters,
commands such as `git am` and `git submodule`, which are implemented as
externals, would fail to launch with the following error:
> fatal: 'am' appears to be a git command, but we were not
> able to execute it. Maybe git-am is broken?
This was due to lookup_prog not being Unicode-aware. It was somehow
missed in 85faec9d3a (Win32: Unicode file name support (except dirent),
2012-03-15).
Note that the only problem in this function was calling
`GetFileAttributes()` instead of `GetFileAttributesW()`. The calls to
`access()` were fine because `access()` is a macro which resolves to
`mingw_access()`, which already handles Unicode correctly. But
`lookup_prog()` was changed to use `_waccess()` directly so that we only
convert the path to UTF-16 once.
To make things work correctly, we have to maintain UTF-8 and UTF-16
versions in tandem in `lookup_prog()`.
Signed-off-by: Adam Roben <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 4e1a641ee345bbc877ed82962e12c45f09b6617b | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/4e1a641ee345bbc877ed82962e12c45f09b6617b | 2019-08-24 15:38:56-07:00 |
merge-recursive: fix merging a subdirectory into the root directory
We allow renaming all entries in e.g. a directory named z/ into a
directory named y/ to be detected as a z/ -> y/ rename, so that if the
other side of history adds any files to the directory z/ in the mean
time, we can provide the hint that they should be moved to y/.
There is no reason to not allow 'y/' to be the root directory, but the
code did not handle that case correctly. Add a testcase and the
necessary special checks to support this case.
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 49b8133a9ece199a17db8bb2545202c6eac67485 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/49b8133a9ece199a17db8bb2545202c6eac67485 | 2019-10-22 21:22:50+00:00 |
setup: tighten ownership checks post CVE-2022-24765
8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if needed, but that
check didn't account for owership of the gitdir, or (when used) the
gitfile that points to that gitdir.
An attacker could create a git repository in a directory that they can
write into but that is owned by the victim to work around the fix that
was introduced with CVE-2022-24765 to potentially run code as the
victim.
An example that could result in privilege escalation to root in *NIX would
be to set a repository in a shared tmp directory by doing (for example):
$ git -C /tmp init
To avoid that, extend the ensure_valid_ownership function to be able to
check for all three paths.
This will have the side effect of tripling the number of stat() calls
when a repository is detected, but the effect is expected to be likely
minimal, as it is done only once during the directory walk in which Git
looks for a repository.
Additionally make sure to resolve the gitfile (if one was used) to find
the relevant gitdir for checking.
While at it change the message printed on failure so it is clear we are
referring to the repository by its worktree (or gitdir if it is bare) and
not to a specific directory.
Helped-by: Junio C Hamano <[email protected]>
Helped-by: Johannes Schindelin <[email protected]>
Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]>
| 3b0bf2704980b1ed6018622bdf5377ec22289688 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/3b0bf2704980b1ed6018622bdf5377ec22289688 | 2022-05-10 12:35:29-07:00 |
alias.c: reject too-long cmdline strings in split_cmdline()
This function improperly uses an int to represent the number of entries
in the resulting argument array. This allows a malicious actor to
intentionally overflow the return value, leading to arbitrary heap
writes.
Because the resulting argv array is typically passed to execv(), it may
be possible to leverage this attack to gain remote code execution on a
victim machine. This was almost certainly the case for certain
configurations of git-shell until the previous commit limited the size
of input it would accept. Other calls to split_cmdline() are typically
limited by the size of argv the OS is willing to hand us, so are
similarly protected.
So this is not strictly fixing a known vulnerability, but is a hardening
of the function that is worth doing to protect against possible unknown
vulnerabilities.
One approach to fixing this would be modifying the signature of
`split_cmdline()` to look something like:
int split_cmdline(char *cmdline, const char ***argv, size_t *argc);
Where the return value of `split_cmdline()` is negative for errors, and
zero otherwise. If non-NULL, the `*argc` pointer is modified to contain
the size of the `**argv` array.
But this implies an absurdly large `argv` array, which more than likely
larger than the system's argument limit. So even if split_cmdline()
allowed this, it would fail immediately afterwards when we called
execv(). So instead of converting all of `split_cmdline()`'s callers to
work with `size_t` types in this patch, instead pursue the minimal fix
here to prevent ever returning an array with more than INT_MAX entries
in it.
Signed-off-by: Kevin Backhouse <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>
| 0ca6ead81edd4fb1984b69aae87c1189e3025530 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/0ca6ead81edd4fb1984b69aae87c1189e3025530 | 2022-09-28 18:53:32-04:00 |
Merge branch 'fix-msys2-quoting-bugs'
These patches fix several bugs in quoting arguments when spawning shell
scripts on Windows.
Note: these bugs are Windows-only, as we have to construct a command
line for the process-to-spawn, unlike Linux/macOS, where `execv()`
accepts an already-split command line.
Furthermore, these fixes were not included in the CVE-2019-1350 part of
v2.14.6 because the Windows-specific quoting when spawning shell scripts
was contributed from Git for Windows into Git only in the v2.21.x era.
Signed-off-by: Johannes Schindelin <[email protected]>
| 20c71bcf67c7087555b95cf413b79445547cb442 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/20c71bcf67c7087555b95cf413b79445547cb442 | 2019-09-16 13:26:40+02:00 |
Git.pm: trust rev-parse to find bare repositories
When initializing a repository object, we run "git rev-parse --git-dir"
to let the C version of Git find the correct directory. But curiously,
if this fails we don't automatically say "not a git repository".
Instead, we do our own pure-perl check to see if we're in a bare
repository.
This makes little sense, as rev-parse will report both bare and non-bare
directories. This logic comes from d5c7721d58 (Git.pm: Add support for
subdirectories inside of working copies, 2006-06-24), but I don't see
any reason given why we can't just rely on rev-parse. Worse, because we
treat any non-error response from rev-parse as a non-bare repository,
we'll erroneously set the object's WorkingCopy, even in a bare
repository.
But it gets worse. Since 8959555cee (setup_git_directory(): add an owner
check for the top-level directory, 2022-03-02), it's actively wrong (and
dangerous). The perl code doesn't implement the same ownership checks.
And worse, after "finding" the bare repository, it sets GIT_DIR in the
environment, which tells any subsequent Git commands that we've
confirmed the directory is OK, and to trust us. I.e., it re-opens the
vulnerability plugged by 8959555cee when using Git.pm's repository
discovery code.
We can fix this by just relying on rev-parse to tell us when we're not
in a repository, which fixes the vulnerability. Furthermore, we'll ask
its --is-bare-repository function to tell us if we're bare or not, and
rely on that.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 20da61f25f8f61a2b581b60f8820ad6116f88e6f | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/20da61f25f8f61a2b581b60f8820ad6116f88e6f | 2022-10-22 18:08:59-04:00 |
fsck: downgrade gitmodulesParse default to "info"
We added an fsck check in ed8b10f631 (fsck: check
.gitmodules content, 2018-05-02) as a defense against the
vulnerability from 0383bbb901 (submodule-config: verify
submodule names as paths, 2018-04-30). With the idea that
up-to-date hosting sites could protect downstream unpatched
clients that fetch from them.
As part of that defense, we reject any ".gitmodules" entry
that is not syntactically valid. The theory is that if we
cannot even parse the file, we cannot accurately check it
for vulnerabilities. And anybody with a broken .gitmodules
file would eventually want to know anyway.
But there are a few reasons this is a bad tradeoff in
practice:
- for this particular vulnerability, the client has to be
able to parse the file. So you cannot sneak an attack
through using a broken file, assuming the config parsers
for the process running fsck and the eventual victim are
functionally equivalent.
- a broken .gitmodules file is not necessarily a problem.
Our fsck check detects .gitmodules in _any_ tree, not
just at the root. And the presence of a .gitmodules file
does not necessarily mean it will be used; you'd have to
also have gitlinks in the tree. The cgit repository, for
example, has a file named .gitmodules from a
pre-submodule attempt at sharing code, but does not
actually have any gitlinks.
- when the fsck check is used to reject a push, it's often
hard to work around. The pusher may not have full control
over the destination repository (e.g., if it's on a
hosting server, they may need to contact the hosting
site's support). And the broken .gitmodules may be too
far back in history for rewriting to be feasible (again,
this is an issue for cgit).
So we're being unnecessarily restrictive without actually
improving the security in a meaningful way. It would be more
convenient to downgrade this check to "info", which means
we'd still comment on it, but not reject a push. Site admins
can already do this via config, but we should ship sensible
defaults.
There are a few counterpoints to consider in favor of
keeping the check as an error:
- the first point above assumes that the config parsers for
the victim and the fsck process are equivalent. This is
pretty true now, but as time goes on will become less so.
Hosting sites are likely to upgrade their version of Git,
whereas vulnerable clients will be stagnant (if they did
upgrade, they'd cease to be vulnerable!). So in theory we
may see drift over time between what two config parsers
will accept.
In practice, this is probably OK. The config format is
pretty established at this point and shouldn't change a
lot. And the farther we get from the announcement of the
vulnerability, the less interesting this extra layer of
protection becomes. I.e., it was _most_ valuable on day
0, when everybody's client was still vulnerable and
hosting sites could protect people. But as time goes on
and people upgrade, the population of vulnerable clients
becomes smaller and smaller.
- In theory this could protect us from other
vulnerabilities in the future. E.g., .gitmodules are the
only way for a malicious repository to feed data to the
config parser, so this check could similarly protect
clients from a future (to-be-found) bug there.
But that's trading a hypothetical case for real-world
pain today. If we do find such a bug, the hosting site
would need to be updated to fix it, too. At which point
we could figure out whether it's possible to detect
_just_ the malicious case without hurting existing
broken-but-not-evil cases.
- Until recently, we hadn't made any restrictions on
.gitmodules content. So now in tightening that we're
hitting cases where certain things used to work, but
don't anymore. There's some moderate pain now. But as
time goes on, we'll see more (and more varied) cases that
will make tightening harder in the future. So there's
some argument for putting rules in place _now_, before
users grow more cases that violate them.
Again, this is trading pain now for hypothetical benefit
in the future. And if we try hard in the future to keep
our tightening to a minimum (i.e., rejecting true
maliciousness without hurting broken-but-not-evil repos),
then that reduces even the hypothetical benefit.
Considering both sets of arguments, it makes sense to loosen
this check for now.
Note that we have to tweak the test in t7415 since fsck will
no longer consider this a fatal error. But we still check
that it reports the warning, and that we don't get the
spurious error from the config code.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 64eb14d31093b9e3af4a35ac7c030f1cfac64895 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/64eb14d31093b9e3af4a35ac7c030f1cfac64895 | 2018-07-13 15:39:58-04:00 |
Merge branch 'turn-on-protectntfs-by-default'
This patch series makes it safe to use Git on Windows drives, even if
running on a mounted network share or within the Windows Subsystem for
Linux (WSL).
This topic branch addresses CVE-2019-1353.
Signed-off-by: Johannes Schindelin <[email protected]>
| dd53ea7220606f9ed36db5a0ef910143fdac2903 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/dd53ea7220606f9ed36db5a0ef910143fdac2903 | 2019-09-16 13:26:40+02:00 |
restore: add --worktree and --staged
'git checkout <tree-ish> <pathspec>' updates both index and
worktree. But updating the index when you want to restore worktree
files is non-intuitive. The index contains the data ready for the next
commit, and there's no indication that the user will want to commit
the restored versions.
'git restore' therefore by default only touches worktree. The user has
the option to update either the index with
git restore --staged --source=<tree> <path> (1)
or update both with
git restore --staged --worktree --source=<tree> <path> (2)
PS. Orignally I wanted to make worktree update default and form (1)
would add index update while also updating the worktree, and the user
would need to do "--staged --no-worktree" to update index only. But it
looks really confusing that "--staged" option alone updates both. So
now form (2) is used for both, which reads much more obvious.
PPS. Yes form (1) overlaps with "git reset <rev> <path>". I don't know
if we can ever turn "git reset" back to "_always_ reset HEAD and
optionally do something else".
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 183fb44fd234499ed76d72d745ccb480b25f6d15 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/183fb44fd234499ed76d72d745ccb480b25f6d15 | 2019-04-25 16:45:50+07:00 |
Merge branch 'jk/difftool-in-subdir'
Even though an fix was attempted in Git 2.9.3 days, but running
"git difftool --dir-diff" from a subdirectory never worked. This
has been fixed.
* jk/difftool-in-subdir:
difftool: rename variables for consistency
difftool: chdir as early as possible
difftool: sanitize $workdir as early as possible
difftool: fix dir-diff index creation when in a subdirectory
| 5a5d3f1f1255559080f754fb202887f1566d8db3 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/5a5d3f1f1255559080f754fb202887f1566d8db3 | 2016-12-27 00:11:43-08:00 |
repack: fix trying to use preferred pack in alternates
When doing a geometric repack with multi-pack-indices, then we ask
git-multi-pack-index(1) to use the largest packfile as the preferred
pack. It can happen though that the largest packfile is not part of the
main object database, but instead part of an alternate object database.
The result is that git-multi-pack-index(1) will not be able to find the
preferred pack and print a warning. It then falls back to use the first
packfile that the multi-pack-index shall reference.
Fix this bug by only considering packfiles as preferred pack that are
local. This is the right thing to do given that a multi-pack-index
should never reference packfiles borrowed from an alternate.
While at it, rename the function `get_largest_active_packfile()` to
`get_preferred_pack()` to better document its intent.
Helped-by: Taylor Blau <[email protected]>
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3d74a2337c679839265efa16b2bca2a9b7795a00 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/3d74a2337c679839265efa16b2bca2a9b7795a00 | 2023-04-14 08:01:36+02:00 |
Merge branch 'ps/stash-push-pathspec-fix'
"git stash push <pathspec>" did not work from a subdirectory at all.
Bugfix for a topic in v2.13
* ps/stash-push-pathspec-fix:
git-stash: fix pushing stash with pathspec from subdir
| 49a8bf2edaa7c5922677e1ae04cf44df0c0c8abf | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/49a8bf2edaa7c5922677e1ae04cf44df0c0c8abf | 2017-06-22 14:15:24-07:00 |
Merge branch 'js/pre-merge-commit-hook'
A new "pre-merge-commit" hook has been introduced.
* js/pre-merge-commit-hook:
merge: --no-verify to bypass pre-merge-commit hook
git-merge: honor pre-merge-commit hook
merge: do no-verify like commit
t7503: verify proper hook execution
| f76bd8c6b132bdcefd547cb99cb832f433fee544 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/f76bd8c6b132bdcefd547cb99cb832f433fee544 | 2019-09-18 11:50:08-07:00 |
add-patch: fix inverted return code of repo_read_index()
After applying hunks to a file with "add -p", the C patch_update_file()
function tries to refresh the index (just like the perl version does).
We can only refresh the index if we're able to read it in, so we first
check the return value of repo_read_index(). But unlike many functions,
where "0" is success, that function is documented to return the number
of entries in the index. Hence we should be checking for success with a
non-negative return value.
Neither the tests nor any users seem to have noticed this, probably due
to a combination of:
- this affects only the C version, which is not yet the default
- following it up with any porcelain command like "git diff" or "git
commit" would refresh the index automatically.
But you can see the problem by running the plumbing "git diff-files"
immediately after "add -p" stages all hunks. Running the new test with
GIT_TEST_ADD_I_USE_BUILTIN=1 fails without the matching code change.
Signed-off-by: Jeff King <[email protected]>
Acked-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| dc6264157236fb729ad072e18f14d89549c08555 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/dc6264157236fb729ad072e18f14d89549c08555 | 2020-09-07 04:08:53-04:00 |
l10n: de.po: fix typo
Signed-off-by: Benedikt Heine <[email protected]>
Signed-off-by: Ralf Thielow <[email protected]>
| 3b36ef918801e265a1f8d1a7c085f400b9c2540d | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/3b36ef918801e265a1f8d1a7c085f400b9c2540d | 2015-01-25 12:00:04+01:00 |
t/helper: add a test helper to compute hash speed
Add a utility (which is less for the testsuite and more for developers)
that can compute hash speeds for whatever hash algorithms are
implemented. This allows developers to test their personal systems to
determine the performance characteristics of various algorithms.
Signed-off-by: brian m. carlson <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 37649b7f809f14b78d178c32e4d8333243f1f74e | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/37649b7f809f14b78d178c32e4d8333243f1f74e | 2018-11-14 04:09:34+00:00 |
strbuf_getwholeline: use getdelim if it is available
We spend a lot of time in strbuf_getwholeline in a tight
loop reading characters from a stdio handle into a buffer.
The libc getdelim() function can do this for us with less
overhead. It's in POSIX.1-2008, and was a GNU extension
before that. Therefore we can't rely on it, but can fall
back to the existing getc loop when it is not available.
The HAVE_GETDELIM knob is turned on automatically for Linux,
where we have glibc. We don't need to set any new
feature-test macros, because we already define _GNU_SOURCE.
Other systems that implement getdelim may need to other
macros (probably _POSIX_C_SOURCE >= 200809L), but we can
address that along with setting the Makefile knob after
testing the feature on those systems.
Running "git rev-parse refs/heads/does-not-exist" on a repo
with an extremely large (1.6GB) packed-refs file went from
(best-of-5):
real 0m8.601s
user 0m8.084s
sys 0m0.524s
to:
real 0m6.768s
user 0m6.340s
sys 0m0.432s
for a wall-clock speedup of 21%.
Based on a patch from Rasmus Villemoes <[email protected]>.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 0cc30e0e842a25846e76e09f62a1d425a25ee556 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/0cc30e0e842a25846e76e09f62a1d425a25ee556 | 2015-04-16 05:01:38-04:00 |
replace "parameters" by "arguments" in error messages
When an error message informs the user about an incorrect command
invocation, it should refer to "arguments", not "parameters".
Signed-off-by: Johannes Sixt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| b865734760c2f677d625a1d939071844048051e4 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/b865734760c2f677d625a1d939071844048051e4 | 2021-02-23 22:11:32+01:00 |
Merge branch 'mm/push-default-warning'
Across the transition at around Git version 2.0, the user used to
get a pretty loud warning when running "git push" without setting
push.default configuration variable. We no longer warn, given that
the transition is over long time ago.
* mm/push-default-warning:
push: remove "push.default is unset" warning message
| 15be621072740ccef0e89a3992ff369afd7c21bd | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/15be621072740ccef0e89a3992ff369afd7c21bd | 2016-02-26 13:37:25-08:00 |
t3600: slightly modernize style
Remove the space between redirection and file name.
Also remove unnecessary invocations of subshells, such as
(cd submod &&
echo X >untracked
) &&
as there is no point of having the shell for functional purposes.
In case of a single Git command use the `-C` option to let Git cd into
the directory.
Signed-off-by: Stefan Beller <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 9e189f1a5ccfd09fb2c9d1fdf3ee9b59bb0b0231 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/9e189f1a5ccfd09fb2c9d1fdf3ee9b59bb0b0231 | 2016-12-12 15:54:55-08:00 |
sq_dequote: fix extra consumption of source string
This fixes a (probably harmless) parsing problem in
sq_dequote_step(), in which we parse some bogus input
incorrectly rather than complaining that it's bogus.
Our shell-dequoting function is very strict: it can unquote
everything generated by sq_quote(), but not arbitrary
strings. In particular, it only allows characters outside of
the single-quoted string if they are immediately backslashed
and then the single-quoted string is resumed. So:
'foo'\''bar'
is OK. But these are not:
'foo'\'bar
'foo'\'
'foo'\'\''bar'
even though they are all valid shell. The parser has a funny
corner case here. When we see a backslashed character, we
keep incrementing the "src" pointer as we parse it. For a
single sq_dequote() call, that's OK; our next step is to
bail with an error, and we don't care where "src" points.
But if we're parsing multiple strings with sq_dequote_to_argv(),
then our next step is to see if the string is followed by
whitespace. Because we erroneously incremented the "src"
pointer, we don't barf on the bogus backslash that we
skipped. Instead, we may find whitespace that immediately
follows it, and continue as if all is well (skipping the
backslashed character completely!).
In practice, this shouldn't be a big deal. The input is
bogus, and our sq_quote() would never generate this bogus
input. In all but one callers, we are parsing input created
by an earlier call to sq_quote(). That final case is "git
shell", which parses shell-quoting generated by the client.
And in that case we use the singular sq_quote(), which has
always behaved correctly.
One might also wonder if you could provoke a read past the
end of the string. But the answer is no; we still parse
character by character, and would never advance past a NUL.
This patch implements the minimal fix, along with
documenting the restriction (which confused at least me
while reading the code). We should possibly consider
being more liberal in accepting valid shell-quoted words. I
suspect the code may actually be simpler, and it would be
more friendly to anybody generating or editing input by
hand. But I wanted to fix just the immediate bug in this
patch.
We don't have a direct way to unit-test the sq_dequote()
functions, but we can do this by feeding input to
GIT_CONFIG_PARAMETERS (which is not normally a user-facing
interface, but serves here as it expects to see sq_quote()
input from "git -c"). I've included both a bogus example,
and a related "good" one to confirm that we still parse it
correctly.
Noticed-by: Michael Haggerty <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| ddbbf8eb25065720eefeb31e22f668931fca815b | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/ddbbf8eb25065720eefeb31e22f668931fca815b | 2018-02-13 18:41:49-05:00 |
Merge branch 'js/convert-typofix' into maint
Typofix.
* js/convert-typofix:
convert: fix typo
| 6141e0cc00d556a0dd5a2b84c4d92508bfe4ed3b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/6141e0cc00d556a0dd5a2b84c4d92508bfe4ed3b | 2020-02-14 12:42:34-08:00 |
Merge branch 'ea/rebase-code-simplify'
Code clean-up.
* ea/rebase-code-simplify:
rebase: simplify an assignment of options.type in cmd_rebase
| bedefc1227907a4bfdf508bc1128d3c0813e5f82 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/bedefc1227907a4bfdf508bc1128d3c0813e5f82 | 2022-05-11 13:56:22-07:00 |
l10n: Updated Bulgarian translation of git (2355t,0f,0u)
Signed-off-by: Alexander Shopov <[email protected]>
| e1f7037167323461c0415447676262dcb8068fe6 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/e1f7037167323461c0415447676262dcb8068fe6 | 2015-06-28 10:27:57+03:00 |
git-commit-graph.txt: fix grammo
It's easy to mix up the possessive "its" and "it's" ("it is"). Correct
an instance of this.
Signed-off-by: Martin Ågren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 1aa7b686d65f53b8abfc5b22c9f23e68ed732e07 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/1aa7b686d65f53b8abfc5b22c9f23e68ed732e07 | 2020-05-17 20:52:18+02:00 |
repack: add config to skip updating server info
By default, git-repack(1) will update server info that is required by
the dumb HTTP transport. This can be skipped by passing the `-n` flag,
but what we're noticably missing is a config option to permanently
disable updating this information.
Add a new option "repack.updateServerInfo" which can be used to disable
the logic. Most hosting providers have turned off the dumb HTTP protocol
anyway, and on the client-side it woudln't typically be useful either.
Giving a persistent way to disable this feature thus makes quite some
sense to avoid wasting compute cycles and storage.
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| a2565c48e410864c049e66a64393fd6e26eb9a55 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/a2565c48e410864c049e66a64393fd6e26eb9a55 | 2022-03-14 08:42:51+01:00 |
merge-file: correctly open files when in a subdir
run_setup_gently() is called before merge-file. This may result in changing
current working directory, which wasn't taken into account when opening a file
for writing.
Fix by prepending the passed prefix. Previous var is left so that error
messages keep referring to the file from the user's working directory
perspective.
Signed-off-by: Aleksander Boruch-Gruszecki <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 204a8ffe67d2b789a34a14a06618a24756f7d9a9 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/204a8ffe67d2b789a34a14a06618a24756f7d9a9 | 2015-02-08 17:53:53+01:00 |
Merge branch 'jk/mailinfo-cleanup'
Code clean-up.
* jk/mailinfo-cleanup:
mailinfo: factor out some repeated header handling
mailinfo: be more liberal with header whitespace
mailinfo: simplify parsing of header values
mailinfo: treat header values as C strings
| d880c3de231da4ff930d12e07b3cae9dc0c31415 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/d880c3de231da4ff930d12e07b3cae9dc0c31415 | 2020-02-17 13:22:17-08:00 |
sha1-file: avoid "sha1 file" for generic use in messages
These error messages say "sha1 file", which is vague and not common in
user-facing documentation. Unlike the conversions from the previous
commit, these do not always refer to loose objects.
In finalize_object_file() we could be dealing with a packfile. Let's
just say "unable to write file" instead; since we include the filename,
the nature of the file is clear from the rest of the message.
In force_object_loose(), we're calling into read_object(), which could
actually be _any_ type of object. Just say "object".
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 2c319886c04c5e77da55c66ee9e860b101e5af32 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/2c319886c04c5e77da55c66ee9e860b101e5af32 | 2019-01-07 03:39:33-05:00 |
Merge branch 'jk/tempfile-active-flag-cleanup'
Code clean-up.
* jk/tempfile-active-flag-cleanup:
tempfile: update comment describing state transitions
tempfile: drop active flag
| 526c4906f8a05dc0755b4719887cd0376e6e4e5d | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/526c4906f8a05dc0755b4719887cd0376e6e4e5d | 2022-09-09 12:02:24-07:00 |
submodule: avoid hard-coded constants
Instead of using hard-coded 40-based constants, express these values in
terms of the_hash_algo and GIT_MAX_HEXSZ.
Signed-off-by: brian m. carlson <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| db1ba2a2302e7942981c70f9356c70e21e3f7bc7 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/db1ba2a2302e7942981c70f9356c70e21e3f7bc7 | 2019-02-19 00:04:59+00:00 |
Merge branch 'bc/clone-empty-repo-via-protocol-v0'
The server side of "git clone" now advertises the necessary hints
to clients to help them to clone from an empty repository and learn
object hash algorithm and the (unborn) branch pointed at by HEAD,
even over the older v0/v1 protocol.
* bc/clone-empty-repo-via-protocol-v0:
upload-pack: advertise capabilities when cloning empty repos
| 633390bd080e75ae3d36c7485b99d19beb69156d | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/633390bd080e75ae3d36c7485b99d19beb69156d | 2023-05-19 09:27:06-07:00 |
Merge branch 'jk/system-path-cleanup' into maint
Code clean-up.
* jk/system-path-cleanup:
git_extract_argv0_path: do nothing without RUNTIME_PREFIX
system_path: move RUNTIME_PREFIX to a sub-function
| 110a642801e55dcf6e9ffe415dfee3499d2c3c6f | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/110a642801e55dcf6e9ffe415dfee3499d2c3c6f | 2017-10-18 14:19:10+09:00 |
Merge branch 'rs/cocci'
Code clean-up with help from coccinelle tool continues.
* rs/cocci:
coccicheck: make transformation for strbuf_addf(sb, "...") more precise
use strbuf_add_unique_abbrev() for adding short hashes, part 2
use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
gitignore: ignore output files of coccicheck make target
| f0798e6cdbf99515391242e20f8df495a14e9c22 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/f0798e6cdbf99515391242e20f8df495a14e9c22 | 2016-10-06 14:53:12-07:00 |
cocci: allow padding with `strbuf_addf()`
A convenient way to pad strings is to use something like
`strbuf_addf(&buf, "%20s", "Hello, world!")`.
However, the Coccinelle rule that forbids a format `"%s"` with a
constant string argument cast too wide a net, and also forbade such
padding.
The original rule was introduced by commit:
28c23cd4c39 (strbuf.cocci: suggest strbuf_addbuf() to add one strbuf to an other, 2019-01-25)
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Teng Long <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 22184af2cb89f74b7245c77f1c3c10dae6098bcf | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/22184af2cb89f74b7245c77f1c3c10dae6098bcf | 2022-03-23 17:13:11+08:00 |
checkout: call a single commit "it" intead of "them"
When detached and checking out a branch again, git checkout warns
about commit(s) that might get lost. It says "If you want to keep
them ..." even for only one commit.
Use Q_() to allow differentiating singular vs plural.
Signed-off-by: Thomas Schneider <[email protected]>
Reviewed-by: Jonathan Nieder <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| fc792ca86049a85f9cf916d6bcdbbc1799ba91ec | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/fc792ca86049a85f9cf916d6bcdbbc1799ba91ec | 2015-04-01 19:38:00+02:00 |
trace2: add absolute elapsed time to start event
Add elapsed process time to "start" event to measure
the performance of early process startup.
Signed-off-by: Jeff Hostetler <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 39f43177442d44d8a945c3ff6a8c08f481539763 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/39f43177442d44d8a945c3ff6a8c08f481539763 | 2019-04-15 13:39:44-07:00 |
doc: uniformize <URL> placeholders' case
URL being an acronym, it deserves to be kept uppercase.
Signed-off-by: Jean-Noël Avila <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 7706294ec94ab9f9b864a8451ac089f15d18a254 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/7706294ec94ab9f9b864a8451ac089f15d18a254 | 2021-11-06 19:48:55+01:00 |
l10n: ru: updated Russian translation
Signed-off-by: Dimitriy Ryazantcev <[email protected]>
| 9af95af05f13196ed44b39e344a15ed756c82dbf | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/9af95af05f13196ed44b39e344a15ed756c82dbf | 2015-04-03 16:30:14+03:00 |
Merge branch 'rs/cleanup-strbuf-users'
Code clean-up.
* rs/cleanup-strbuf-users:
graph: use strbuf_addchars() to add spaces
use strbuf_addstr() for adding strings to strbufs
path: use strbuf_add_real_path()
| e46ebc27547e3d09385a76ade7ab11dc794f7595 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/e46ebc27547e3d09385a76ade7ab11dc794f7595 | 2017-10-05 13:48:19+09:00 |
Merge branch 'tz/git-svn-doc-markup-fix'
Doc formatting fix.
* tz/git-svn-doc-markup-fix:
Documentation/git-svn: improve asciidoctor compatibility
| 6e0bef3792fd30189f9310a595cb9ebf7a83c402 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/6e0bef3792fd30189f9310a595cb9ebf7a83c402 | 2019-05-09 00:37:23+09:00 |
Documentation: spelling and grammar fixes
Signed-off-by: Ville Skyttä <[email protected]>
Reviewed-by: Eric Sunshine <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 928f0ab4bae61954c27a77794d80c2332c8e816c | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/928f0ab4bae61954c27a77794d80c2332c8e816c | 2018-06-22 09:50:37+03:00 |
merge-ort: fix completely wrong comment
Not sure what happened, but the comment is describing code elsewhere in
the file. Fix the comment to actually discuss the code that follows.
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3584cff71c62586c050505b80d7d4c9b1b290101 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/3584cff71c62586c050505b80d7d4c9b1b290101 | 2021-09-19 01:48:55+00:00 |
range-diff: fix a crash in parsing git-log output
`git range-diff` calls `git log` internally and tries to parse its
output. But `git log` output can be customized by the user in their
git config and for certain configurations either an error will be
returned by `git range-diff` or it will crash.
To fix this explicitly set the output format of the internally
executed `git log` with `--pretty=medium`. Because that cancels
`--notes`, add explicitly `--notes` at the end.
Also, make sure we never crash in the same way - trying to dereference
`util` which was never created and has remained NULL. It would happen
if the first line of `git log` output does not begin with 'commit '.
Alternative considered but discarded - somehow disable all git configs
and behave as if no config is present in the internally executed
`git log`, but that does not seem to be possible. GIT_CONFIG_NOSYSTEM
is the closest to it, but even with that we would still read
`.git/config`.
Signed-off-by: Vasil Dimov <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 8cf51561d1e15e8f5ad907df00884a7596737dcd | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/8cf51561d1e15e8f5ad907df00884a7596737dcd | 2020-04-15 20:32:24+00:00 |
RelNotes/2.26.0: fix various typos
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 7fcb9659703b9dd611acb7cb85752be8ba4dcf31 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/7fcb9659703b9dd611acb7cb85752be8ba4dcf31 | 2020-03-18 21:18:26+00:00 |
t6120: fix typo in test name
Signed-off-by: Stefan Beller <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 2deda00707f8278382d64c696d75f33cc16e1233 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/2deda00707f8278382d64c696d75f33cc16e1233 | 2017-11-02 12:41:42-07:00 |
push tests: fix logic error in "push" test assertion
Fix a logic error that's been here since this test was added in
dbfeddb12e ("push: require force for refs under refs/tags/",
2012-11-29).
The intent of this test is to force-create a new tag pointing to
HEAD~, and then assert that pushing it doesn't work without --force.
Instead, the code was not creating a new tag at all, and then failing
to push the previous tag for the unrelated reason of providing a
refspec that doesn't make any sense.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 25f74f5234ffe2f0100b06c657fedb9cc7774ed3 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/25f74f5234ffe2f0100b06c657fedb9cc7774ed3 | 2018-07-31 13:07:11+00:00 |
revision.c: add trace2 stats around Bloom filter usage
Add trace2 statistics around Bloom filter usage and behavior
for 'git log -- path' commands that are hoping to benefit from
the presence of computed changed paths Bloom filters.
These statistics are great for performance analysis work and
for formal testing, which we will see in the commit following
this one.
Helped-by: Derrick Stolee <[email protected]
Helped-by: SZEDER Gábor <[email protected]>
Helped-by: Jonathan Tan <[email protected]>
Signed-off-by: Garima Singh <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 42e50e78c6fd8978c2218bbd7b3483ae51d5e3f9 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/42e50e78c6fd8978c2218bbd7b3483ae51d5e3f9 | 2020-04-06 16:59:53+00:00 |
msvc: support building Git using MS Visual C++
With this patch, Git can be built using the Microsoft toolchain, via:
make MSVC=1 [DEBUG=1]
Third party libraries are built from source using the open source
"vcpkg" tool set. See https://github.com/Microsoft/vcpkg
On a first build, the vcpkg tools and the third party libraries are
automatically downloaded and built. DLLs for the third party libraries
are copied to the top-level (and t/helper) directory to facilitate
debugging. See compat/vcbuild/README.
A series of .bat files are invoked by the Makefile to find the location
of the installed version of Visual Studio and the associated compiler
tools (essentially replicating the environment setup performed by a
"Developer Command Prompt"). This should find the most recent VS2015 or
VS2017 installation. Output from these scripts are used by the Makefile
to define compiler and linker pathnames and -I and -L arguments.
The build produces .pdb files for both debug and release builds.
Note: This commit was squashed from an organic series of commits
developed between 2016 and 2018 in Git for Windows' `master` branch.
This combined commit eliminates the obsolete commits related to fetching
NuGet packages for third party libraries. It is difficult to use NuGet
packages for C/C++ sources because they may be built by earlier versions
of the MSVC compiler and have CRT version and linking issues.
Additionally, the C/C++ NuGet packages that we were using tended to not
be updated concurrently with the sources. And in the case of cURL and
OpenSSL, this could expose us to security issues.
Helped-by: Yue Lin Ho <[email protected]>
Helped-by: Philip Oakley <[email protected]>
Signed-off-by: Jeff Hostetler <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| dce7d295514f0acebb897cc37a451963d60588f5 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/dce7d295514f0acebb897cc37a451963d60588f5 | 2019-06-25 07:49:39-07:00 |
Merge branch 'tb/config-copy-or-rename-in-file-injection'
Avoids issues with renaming or deleting sections with long lines, where
configuration values may be interpreted as sections, leading to
configuration injection. Addresses CVE-2023-29007.
* tb/config-copy-or-rename-in-file-injection:
config.c: disallow overly-long lines in `copy_or_rename_section_in_file()`
config.c: avoid integer truncation in `copy_or_rename_section_in_file()`
config: avoid fixed-sized buffer when renaming/deleting a section
t1300: demonstrate failure when renaming sections with long lines
Signed-off-by: Taylor Blau <[email protected]>
| 528290f8c61222433a8cf02fb7cfffa8438432b4 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/528290f8c61222433a8cf02fb7cfffa8438432b4 | 2023-04-14 11:46:59-04:00 |
Merge branch 'tb/clone-local-symlinks' into maint-2.30
Resolve a security vulnerability (CVE-2023-22490) where `clone_local()`
is used in conjunction with non-local transports, leading to arbitrary
path exfiltration.
* tb/clone-local-symlinks:
dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
clone: delay picking a transport until after get_repo_path()
t5619: demonstrate clone_local() with ambiguous transport
| 2c9a4c731010685b86559c06637aeef2ac5ea06e | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/2c9a4c731010685b86559c06637aeef2ac5ea06e | 2023-01-25 14:58:38-05:00 |
credential: fix grammar
There was a lot going on behind the scenes when the vulnerability and
possible solutions were discussed. Grammar was not a primary focus,
that's why this slipped in.
Reviewed-by: Jonathan Nieder <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Reviewed-by: Carlo Marcelo Arenas Belón <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 21920cbd9af489763a62ebb81e1ca188354f833e | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/21920cbd9af489763a62ebb81e1ca188354f833e | 2020-04-24 11:49:50+00:00 |
gettext: avoid using gettext if the locale dir is not present
In cc5e1bf99247 (gettext: avoid initialization if the locale dir is not
present, 2018-04-21) Git was taught to avoid a costly gettext start-up
when there are not even any localized messages to work with.
But we still called `gettext()` and `ngettext()` functions.
Which caused a problem in Git for Windows when the libgettext that is
consumed from the MSYS2 project stopped using a runtime prefix in
https://github.com/msys2/MINGW-packages/pull/10461
Due to that change, we now use an unintialized gettext machinery that
might get auto-initialized _using an unintended locale directory_:
`C:\mingw64\share\locale`.
Let's record the fact when the gettext initialization was skipped, and
skip calling the gettext functions accordingly.
This addresses CVE-2023-25815.
Signed-off-by: Johannes Schindelin <[email protected]>
| c4137be0f5a6edf9a9044e6e43ecf4468c7a4046 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/c4137be0f5a6edf9a9044e6e43ecf4468c7a4046 | 2023-02-22 12:40:55+01:00 |
Merge branch 'avoid-using-uninitialized-gettext'
Avoids the overhead of calling `gettext` when initialization of the
translated messages was skipped. Addresses CVE-2023-25815.
* avoid-using-uninitialized-gettext: (1 commit)
gettext: avoid using gettext if the locale dir is not present
| 4fe5d0b10afdc9ac5b703605b8d84d1ce5d71e87 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/4fe5d0b10afdc9ac5b703605b8d84d1ce5d71e87 | 2023-03-14 21:32:42+01:00 |
mingw: refuse to access paths with trailing spaces or periods
When creating a directory on Windows whose path ends in a space or a
period (or chains thereof), the Win32 API "helpfully" trims those. For
example, `mkdir("abc ");` will return success, but actually create a
directory called `abc` instead.
This stems back to the DOS days, when all file names had exactly 8
characters plus exactly 3 characters for the file extension, and the
only way to have shorter names was by padding with spaces.
Sadly, this "helpful" behavior is a bit inconsistent: after a successful
`mkdir("abc ");`, a `mkdir("abc /def")` will actually _fail_ (because
the directory `abc ` does not actually exist).
Even if it would work, we now have a serious problem because a Git
repository could contain directories `abc` and `abc `, and on Windows,
they would be "merged" unintentionally.
As these paths are illegal on Windows, anyway, let's disallow any
accesses to such paths on that Operating System.
For practical reasons, this behavior is still guarded by the
config setting `core.protectNTFS`: it is possible (and at least two
regression tests make use of it) to create commits without involving the
worktree. In such a scenario, it is of course possible -- even on
Windows -- to create such file names.
Among other consequences, this patch disallows submodules' paths to end
in spaces on Windows (which would formerly have confused Git enough to
try to write into incorrect paths, anyway).
While this patch does not fix a vulnerability on its own, it prevents an
attack vector that was exploited in demonstrations of a number of
recently-fixed security bugs.
The regression test added to `t/t7417-submodule-path-url.sh` reflects
that attack vector.
Note that we have to adjust the test case "prevent git~1 squatting on
Windows" in `t/t7415-submodule-names.sh` because of a very subtle issue.
It tries to clone two submodules whose names differ only in a trailing
period character, and as a consequence their git directories differ in
the same way. Previously, when Git tried to clone the second submodule,
it thought that the git directory already existed (because on Windows,
when you create a directory with the name `b.` it actually creates `b`),
but with this patch, the first submodule's clone will fail because of
the illegal name of the git directory. Therefore, when cloning the
second submodule, Git will take a different code path: a fresh clone
(without an existing git directory). Both code paths fail to clone the
second submodule, both because the the corresponding worktree directory
exists and is not empty, but the error messages are worded differently.
Signed-off-by: Johannes Schindelin <[email protected]>
| d2c84dad1c88f40906799bc879f70b965efd8ba6 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/d2c84dad1c88f40906799bc879f70b965efd8ba6 | 2019-09-05 13:27:53+02:00 |
contrib/credential: avoid fixed-size buffer in osxkeychain
The macOS Keychain-based credential helper reads the newline-delimited
protocol stream one line at a time by repeatedly calling fgets() into a
fixed-size buffer, and is thus affected by the vulnerability described
in the previous commit.
To mitigate this attack, avoid using a fixed-size buffer, and instead
rely on getline() to allocate a buffer as large as necessary to fit the
entire content of the line, preventing any protocol injection.
We solved a similar problem in a5bb10fd5e (config: avoid fixed-sized
buffer when renaming/deleting a section, 2023-04-06) by switching to
strbuf_getline(). We can't do that here because the contrib helpers do
not link with the rest of Git, and so can't use a strbuf. But we can use
the system getline() directly, which works similarly.
In most parts of Git we don't assume that every platform has getline().
But this helper is run only on OS X, and that platform added support in
10.7 ("Lion") which was released in 2011.
Tested-by: Taylor Blau <[email protected]>
Co-authored-by: Jeff King <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 5747c8072b74d26a179267acc09da1e8c5becf64 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/5747c8072b74d26a179267acc09da1e8c5becf64 | 2023-05-01 11:53:54-04:00 |
url: do not allow %00 to represent NUL in URLs
There is no reason to allow %00 to terminate a string, so do not allow it.
Otherwise, we end up returning arbitrary content in the string (that which is
after the %00) which is effectively hidden from callers and can escape sanity
checks and validation, and possible be used in tandem with a security
vulnerability to introduce a payload.
Helped-by: brian m. carlson <[email protected]>
Signed-off-by: Matthew DeVore <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| d37dc239a427a367427f9c4fdf12a148ad811968 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/d37dc239a427a367427f9c4fdf12a148ad811968 | 2019-06-04 10:57:05-07:00 |
fast-import: disallow "feature export-marks" by default
The fast-import stream command "feature export-marks=<path>" lets the
stream write marks to an arbitrary path. This may be surprising if you
are running fast-import against an untrusted input (which otherwise
cannot do anything except update Git objects and refs).
Let's disallow the use of this feature by default, and provide a
command-line option to re-enable it (you can always just use the
command-line --export-marks as well, but the in-stream version provides
an easy way for exporters to control the process).
This is a backwards-incompatible change, since the default is flipping
to the new, safer behavior. However, since the main users of the
in-stream versions would be import/export-based remote helpers, and
since we trust remote helpers already (which are already running
arbitrary code), we'll pass the new option by default when reading a
remote helper's stream. This should minimize the impact.
Note that the implementation isn't totally simple, as we have to work
around the fact that fast-import doesn't parse its command-line options
until after it has read any "feature" lines from the stream. This is how
it lets command-line options override in-stream. But in our case, it's
important to parse the new --allow-unsafe-features first.
There are three options for resolving this:
1. Do a separate "early" pass over the options. This is easy for us to
do because there are no command-line options that allow the
"unstuck" form (so there's no chance of us mistaking an argument
for an option), though it does introduce a risk of incorrect
parsing later (e.g,. if we convert to parse-options).
2. Move the option parsing phase back to the start of the program, but
teach the stream-reading code never to override an existing value.
This is tricky, because stream "feature" lines override each other
(meaning we'd have to start tracking the source for every option).
3. Accept that we might parse a "feature export-marks" line that is
forbidden, as long we don't _act_ on it until after we've parsed
the command line options.
This would, in fact, work with the current code, but only because
the previous patch fixed the export-marks parser to avoid touching
the filesystem.
So while it works, it does carry risk of somebody getting it wrong
in the future in a rather subtle and unsafe way.
I've gone with option (1) here as simple, safe, and unlikely to cause
regressions.
This fixes CVE-2019-1348.
Signed-off-by: Jeff King <[email protected]>
| 68061e3470210703cb15594194718d35094afdc0 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/68061e3470210703cb15594194718d35094afdc0 | 2019-08-29 14:37:26-04:00 |
Merge branch 'dubiously-nested-submodules'
Recursive clones are currently affected by a vulnerability that is
caused by too-lax validation of submodule names.
This topic branch fixes that.
Signed-off-by: Johannes Schindelin <[email protected]>
| 76a681ce9c20e2827ebc02ca8c29fa6a3e946190 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/76a681ce9c20e2827ebc02ca8c29fa6a3e946190 | 2019-10-02 13:08:45+02:00 |
Merge branch 'kw/merge-recursive-cleanup'
A leakfix and code clean-up.
* kw/merge-recursive-cleanup:
merge-recursive: change current file dir string_lists to hashmap
merge-recursive: remove return value from get_files_dirs
merge-recursive: fix memory leak
| 6701263956ca5c0f13703d2f185e0aad81e928cb | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/6701263956ca5c0f13703d2f185e0aad81e928cb | 2017-09-19 10:47:56+09:00 |
list-objects-filter: correct usage of ALLOC_GROW
In the sparse filter data, array_frame array is used in a way such that
nr is the index of the last element. Fix this so that nr is actually the
number of elements in the array.
The filter_sparse_free function also has an unaddressed TODO to free the
memory associated with the sparse filter data. Address that TODO and fix
the memory leak.
Signed-off-by: Matthew DeVore <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 7140600e2e78f202594ebca09e3176b6fcac1625 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/7140600e2e78f202594ebca09e3176b6fcac1625 | 2019-05-31 11:46:06-07:00 |
date API: add and use a date_mode_release()
Fix a memory leak in the parse_date_format() function by providing a
new date_mode_release() companion function.
By using this in "t/helper/test-date.c" we can mark the
"t0006-date.sh" test as passing when git is compiled with
SANITIZE=leak, and whitelist it to run under
"GIT_TEST_PASSING_SANITIZE_LEAK=true" by adding
"TEST_PASSES_SANITIZE_LEAK=true" to the test itself.
The other tests that expose this memory leak (i.e. take the
"mode->type == DATE_STRFTIME" branch in parse_date_format()) are
"t6300-for-each-ref.sh" and "t7004-tag.sh". The former is due to an
easily fixed leak in "ref-filter.c", and brings the failures in
"t6300-for-each-ref.sh" down from 51 to 48.
Fixing the remaining leaks will have to wait until there's a
release_revisions() in "revision.c", as they have to do with leaks via
"struct rev_info".
There is also a leak in "builtin/blame.c" due to its call to
parse_date_format() to parse the "blame.date" configuration. However
as it declares a file-level "static struct date_mode blame_date_mode"
to track the data, LSAN will not report it as a leak. It's possible to
get valgrind(1) to complain about it with e.g.:
valgrind --leak-check=full --show-leak-kinds=all ./git -P -c blame.date=format:%Y blame README.md
But let's focus on things LSAN complains about, and are thus
observable with "TEST_PASSES_SANITIZE_LEAK=true". We should get to
fixing memory leaks in "builtin/blame.c", but as doing so would
require some re-arrangement of cmd_blame() let's leave it for some
other time.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 974c919d36d944e9005def346fb363d8a83399f7 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/974c919d36d944e9005def346fb363d8a83399f7 | 2022-02-16 09:14:05+01:00 |
urlmatch.c: add and use a *_release() function
Plug a memory leak in credential_apply_config() by adding and using a
new urlmatch_config_release() function. This just does a
string_list_clear() on the "vars" member.
This finished up work on normalizing the init/free pattern in this
API, started in 73ee449bbf2 (urlmatch.[ch]: add and use
URLMATCH_CONFIG_INIT, 2021-10-01).
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| a41e8e74674d53a46616b01f2c18e43c7f2f30a8 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/a41e8e74674d53a46616b01f2c18e43c7f2f30a8 | 2022-03-04 19:32:07+01:00 |
ls-files: fix a trivial dir_clear() leak
Fix an edge case that was missed when the dir_clear() call was added
in eceba532141 (dir: fix problematic API to avoid memory leaks,
2020-08-18), we need to also clean up when we're about to exit with
non-zero.
That commit says, on the topic of the dir_clear() API and UNLEAK():
[...]two of them clearly thought about leaks since they had an
UNLEAK(dir) directive, which to me suggests that the method to
free the data was too unclear.
I think that 0e5bba53af7 (add UNLEAK annotation for reducing leak
false positives, 2017-09-08) which added the UNLEAK() makes it clear
that that wasn't the case, rather it was the desire to avoid the
complexity of freeing the memory at the end of the program.
This does add a bit of complexity, but I think it's worth it to just
fix these leaks when it's easy in built-ins. It allows them to serve
as canaries for underlying APIs that shouldn't be leaking, it
encourages us to make those freeing APIs nicer for all their users,
and it prevents other leaking regressions by being able to mark the
entire test as TEST_PASSES_SANITIZE_LEAK=true.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| eab4ac6a233e505e78fc8b04df03d58628d5ff3e | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/eab4ac6a233e505e78fc8b04df03d58628d5ff3e | 2021-10-07 12:01:35+02:00 |
read-cache: fix memory leak in do_write_index
The previous_name_buf was never getting released when there
was an error in ce_write_entry or allow was false and execution
was returned to the caller.
Signed-off-by: Kevin Willford <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| b50386c7c038ccea8f70d2a66ac78f189240ef05 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/b50386c7c038ccea8f70d2a66ac78f189240ef05 | 2017-08-21 15:24:31-06:00 |
Merge branch 'sr/wrapper-quote-filenames'
Some error messages did not quote filenames shown in it, which have
been fixed.
* sr/wrapper-quote-filenames:
wrapper.c: consistently quote filenames in error messages
| 61f68f607367293d0edb5c297094da1d83cd7fcb | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/61f68f607367293d0edb5c297094da1d83cd7fcb | 2017-11-15 12:14:29+09:00 |
add -p: fix memory leak
asan reports that the C version of `add -p` is not freeing all the
memory it allocates. Fix this by introducing a function to clear
`struct add_p_state` and use it instead of freeing individual members.
Signed-off-by: Phillip Wood <[email protected]>
Acked-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 324efcf6b6d30d43b98e76c7beac90ecfb40d637 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/324efcf6b6d30d43b98e76c7beac90ecfb40d637 | 2020-09-07 15:04:00+00:00 |
pull: fix a "struct oid_array" memory leak
Fix a memory leak introduced in 44c175c7a46 (pull: error on no merge
candidates, 2015-06-18). As a result we can mark several tests as
passing with SANITIZE=leak using "TEST_PASSES_SANITIZE_LEAK=true".
Removing the "int ret = 0" assignment added here in a6d7eb2c7a6 (pull:
optionally rebase submodules (remote submodule changes only),
2017-06-23) is not a logic error, it could always have been left
uninitialized (as "int ret"), now that we'll use the "ret" from the
upper scope we can drop the assignment in the "opt_rebase" branch.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| ece3974ba6018416ad4184c540f85d9db9b060b5 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/ece3974ba6018416ad4184c540f85d9db9b060b5 | 2022-07-01 12:43:00+02:00 |
submodule--helper: fix "errmsg_str" memory leak
Fix a memory leak introduced in e83e3333b57 (submodule: port submodule
subcommand 'summary' from shell to C, 2020-08-13), we sometimes append
to the "errmsg", and need to free the "struct strbuf".
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Reviewed-by: Glen Choo <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 61adac6c4b5839ffcc8b0f7081acac4a18240644 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/61adac6c4b5839ffcc8b0f7081acac4a18240644 | 2022-09-01 01:14:14+02:00 |
merge: fix memory leaks in cmd_merge()
There were two commit_lists created in cmd_merge() that were only
conditionally free()'d. Add a quick conditional call to
free_commit_list() for each of them at the end of the function.
Testing this commit against t6404 under valgrind shows that this patch
fixes the following two leaks:
16 bytes in 1 blocks are definitely lost in loss record 16 of 126
at 0x484086F: malloc (vg_replace_malloc.c:380)
by 0x69FFEB: do_xmalloc (wrapper.c:41)
by 0x6A0073: xmalloc (wrapper.c:62)
by 0x52A72D: commit_list_insert (commit.c:556)
by 0x47FC93: reduce_parents (merge.c:1114)
by 0x4801EE: collect_parents (merge.c:1214)
by 0x480B56: cmd_merge (merge.c:1465)
by 0x40686E: run_builtin (git.c:464)
by 0x406C51: handle_builtin (git.c:716)
by 0x406E96: run_argv (git.c:783)
by 0x40730A: cmd_main (git.c:914)
by 0x4E7DFA: main (common-main.c:56)
8 (16 direct, 32 indirect) bytes in 1 blocks are definitely lost in \
loss record 61 of 126
at 0x484086F: malloc (vg_replace_malloc.c:380)
by 0x69FFEB: do_xmalloc (wrapper.c:41)
by 0x6A0073: xmalloc (wrapper.c:62)
by 0x52A72D: commit_list_insert (commit.c:556)
by 0x52A8F2: commit_list_insert_by_date (commit.c:620)
by 0x5270AC: get_merge_bases_many_0 (commit-reach.c:413)
by 0x52716C: repo_get_merge_bases (commit-reach.c:438)
by 0x480E5A: cmd_merge (merge.c:1520)
by 0x40686E: run_builtin (git.c:464)
by 0x406C51: handle_builtin (git.c:716)
by 0x406E96: run_argv (git.c:783)
by 0x40730A: cmd_main (git.c:914)
There are still 3 leaks in chdir_notify_register() after this, but
chdir_notify_register() has been brought up on the list before and folks
were not a fan of fixing those, so I'm not touching them.
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 6046f7a91c3bf5c76702f10a4a83e8a63afe2fb4 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/6046f7a91c3bf5c76702f10a4a83e8a63afe2fb4 | 2022-01-20 07:47:15+00:00 |
Merge branch 'en/sparse-checkout-leakfix'
Leakfix.
* en/sparse-checkout-leakfix:
sparse-checkout: fix a couple minor memory leaks
| 9210a00d65fca884d2ecdcab32b917a672079014 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/9210a00d65fca884d2ecdcab32b917a672079014 | 2022-02-11 16:56:01-08:00 |
contrib/credential: avoid fixed-size buffer in libsecret
The libsecret credential helper reads the newline-delimited
protocol stream one line at a time by repeatedly calling fgets() into a
fixed-size buffer, and is thus affected by the vulnerability described
in the previous commit.
To mitigate this attack, avoid using a fixed-size buffer, and instead
rely on getline() to allocate a buffer as large as necessary to fit the
entire content of the line, preventing any protocol injection.
In most parts of Git we don't assume that every platform has getline().
But libsecret is primarily used on Linux, where we do already assume it
(using a knob in config.mak.uname). POSIX also added getline() in 2008,
so we'd expect other recent Unix-like operating systems to have it
(e.g., FreeBSD also does).
Note that the buffer was already allocated on the heap in this case, but
we'll swap `g_free()` for `free()`, since it will now be allocated by
the system `getline()`, rather than glib's `g_malloc()`.
Tested-by: Jeff King <[email protected]>
Co-authored-by: Jeff King <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 64f1e658e935bea6c9afdc4fa8be1d3ad6740355 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/64f1e658e935bea6c9afdc4fa8be1d3ad6740355 | 2023-05-01 11:54:03-04:00 |
negotiator/skipping: fix some problems in mark_common()
The mark_common() method in negotiator/skipping.c was converted
from recursive to iterative in 4654134976f (negotiator/skipping:
avoid stack overflow, 2022-10-25), but there is some more work
to do:
1. prio_queue() should be used with clear_prio_queue(), otherwise there
will be a memory leak.
2. It does not do duplicate protection before prio_queue_put().
(The COMMON bit would work here, too.)
3. When it translated from recursive to iterative it kept "return"
statements that should probably be "continue" statements.
4. It does not attempt to parse commits, and instead returns
immediately when finding an unparsed commit. This is something
that it did in its original version, so maybe it is by design,
but it doesn't match the doc comment for the method.
Helped-by: Derrick Stolee <[email protected]>
Signed-off-by: Han Xin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 10e8a52ef11bbf260f0cb672d9b02b3cd9c780ca | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/10e8a52ef11bbf260f0cb672d9b02b3cd9c780ca | 2023-04-26 21:15:04+08:00 |
refs: fix memory leak when parsing hideRefs config
When parsing the hideRefs configuration, we first duplicate the config
value so that we can modify it. We then subsequently append it to the
`hide_refs` string list, which is initialized with `strdup_strings`
enabled. As a consequence we again reallocate the string, but never
free the first duplicate and thus have a memory leak.
While we never clean up the static `hide_refs` variable anyway, this is
no excuse to make the leak worse by leaking every value twice. We are
also about to change the way this variable will be handled so that we do
indeed start to clean it up. So let's fix the memory leak by using the
`string_list_append_nodup()` so that we pass ownership of the allocated
string to `hide_refs`.
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>
| 5eeb9aa2086edc95f4f2c9cc844f60535f0a5ca4 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/5eeb9aa2086edc95f4f2c9cc844f60535f0a5ca4 | 2022-11-17 06:46:39+01:00 |
various: add missing clear_pathspec(), fix leaks
Fix memory leaks resulting from a missing clear_pathspec().
- archive.c: Plug a leak in the "struct archiver_args", and
clear_pathspec() the "pathspec" member that the "parse_pathspec_arg()"
call in this function populates.
- builtin/clean.c: Fix a memory leak that's been with us since
893d839970c (clean: convert to use parse_pathspec, 2013-07-14).
- builtin/reset.c: Add clear_pathspec() calls to cmd_reset(),
including to the codepaths where we'd return early.
- builtin/stash.c: Call clear_pathspec() on the pathspec initialized
in push_stash().
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 7615cf94d2af0f9ae71c4302092990e635f23a8f | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/7615cf94d2af0f9ae71c4302092990e635f23a8f | 2023-02-07 00:07:40+01:00 |
for-each-repo: with bad config, don't conflate <path> and <cmd>
Fix a logic error in 4950b2a2b5c (for-each-repo: run subcommands on
configured repos, 2020-09-11). Due to assuming that elements returned
from the repo_config_get_value_multi() call wouldn't be "NULL" we'd
conflate the <path> and <command> part of the argument list when
running commands.
As noted in the preceding commit the fix is to move to a safer
"*_string_multi()" version of the *_multi() API. This change is
separated from the rest because those all segfaulted. In this change
we ended up with different behavior.
When using the "--config=<config>" form we take each element of the
list as a path to a repository. E.g. with a configuration like:
[repo] list = /some/repo
We would, with this command:
git for-each-repo --config=repo.list status builtin
Run a "git status" in /some/repo, as:
git -C /some/repo status builtin
I.e. ask "status" to report on the "builtin" directory. But since a
configuration such as this would result in a "struct string_list *"
with one element, whose "string" member is "NULL":
[repo] list
We would, when constructing our command-line in
"builtin/for-each-repo.c"...
strvec_pushl(&child.args, "-C", path, NULL);
for (i = 0; i < argc; i++)
strvec_push(&child.args, argv[i]);
...have that "path" be "NULL", and as strvec_pushl() stops when it
sees NULL we'd end with the first "argv" element as the argument to
the "-C" option, e.g.:
git -C status builtin
I.e. we'd run the command "builtin" in the "status" directory.
In another context this might be an interesting security
vulnerability, but I think that this amounts to a nothingburger on
that front.
A hypothetical attacker would need to be able to write config for the
victim to run, if they're able to do that there's more interesting
attack vectors. See the "safe.directory" facility added in
8d1a7448206 (setup.c: create `safe.bareRepository`, 2022-07-14).
An even more unlikely possibility would be an attacker able to
generate the config used for "for-each-repo --config=<key>", but
nothing else (e.g. an automated system producing that list).
Even in that case the attack vector is limited to the user running
commands whose name matches a directory that's interesting to the
attacker (e.g. a "log" directory in a repository). The second
argument (if any) of the command is likely to make git die without
doing anything interesting (e.g. "-p" to "log", there being no "-p"
built-in command to run).
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3611f7467fddcff6063ed2c99484047b410969fc | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/3611f7467fddcff6063ed2c99484047b410969fc | 2023-03-28 16:04:28+02:00 |
merge: add missing strbuf_release()
We strbuf_reset() this "struct strbuf" in a loop earlier, but never
freed it. Plugs a memory leak that's been here ever since this code
got introduced in 1c7b76be7d6 (Build in merge, 2008-07-07).
This takes us from 68 failed tests in "t7600-merge.sh" to 59 under
SANITIZE=leak, and makes "t7604-merge-custom-message.sh" pass!
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 465028e0e25518bfff8b83057775cb6b2df2aade | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/465028e0e25518bfff8b83057775cb6b2df2aade | 2021-10-07 12:01:37+02:00 |
Disallow dubiously-nested submodule git directories
Currently it is technically possible to let a submodule's git
directory point right into the git dir of a sibling submodule.
Example: the git directories of two submodules with the names `hippo`
and `hippo/hooks` would be `.git/modules/hippo/` and
`.git/modules/hippo/hooks/`, respectively, but the latter is already
intended to house the former's hooks.
In most cases, this is just confusing, but there is also a (quite
contrived) attack vector where Git can be fooled into mistaking remote
content for file contents it wrote itself during a recursive clone.
Let's plug this bug.
To do so, we introduce the new function `validate_submodule_git_dir()`
which simply verifies that no git dir exists for any leading directories
of the submodule name (if there are any).
Note: this patch specifically continues to allow sibling modules names
of the form `core/lib`, `core/doc`, etc, as long as `core` is not a
submodule name.
This fixes CVE-2019-1387.
Reported-by: Nicolas Joly <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
| a8dee3ca610f5a1d403634492136c887f83b59d2 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/a8dee3ca610f5a1d403634492136c887f83b59d2 | 2019-10-01 23:27:18+02:00 |
Merge branch 'ab/mailmap-leakfix' into maint
Leakfix.
* ab/mailmap-leakfix:
mailmap.c: fix a memory leak in free_mailap_{info,entry}()
| dca0768820fe373a66049ef3a223c32a1a3c8a59 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/dca0768820fe373a66049ef3a223c32a1a3c8a59 | 2021-10-12 13:51:30-07:00 |
diff: plug memory leak from regcomp() on {log,diff} -I
Fix a memory leak in 296d4a94e7 (diff: add -I<regex> that ignores
matching changes, 2020-10-20) by freeing the memory it allocates in
the newly introduced diff_free(). See the previous commit for details
on that.
This memory leak was intentionally introduced in 296d4a94e7, see the
discussion on a previous iteration of it in
https://lore.kernel.org/git/[email protected]/
At that time freeing the memory was somewhat tedious, but since it
isn't anymore with the newly introduced diff_free() let's use it.
Let's retain the pattern for diff_free_file() and add a
diff_free_ignore_regex(), even though (unlike "diff_free_file") we
don't need to call it elsewhere. I think this'll make for more
readable code than gradually accumulating a giant diff_free()
function, sharing "int i" across unrelated code etc.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| c45dc9cf30a6f7f40adb3ea70dd2f2905ecd4afa | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/c45dc9cf30a6f7f40adb3ea70dd2f2905ecd4afa | 2021-02-11 11:45:35+01:00 |
cygwin: disallow backslashes in file names
The backslash character is not a valid part of a file name on Windows.
If, in Windows, Git attempts to write a file that has a backslash
character in the filename, it will be incorrectly interpreted as a
directory separator.
This caused CVE-2019-1354 in MinGW, as this behaviour can be manipulated
to cause the checkout to write to files it ought not write to, such as
adding code to the .git/hooks directory. This was fixed by e1d911dd4c
(mingw: disallow backslash characters in tree objects' file names,
2019-09-12). However, the vulnerability also exists in Cygwin: while
Cygwin mostly provides a POSIX-like path system, it will still interpret
a backslash as a directory separator.
To avoid this vulnerability, CVE-2021-29468, extend the previous fix to
also apply to Cygwin.
Similarly, extend the test case added by the previous version of the
commit. The test suite doesn't have an easy way to say "run this test
if in MinGW or Cygwin", so add a new test prerequisite that covers both.
As well as checking behaviour in the presence of paths containing
backslashes, the existing test also checks behaviour in the presence of
paths that differ only by the presence of a trailing ".". MinGW follows
normal Windows application behaviour and treats them as the same path,
but Cygwin more closely emulates *nix systems (at the expense of
compatibility with native Windows applications) and will create and
distinguish between such paths. Gate the relevant bit of that test
accordingly.
Reported-by: RyotaK <[email protected]>
Helped-by: Johannes Schindelin <[email protected]>
Signed-off-by: Adam Dinwoodie <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| bccc37fdc7ec66377af454417013f7612aef75e6 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/bccc37fdc7ec66377af454417013f7612aef75e6 | 2021-04-29 21:11:44+01:00 |
Merge branch 'js/apply-overwrite-rej-symlink-if-exists' into maint-2.30
Address CVE-2023-25652 by deleting any existing `.rej` symbolic links
instead of following them.
* js/apply-overwrite-rej-symlink-if-exists:
apply --reject: overwrite existing `.rej` symlink if it exists
Signed-off-by: Johannes Schindelin <[email protected]>
| 18e2b1cfc80990719275d7b08e6e50f3e8cbc902 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902 | 2023-03-02 15:13:30-08:00 |
path: safeguard `.git` against NTFS Alternate Streams Accesses
Probably inspired by HFS' resource streams, NTFS supports "Alternate
Data Streams": by appending `:<stream-name>` to the file name,
information in addition to the file contents can be written and read,
information that is copied together with the file (unless copied to a
non-NTFS location).
These Alternate Data Streams are typically used for things like marking
an executable as having just been downloaded from the internet (and
hence not necessarily being trustworthy).
In addition to a stream name, a stream type can be appended, like so:
`:<stream-name>:<stream-type>`. Unless specified, the default stream
type is `$DATA` for files and `$INDEX_ALLOCATION` for directories. In
other words, `.git::$INDEX_ALLOCATION` is a valid way to reference the
`.git` directory!
In our work in Git v2.2.1 to protect Git on NTFS drives under
`core.protectNTFS`, we focused exclusively on NTFS short names, unaware
of the fact that NTFS Alternate Data Streams offer a similar attack
vector.
Let's fix this.
Seeing as it is better to be safe than sorry, we simply disallow paths
referring to *any* NTFS Alternate Data Stream of `.git`, not just
`::$INDEX_ALLOCATION`. This also simplifies the implementation.
This closes CVE-2019-1352.
Further reading about NTFS Alternate Data Streams:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/c54dec26-1551-4d3a-a0ea-4fa40f848eb3
Reported-by: Nicolas Joly <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
| 7c3745fc6185495d5765628b4dfe1bd2c25a2981 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/7c3745fc6185495d5765628b4dfe1bd2c25a2981 | 2019-08-28 12:22:17+02:00 |
ref-filter: implement '--points-at' option
In 'tag -l' we have '--points-at' option which lets users
list only tags of a given object. Implement this option in
'ref-filter.{c,h}' so that other commands can benefit from this.
This is duplicated from tag.c, we will eventually remove that
when we port tag.c to use ref-filter APIs.
Based-on-patch-by: Jeff King <[email protected]>
Mentored-by: Christian Couder <[email protected]>
Mentored-by: Matthieu Moy <[email protected]>
Signed-off-by: Karthik Nayak <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 68411046b5067de9c378d1f58313f2fae288286c | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/68411046b5067de9c378d1f58313f2fae288286c | 2015-07-07 21:36:09+05:30 |
Merge branch 'ar/doc-env-variable-format' into maint
Minor documentation fixup.
* ar/doc-env-variable-format:
Documentation: make environment variable formatting more consistent
| 2945adcc2db603f9d810a823feff9b75a0452d04 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/2945adcc2db603f9d810a823feff9b75a0452d04 | 2015-12-01 17:19:33-05:00 |
object: allow clear_commit_marks_all to handle any repo
Allow callers to specify the repository to use. Rename the function to
repo_clear_commit_marks to document its new scope. No functional change
intended.
Signed-off-by: René Scharfe <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| cd8888452cd0e09c9efdc22da729023ae255b54b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/cd8888452cd0e09c9efdc22da729023ae255b54b | 2020-10-31 13:46:08+01:00 |
completion: fix a typo in a comment
Signed-off-by: SZEDER Gábor <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 08a12175d8b725d80efac41328780b57c4cfa6b1 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/08a12175d8b725d80efac41328780b57c4cfa6b1 | 2019-08-13 14:26:42+02:00 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.