git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] builtin/blame: fix out-of-bounds read with excessive `--abbrev`

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 9, 2025, 13:43 UTC
Message-ID
<b09009f0-c822-f81d-1f79-07610ec20193@gmx.de>
In-Reply-To
<20250109-b4-pks-blame-truncate-hash-length-v2-1-589c81a6ddb0@pks.im>
Hi Patrick,
On Thu, 9 Jan 2025, Patrick Steinhardt wrote:
Show 10 quoted lines
> diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
> index 0147de304b4d104cc7f05ea1f8d68f1a07ceb80d..7cf6e0253a5bbd4d6e438e627dc18b47eac4df66 100755
> --- a/t/t8002-blame.sh
> +++ b/t/t8002-blame.sh
> @@ -126,6 +126,10 @@ test_expect_success '--no-abbrev works like --abbrev with full length' '
>  	check_abbrev $hexsz --no-abbrev
>  '
>
> +test_expect_success 'blame --abbrev gets truncated' '
> +	check_abbrev $hexsz --abbrev=9000 HEAD

Please note that the patch I proposed had `HEAD..` here, not `HEAD`. The latter would not have surfaced the problem with boundary commits.

Ciao, Johannes

Previous: shejialuoNext: Junio C Hamano
Message 12 of 18 in “builtin/blame: fix out-of-bounds read with excessive `--abbrev`”
  1. builtin/blame: fix out-of-bounds read with excessive `--abbrev`Patrick Steinhardt, Jan 9, 2025
  2. Kristoffer HaugsbakkJan 9, 2025
  3. Johannes SchindelinJan 9, 2025
  4. Patrick SteinhardtJan 9, 2025
  5. Johannes SchindelinJan 9, 2025
  6. Johannes SchindelinJan 10, 2025
  7. Patrick SteinhardtJan 10, 2025
  8. builtin/blame: fix out-of-bounds read with excessive `--abbrev`Patrick Steinhardt, Jan 9, 2025
  9. shejialuoJan 9, 2025
  10. Johannes SchindelinJan 9, 2025
  11. shejialuoJan 10, 2025
  12. Johannes SchindelinJan 9, 2025
  13. Junio C HamanoJan 9, 2025
  14. 0/2 builtin/blame: fix out-of-bounds reads and writesPatrick Steinhardt, Jan 10, 2025
  15. 1/2 builtin/blame: fix out-of-bounds read with excessive `--abbrev`Patrick Steinhardt, Jan 10, 2025
  16. 2/2 builtin/blame: fix out-of-bounds write with blank boundary commitsPatrick Steinhardt, Jan 10, 2025
  17. Johannes SchindelinJan 10, 2025
  18. Junio C HamanoJan 10, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.