)]}'
{
  "commit": "e7fb2ca94556e6aadfc3038afaa1c8cc3525258c",
  "tree": "9464ba52bf58b6cfe6cf4c0baa6a54a3424b6001",
  "parents": [
    "1fbb8d7ecb7bd78ac55d226b6b073372a5ea2c2d"
  ],
  "author": {
    "name": "Patrick Steinhardt",
    "email": "ps@pks.im",
    "time": "Fri Jan 10 12:26:18 2025 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jan 10 06:56:55 2025 -0800"
  },
  "message": "builtin/blame: fix out-of-bounds write with blank boundary commits\n\nWhen passing the `-b` flag to git-blame(1), then any blamed boundary\ncommits which were marked as uninteresting will not get their actual\ncommit ID printed, but will instead be replaced by a couple of spaces.\n\nThe flag can lead to an out-of-bounds write as though when combined with\n`--abbrev\u003d` when the abbreviation length is longer than `GIT_MAX_HEXSZ`\nas we simply use memset(3p) on that array with the user-provided length\ndirectly. The result is most likely that we segfault.\n\nAn obvious fix would be to cull `length` to `GIT_MAX_HEXSZ` many bytes.\nBut when the underlying object ID is SHA1, and if the abbreviated length\nexceeds the SHA1 length, it would cause us to print more bytes than\ndesired, and the result would be misaligned.\n\nInstead, fix the bug by computing the length via strlen(3p). This makes\nus write as many bytes as the formatted object ID requires and thus\neffectively limits the length of what we may end up printing to the\nlength of its hash. If `--abbrev\u003d` asks us to abbreviate to something\nshorter than the full length of the underlying hash function it would be\nhandled by the call to printf(3p) correctly.\n\nSigned-off-by: Patrick Steinhardt \u003cps@pks.im\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d7630ac89cb7bd6e9ce5d72c6a98aa433b3b12da",
      "old_mode": 33188,
      "old_path": "builtin/blame.c",
      "new_id": "7555c445abe7ca2fa54670ac8fee1d95a6dbafe3",
      "new_mode": 33188,
      "new_path": "builtin/blame.c"
    },
    {
      "type": "modify",
      "old_id": "b3f8b63d2e6744dd434f38fd9f10b56cd432141b",
      "old_mode": 33261,
      "old_path": "t/t8002-blame.sh",
      "new_id": "1ad039e1234828ca8779ad76147bfa7fe14c5a2e",
      "new_mode": 33261,
      "new_path": "t/t8002-blame.sh"
    }
  ]
}
