)]}'
{
  "commit": "657800047a26ac653c184d05a0be0d35f2aff1d2",
  "tree": "488072748862cdcecd8864942e4cf92166033462",
  "parents": [
    "fff80ceee21221ee781b7eb970e8efed4ae34b28"
  ],
  "author": {
    "name": "Elliott Hughes",
    "email": "enh@google.com",
    "time": "Tue May 24 17:44:36 2022 -0700"
  },
  "committer": {
    "name": "Cherrypicker Worker",
    "email": "android-build-cherrypicker-worker@google.com",
    "time": "Wed May 25 14:49:25 2022 +0000"
  },
  "message": "Make android::base::Basename() safe.\n\nThe previous \"thread safety\" was technically correct, but not super\nuseful in practice --- multiple calls to this function were safe, but\nyou couldn\u0027t mix android::base::Basename() and basename(3). This\nactually hit us in practice when system_server leaked enough fds for\nfdtrack to start up, which meant that libc calls that created fds would\nrequest a backtrace, which meant that libunwind_stack would call\nandroid::base::Basename(), which would call basename(3), which would\nclobber a previous call to basename(3) in the original function that\nmade the otherwise innocuous libc call (realpath(3), in this case): it\nwas as if realpath(3) clobbered basename(3)\u0027s storage!\n\nI\u0027m not a huge fan of this particular basename_r() implementation with\nits gotos, but it\u0027s way too late in the T release cycle to be inventing\nnew implementations for a widely-used function. Sadly there\u0027s no\nbasename_r() for LP64 -- which, hilariously, is my fault -- so copy \u0026\npaste it is!\n\nI\u0027ve left mingw with the old implementation. I\u0027ve no idea how much of\nthat mingw actually needs, so it can probably be cleaned up, but that\u0027s\na worry for another day.\n\nBug: http://b/231951809\nTest: treehugger\nChange-Id: I58a4c18d7943014ffdac4fd8185977b65b3ba1f7\n(cherry picked from commit 91a10d912827b818d0c1931ede3a2afaa93b18cd)\nMerged-In: I58a4c18d7943014ffdac4fd8185977b65b3ba1f7\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "97cc2b27f7f102186636d403137176f0a63e4f9e",
      "old_mode": 33188,
      "old_path": "file.cpp",
      "new_id": "a580dcc3cd3d68d281cbf01870f8bea662591389",
      "new_mode": 33188,
      "new_path": "file.cpp"
    },
    {
      "type": "modify",
      "old_id": "120228d947973412837020a51d0793752cbdf6f7",
      "old_mode": 33188,
      "old_path": "file_test.cpp",
      "new_id": "c73966464d2b0894744894cb07b5e4baf31f491a",
      "new_mode": 33188,
      "new_path": "file_test.cpp"
    }
  ]
}
