)]}'
{
  "commit": "a8b7a1391135b63de73c1bf0e0a2f8f5dc8c6ba6",
  "tree": "0e05a83bb5cf746a6ab21ffdf5f680810678d285",
  "parents": [
    "558802e4d1c5dcbd0df7d2c6ef62a6deac247a2f"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Tue Apr 12 14:37:24 2022 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Tue Apr 12 14:42:02 2022 -0400"
  },
  "message": "gdb: fix \"passing NULL to memcpy\" UBsan error in dwarf2/cooked-index.c\n\nReading a simple file compiled with :\n\n    $ gcc -DONE\u003d1 -gdwarf-4 -g3  test.c\n    $ gcc --version\n    gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0\n\nI get:\n\n    Reading symbols from /tmp/cwd/a.out...\n    /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.c:332:11: runtime error: null pointer passed as argument 2, which is declared to never be null\n\nIt looks like even if the size is 0 (the size of the `entries` vector is\n0), we shouldn\u0027t be passing a NULL pointer to memcpy.  And\n`entries.data ()` returns NULL.\n\nFix that by using std::vector::insert to insert the items of entries\ninto m_entries.  I haven\u0027t checked, but it should essentially compile\ndown to a memcpy, since the vector elements are trivially copyiable.\n\nChange-Id: I75f1c901e9b522e42e89eb5936e2c70d68eb21e5\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "784c06ea04ba3b8d2e4ae978a8c280635ee8b218",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cooked-index.c",
      "new_id": "b66ef5a1c6481bd3d1a15448043993058f163d5e",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cooked-index.c"
    }
  ]
}
