)]}'
{
  "commit": "e1e12e97ac73ded85f7d000da1063a774b3cc14f",
  "tree": "66e22e31853435c667234bb0ede40e728203e115",
  "parents": [
    "447ac906e189535e77dcb1f4bbe3f1bc917d4c12"
  ],
  "author": {
    "name": "Patrick Steinhardt",
    "email": "ps@pks.im",
    "time": "Thu Dec 01 15:45:36 2022 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Mon Dec 05 15:14:16 2022 +0900"
  },
  "message": "attr: fix integer overflow with more than INT_MAX macros\n\nAttributes have a field that tracks the position in the `all_attrs`\narray they\u0027re stored inside. This field gets set via `hashmap_get_size`\nwhen adding the attribute to the global map of attributes. But while the\nfield is of type `int`, the value returned by `hashmap_get_size` is an\n`unsigned int`. It can thus happen that the value overflows, where we\nwould now dereference teh `all_attrs` array at an out-of-bounds value.\n\nWe do have a sanity check for this overflow via an assert that verifies\nthe index matches the new hashmap\u0027s size. But asserts are not a proper\nmechanism to detect against any such overflows as they may not in fact\nbe compiled into production code.\n\nFix this by using an `unsigned int` to track the index and convert the\nassert to a call `die()`.\n\nReported-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "98c231d67582464c2309b534c41be28ed0854621",
      "old_mode": 33188,
      "old_path": "attr.c",
      "new_id": "d1faf69083afea110da6c3c61a5011acabe587cd",
      "new_mode": 33188,
      "new_path": "attr.c"
    }
  ]
}
