)]}'
{
  "commit": "760fb390fd4ce506abd401e8a75fc0a510b82d48",
  "tree": "57f837f9737f009df0d000d3e3b8f23afd09cb12",
  "parents": [
    "1720b64f735ff2798ab50ea9e2a40ab42af6cc6e"
  ],
  "author": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Thu Aug 03 07:29:58 2023 +0930"
  },
  "committer": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Thu Aug 03 21:19:04 2023 +0930"
  },
  "message": "objdump, nm: sprintf sanitizer null destination pointer\n\nSeen on Ubuntu 23.04 x86_64-linux using gcc-12.2 and gcc-12.3 with\nCFLAGS\u003d\"-m32 -g -O2 -fsanitize\u003daddress,undefined\".\n\n  CC       objdump.o\nIn file included from /usr/include/stdio.h:906,\n                 from /home/alan/src/binutils-gdb/binutils/sysdep.h:24,\n                 from /home/alan/src/binutils-gdb/binutils/objdump.c:51:\nIn function \u0027sprintf\u0027,\n    inlined from \u0027display_utf8\u0027 at /home/alan/src/binutils-gdb/binutils/objdump.c:621:14,\n    inlined from \u0027sanitize_string.part.0\u0027 at /home/alan/src/binutils-gdb/binutils/objdump.c:742:11:\n/usr/include/bits/stdio2.h:30:10: error: null destination pointer [-Werror\u003dformat-overflow\u003d]\n   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,\n      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n   31 |                                   __glibc_objsize (__s), __fmt,\n      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n   32 |                                   __va_arg_pack ());\n      |                                   ~~~~~~~~~~~~~~~~~\ncc1: all warnings being treated as errors\n\nThe warning is bogus of course.  xmalloc is guaranteed to return\nnon-NULL, but apparently this isn\u0027t seen in display_utf6.  The same\ndoesn\u0027t happen with -m64, maybe due to inlining differences, I haven\u0027t\ninvestigated fully.  Easily avoided as we hardly need to use sprintf\nfor a single char, or a two char string.\n\n\t* objdump.c (display_utf8): Avoid bogus sprintf sanitizer warning.\n\tUse hex ESC to switch back to default colour.\n\t(sanitize_string): Comment.  Bump buffer size by one.  Fix overlong\n\tline.\n\t* nm.c (display_utf8, sanitize_string): As above.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f96cfa31cb90ec646ac61a43509806be21e014e2",
      "old_mode": 33188,
      "old_path": "binutils/nm.c",
      "new_id": "e4c8036df1bb8a4f4a948f99ca7ce461522a0b18",
      "new_mode": 33188,
      "new_path": "binutils/nm.c"
    },
    {
      "type": "modify",
      "old_id": "a35982ea9695704e328ab4e89d2866d1279b1d7f",
      "old_mode": 33188,
      "old_path": "binutils/objdump.c",
      "new_id": "fb0db5d4fe835a552302632407ae1436176ec12c",
      "new_mode": 33188,
      "new_path": "binutils/objdump.c"
    }
  ]
}
