)]}'
{
  "commit": "86a053ddd1e2534c588d8d6f56752fb51dd1b184",
  "tree": "d9812e604152f0b9d5755d7c1b0c4e7d446fc65e",
  "parents": [
    "c35217309a9753e1a5666626f779bfd71668de9d"
  ],
  "author": {
    "name": "Matthieu Longo",
    "email": "matthieu.longo@arm.com",
    "time": "Thu Apr 17 09:11:24 2025 +0100"
  },
  "committer": {
    "name": "Matthieu Longo",
    "email": "matthieu.longo@arm.com",
    "time": "Wed Jun 25 09:41:24 2025 +0100"
  },
  "message": "readelf: invalid error message triggered when last tag is an empty string\n\nDisclaimer: this issue cannot occur with Object Attributes v1 (OAv1) while\nusing the GNU binutils because a value of \u0027\\0\u0027 (empty string) for a tag\nwith a string value is considered as the default value for the attribute,\nand consequently is eliminated by gas from the output object file during\nthe serialization.\n\nAn empty string is a valid value for a NTBS tag in both OAv1 and OAv2 [1]\ncases. However, contrarily to OAv1, a OAv2 subsection can be required and\nso, tags in this subsection might have to be present even if the value is\nthe default. To comply with this requirement, the OAv2 serializer won\u0027t\ndrop the default values.\n\nIn the case where a NTBS tag has the value \u0027\\0\u0027 and is last in the object\nattributes section, the current code in readelf used for dumping the object\nattributes incorrectly detects an overflow, and prints out an error message\nfor a corrupted string tag.\n\nThis patch fixes the detection of the overflow so that it now accept an\nempty string in the last tag of the object attributes section.\n\nIt also fixes the previous tests for the empty NTBS case and the non-null\nterminated string one. The fix was also tested in the context of OAv2\u0027s\npatch series [1] where the issue was originally detected. No regression\nwas found.\n\n[1]: https://inbox.sourceware.org/binutils/20250509151319.88725-1-matthieu\n     .longo@arm.com/\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "77a88bff032fb28b22de7cc54674bfcda9dd4121",
      "old_mode": 33188,
      "old_path": "binutils/readelf.c",
      "new_id": "f49092f11b98a190836eebf5f6ba347ec1566498",
      "new_mode": 33188,
      "new_path": "binutils/readelf.c"
    },
    {
      "type": "modify",
      "old_id": "3c6560c80a818d9a8445315a3ae904002f0ff1a8",
      "old_mode": 33188,
      "old_path": "gas/testsuite/gas/arm/attr-empty-string.d",
      "new_id": "b4a91418e8036722eab41ab7ca033a7ecf87febf",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/arm/attr-empty-string.d"
    },
    {
      "type": "modify",
      "old_id": "d079d14903e48dd92d898511fd08550b1de50f13",
      "old_mode": 33188,
      "old_path": "gas/testsuite/gas/arm/attr-non-null-terminated-string.d",
      "new_id": "ac376a9ab9fe5bcaa0bbcce549cc7aefab63d488",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/arm/attr-non-null-terminated-string.d"
    }
  ]
}
