)]}'
{
  "commit": "14303d6295e1bfd8a4e1b447057b78ce583be75d",
  "tree": "e6e0ee1b921a2c59e0465fbfe91b9927faeeda58",
  "parents": [
    "a3d6596ecf1cac1f81f121cb23a815895ae70645"
  ],
  "author": {
    "name": "Nick Alcock",
    "email": "nick.alcock@oracle.com",
    "time": "Mon May 12 12:31:00 2025 +0100"
  },
  "committer": {
    "name": "Nick Alcock",
    "email": "nick.alcock@oracle.com",
    "time": "Fri May 23 12:34:35 2025 +0100"
  },
  "message": "libctf: archive, open: when opening, always set errp to something\n\nctf_arc_import_parent, called by the cached-opening machinery used by\nctf_archive_next and archive-wide lookup functions like\nctf_arc_lookup_symbol, has an err-pointer parameter like all other opening\nfunctions.  Unfortunately it unconditionally initializes it whenever\nprovided, even if there was no error, which can lead to its being\ninitialized to an uninitialized value.  This is not technically an\nAPI-contract violation, since we don\u0027t define what happens to the error\nvalue except when an error happens, but it is still unpleasant.\n\nInitialize it only when there is an actual error, so we never initialize it\nto an uninitialized value.\n\nWhile we\u0027re at it, improve all the opening pathways: on success, set errp to\n0, rather than leaving it what it was, reducing the likelihood of\nuninitialized error param returns in callers too.  (This is inconsistent\nwith the treatment of ctf_errno(), but the err value being a parameter\npassed in from outside makes the divergence acceptable: in open functions,\nyou\u0027re never going to be overwriting some old error value someone might want\nto keep around across multiple calls, some of which are successful and some\nof which are not.)\n\nSoup up existing tests to verify all this.\n\nThanks to Bruce McCulloch for the original patch, and Stephen Brennan for\nthe report.\n\nlibctf/\n\tPR libctf/32903\n\t* ctf-archive.c (ctf_arc_open_internal): Zero errp on success.\n\t(ctf_dict_open_sections): Zero errp at the start.\n\t(ctf_arc_import_parent): Intialize err.\n\t* ctf-open.c (ctf_bufopen): Zero errp at the start.\n\t* testsuite/libctf-lookup/add-to-opened.c: Make sure one-element\n\tarchive opens update errp.\n\t* testsuite/libctf-writable/ctf-compressed.c: Make sure real archive\n\topens update errp.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dc01e2e0b08cebc2057e6982a6f3440659286e06",
      "old_mode": 33188,
      "old_path": "libctf/ctf-archive.c",
      "new_id": "6c4595fcc84d8641fcd224e5eb5954a940c3cdd9",
      "new_mode": 33188,
      "new_path": "libctf/ctf-archive.c"
    },
    {
      "type": "modify",
      "old_id": "449728fc3f4e22e340169da459d9c0fff98d7a83",
      "old_mode": 33188,
      "old_path": "libctf/ctf-open.c",
      "new_id": "8c0866748368d223beb1b0bae1020193dd924914",
      "new_mode": 33188,
      "new_path": "libctf/ctf-open.c"
    },
    {
      "type": "modify",
      "old_id": "96629afe1aad2a7d8e86dbbc161087893083cbb9",
      "old_mode": 33188,
      "old_path": "libctf/testsuite/libctf-lookup/add-to-opened.c",
      "new_id": "700257e8a0ee486ceecb69fcdd01534d7cb40304",
      "new_mode": 33188,
      "new_path": "libctf/testsuite/libctf-lookup/add-to-opened.c"
    },
    {
      "type": "modify",
      "old_id": "4769cdb97f22bd8417b2597cc6e2634d93b739e7",
      "old_mode": 33188,
      "old_path": "libctf/testsuite/libctf-writable/ctf-compressed.c",
      "new_id": "646b6035d1409554b375306ea9be2b860fa75721",
      "new_mode": 33188,
      "new_path": "libctf/testsuite/libctf-writable/ctf-compressed.c"
    }
  ]
}
