)]}'
{
  "commit": "64cc539fd2f8e02f39cfae21e9523da2532c0467",
  "tree": "cda38c5dd1394364218ed5f2c6df8dc5c8fc9cb7",
  "parents": [
    "0171dbcb428739e59440ccdf2d9470d8782f51be"
  ],
  "author": {
    "name": "Andrzej Hunt",
    "email": "ajrhunt@google.com",
    "time": "Sun Mar 21 16:58:36 2021 +0000"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Sun Mar 21 14:39:10 2021 -0700"
  },
  "message": "parse-options: don\u0027t leak alias help messages\n\npreprocess_options() allocates new strings for help messages for\nOPTION_ALIAS. Therefore we also need to clean those help messages up\nwhen freeing the returned options.\n\nFirst introduced in:\n  7c280589cf (parse-options: teach \"git cmd -h\" to show alias as alias, 2020-03-16)\n\nThe preprocessed options themselves no longer contain any indication\nthat a given option is/was an alias - therefore we add a new flag to\nindicate former aliases. (An alternative approach would be to look back\nat the original options to determine which options are aliases - but\nthat seems like a fragile approach. Or we could even look at the\nalias_groups list - which might be less fragile, but would be slower\nas it requires nested looping.)\n\nAs far as I can tell, parse_options() is only ever used once per\ncommand, and the help messages are small - hence this leak has very\nlittle impact.\n\nThis leak was found while running t0001. LSAN output can be found below:\n\nDirect leak of 65 byte(s) in 1 object(s) allocated from:\n    #0 0x49a859 in realloc /home/abuild/rpmbuild/BUILD/llvm-11.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3\n    #1 0x9aae36 in xrealloc /home/ahunt/oss-fuzz/git/wrapper.c:126:8\n    #2 0x939d8d in strbuf_grow /home/ahunt/oss-fuzz/git/strbuf.c:98:2\n    #3 0x93b936 in strbuf_vaddf /home/ahunt/oss-fuzz/git/strbuf.c:392:3\n    #4 0x93b7ff in strbuf_addf /home/ahunt/oss-fuzz/git/strbuf.c:333:2\n    #5 0x86747e in preprocess_options /home/ahunt/oss-fuzz/git/parse-options.c:666:3\n    #6 0x866ed2 in parse_options /home/ahunt/oss-fuzz/git/parse-options.c:847:17\n    #7 0x51c4a7 in cmd_clone /home/ahunt/oss-fuzz/git/builtin/clone.c:989:9\n    #8 0x4cd60d in run_builtin /home/ahunt/oss-fuzz/git/git.c:453:11\n    #9 0x4cb2da in handle_builtin /home/ahunt/oss-fuzz/git/git.c:704:3\n    #10 0x4ccc37 in run_argv /home/ahunt/oss-fuzz/git/git.c:771:4\n    #11 0x4cac29 in cmd_main /home/ahunt/oss-fuzz/git/git.c:902:19\n    #12 0x69c9fe in main /home/ahunt/oss-fuzz/git/common-main.c:52:11\n    #13 0x7fdac42d4349 in __libc_start_main (/lib64/libc.so.6+0x24349)\n\nSigned-off-by: Andrzej Hunt \u003cajrhunt@google.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fbea16eaf5c2051f062bcf8b34ab99c3a4313075",
      "old_mode": 33188,
      "old_path": "parse-options.c",
      "new_id": "e6f56768ca5de8f644143ee462ac11dd959e5946",
      "new_mode": 33188,
      "new_path": "parse-options.c"
    },
    {
      "type": "modify",
      "old_id": "f2ddef18f7b0b584a4ca3ac9ac4d19357717af93",
      "old_mode": 33188,
      "old_path": "parse-options.h",
      "new_id": "a845a9d9527476fbe5269756a7fd03aed6c6d4d7",
      "new_mode": 33188,
      "new_path": "parse-options.h"
    }
  ]
}
