summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-12-13Git 2.39.1v2.39.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Sync with 2.38.3Junio C Hamano
2022-12-13Git 2.38.3v2.38.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Sync with Git 2.37.5Junio C Hamano
2022-12-13Git 2.37.5v2.37.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Merge branch 'maint-2.36' into maint-2.37Junio C Hamano
2022-12-13Git 2.36.4v2.36.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Merge branch 'maint-2.35' into maint-2.36Junio C Hamano
2022-12-13Git 2.35.6v2.35.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Merge branch 'maint-2.34' into maint-2.35Junio C Hamano
2022-12-13Git 2.34.6v2.34.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Merge branch 'maint-2.33' into maint-2.34Junio C Hamano
2022-12-13Git 2.33.6v2.33.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Sync with Git 2.32.5Junio C Hamano
2022-12-13Git 2.32.5v2.32.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Merge branch 'ps/attr-limits-with-fsck' into maint-2.32Junio C Hamano
2022-12-13Sync with Git 2.31.6Junio C Hamano
2022-12-13Git 2.31.6v2.31.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-13Sync with Git 2.30.7Junio C Hamano
2022-12-13Git 2.30.7v2.30.7Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-12Git 2.39v2.39.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-12Merge tag 'l10n-2.39.0-rnd1' of https://github.com/git-l10n/git-poJunio C Hamano
l10n-2.39.0-rnd1 * tag 'l10n-2.39.0-rnd1' of https://github.com/git-l10n/git-po: l10n: zh_TW.po: Git 2.39-rc2 l10n: tr: v2.39.0 updates l10n: Update Catalan translation l10n: bg.po: Updated Bulgarian translation (5501t) l10n: de.po: update German translation l10n: zh_CN v2.39.0 round 1 l10n: fr: v2.39 rnd 1 l10n: po-id for 2.39 (round 1) l10n: sv.po: Update Swedish translation (5501t0f0)
2022-12-11Sync with Git 2.38.2Junio C Hamano
2022-12-11Git 2.38.2v2.38.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-11l10n: zh_TW.po: Git 2.39-rc2pan93412
Signed-off-by: pan93412 <pan93412@gmail.com>
2022-12-10ci: use a newer `github-script` versionJohannes Schindelin
The old version we currently use runs in node.js v12.x, which is being deprecated in GitHub Actions. The new version uses node.js v16.x. Incidentally, this also avoids the warning about the deprecated `::set-output::` workflow command because the newer version of the `github-script` Action uses the recommended new way to specify outputs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-12-10Merge branch 'jx/ci-ubuntu-fix' into maint-2.38Junio C Hamano
Adjust the GitHub CI to newer ubuntu release. * jx/ci-ubuntu-fix: ci: install python on ubuntu ci: use the same version of p4 on both Linux and macOS ci: remove the pipe after "p4 -V" to catch errors github-actions: run gcc-8 on ubuntu-20.04 image
2022-12-10Sync with 'maint'Junio C Hamano
2022-12-10Merge branch 'js/ci-use-newer-up-down-artifact' into maint-2.38Junio C Hamano
CI fix. * js/ci-use-newer-up-down-artifact: ci: avoid using deprecated {up,down}load-artifacts Action
2022-12-10Merge branch 'ab/ci-use-macos-12' into maint-2.38Junio C Hamano
CI fix. * ab/ci-use-macos-12: CI: upgrade to macos-12, and pin OSX version
2022-12-10Merge branch 'ab/ci-retire-set-output' into maint-2.38Junio C Hamano
CI fix. * ab/ci-retire-set-output: CI: migrate away from deprecated "set-output" syntax
2022-12-10Merge branch 'ab/ci-musl-bash-fix' into maint-2.38Junio C Hamano
CI fix. * ab/ci-musl-bash-fix: CI: don't explicitly pick "bash" shell outside of Windows, fix regression
2022-12-10Merge branch 'od/ci-use-checkout-v3-when-applicable' into maint-2.38Junio C Hamano
Update GitHub CI to use actions/checkout@v3; use of the older checkout@v2 gets annoying deprecation notices. * od/ci-use-checkout-v3-when-applicable: ci(main): upgrade actions/checkout to v3
2022-12-10Merge branch 'js/ci-use-newer-up-down-artifact'Junio C Hamano
CI fix. * js/ci-use-newer-up-down-artifact: ci: avoid using deprecated {up,down}load-artifacts Action
2022-12-10Merge branch 'ab/ci-use-macos-12'Junio C Hamano
CI fix. * ab/ci-use-macos-12: CI: upgrade to macos-12, and pin OSX version
2022-12-10Merge branch 'ab/ci-retire-set-output'Junio C Hamano
CI fix. * ab/ci-retire-set-output: CI: migrate away from deprecated "set-output" syntax
2022-12-10Merge branch 'ab/ci-musl-bash-fix'Junio C Hamano
CI fix. * ab/ci-musl-bash-fix: CI: don't explicitly pick "bash" shell outside of Windows, fix regression
2022-12-10Merge branch 'od/ci-use-checkout-v3-when-applicable'Junio C Hamano
Update GitHub CI to use actions/checkout@v3; use of the older checkout@v2 gets annoying deprecation notices. * od/ci-use-checkout-v3-when-applicable: ci(main): upgrade actions/checkout to v3
2022-12-10mailmap: update email address of Matheus TavaresMatheus Tavares
I haven't been very active in the community lately, but I'm soon going to lose access to my previous commit email (@usp.br); so add my current personal address to mailmap for any future message exchanges or patch contributions. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09rebase --update-refs: avoid unintended ref deletionVictoria Dye
In b3b1a21d1a5 (sequencer: rewrite update-refs as user edits todo list, 2022-07-19), the 'todo_list_filter_update_refs()' step was added to handle the removal of 'update-ref' lines from a 'rebase-todo'. Specifically, it removes potential ref updates from the "update refs state" if a ref does not have a corresponding 'update-ref' line. However, because 'write_update_refs_state()' will not update the state if the 'refs_to_oids' list was empty, removing *all* 'update-ref' lines will result in the state remaining unchanged from how it was initialized (with all refs' "after" OID being null). Then, when the ref update is applied, all refs will be updated to null and consequently deleted. To fix this, delete the 'update-refs' state file when 'refs_to_oids' is empty. Additionally, add a tests covering "all update-ref lines removed" cases. Reported-by: herr.kaste <herr.kaste@gmail.com> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-12-09fsck: implement checks for gitattributesPatrick Steinhardt
Recently, a vulnerability was reported that can lead to an out-of-bounds write when reading an unreasonably large gitattributes file. The root cause of this error are multiple integer overflows in different parts of the code when there are either too many lines, when paths are too long, when attribute names are too long, or when there are too many attributes declared for a pattern. As all of these are related to size, it seems reasonable to restrict the size of the gitattributes file via git-fsck(1). This allows us to both stop distributing known-vulnerable objects via common hosting platforms that have fsck enabled, and users to protect themselves by enabling the `fetch.fsckObjects` config. There are basically two checks: 1. We verify that size of the gitattributes file is smaller than 100MB. 2. We verify that the maximum line length does not exceed 2048 bytes. With the preceding commits, both of these conditions would cause us to either ignore the complete gitattributes file or blob in the first case, or the specific line in the second case. Now with these consistency checks added, we also grow the ability to stop distributing such files in the first place when `receive.fsckObjects` is enabled. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09fsck: move checks for gitattributesPatrick Steinhardt
Move the checks for gitattributes so that they can be extended more readily. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09fsck: pull out function to check a set of blobsPatrick Steinhardt
In `fsck_finish()` we check all blobs for consistency that we have found during the tree walk, but that haven't yet been checked. This is only required for gitmodules right now, but will also be required for a new check for gitattributes. Pull out a function `fsck_blobs()` that allows the caller to check a set of blobs for consistency. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09fsck: refactor `fsck_blob()` to allow for more checksPatrick Steinhardt
In general, we don't need to validate blob contents as they are opaque blobs about whose content Git doesn't need to care about. There are some exceptions though when blobs are linked into trees so that they would be interpreted by Git. We only have a single such check right now though, which is the one for gitmodules that has been added in the context of CVE-2018-11235. Now we have found another vulnerability with gitattributes that can lead to out-of-bounds writes and reads. So let's refactor `fsck_blob()` so that it is more extensible and can check different types of blobs. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09Merge branch 'ps/attr-limits' into maint-2.32Junio C Hamano
2022-12-09Merge branch 'ps/attr-limits' into maint-2.30Junio C Hamano
2022-12-09Merge branch 'ps/format-padding-fix' into maint-2.30Junio C Hamano
2022-12-09pretty: restrict input lengths for padding and wrapping formatsPatrick Steinhardt
Both the padding and wrapping formatting directives allow the caller to specify an integer that ultimately leads to us adding this many chars to the result buffer. As a consequence, it is trivial to e.g. allocate 2GB of RAM via a single formatting directive and cause resource exhaustion on the machine executing this logic. Furthermore, it is debatable whether there are any sane usecases that require the user to pad data to 2GB boundaries or to indent wrapped data by 2GB. Restrict the input sizes to 16 kilobytes at a maximum to limit the amount of bytes that can be requested by the user. This is not meant as a fix because there are ways to trivially amplify the amount of data we generate via formatting directives; the real protection is achieved by the changes in previous steps to catch and avoid integer wraparound that causes us to under-allocate and access beyond the end of allocated memory reagions. But having such a limit significantly helps fuzzing the pretty format, because the fuzzer is otherwise quite fast to run out-of-memory as it discovers these formatters. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09utf8: refactor `strbuf_utf8_replace` to not rely on preallocated bufferPatrick Steinhardt
In `strbuf_utf8_replace`, we preallocate the destination buffer and then use `memcpy` to copy bytes into it at computed offsets. This feels rather fragile and is hard to understand at times. Refactor the code to instead use `strbuf_add` and `strbuf_addstr` so that we can be sure that there is no possibility to perform an out-of-bounds write. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-09utf8: fix checking for glyph width in `strbuf_utf8_replace()`Patrick Steinhardt
In `strbuf_utf8_replace()`, we call `utf8_width()` to compute the width of the current glyph. If the glyph is a control character though it can be that `utf8_width()` returns `-1`, but because we assign this value to a `size_t` the conversion will cause us to underflow. This bug can easily be triggered with the following command: $ git log --pretty='format:xxx%<|(1,trunc)%x10' >From all I can see though this seems to be a benign underflow that has no security-related consequences. Fix the bug by using an `int` instead. When we see a control character, we now copy it into the target buffer but don't advance the current width of the string. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>