{"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json",
 "version": "2.1.0",
 "runs": [{"tool": {"driver": {"name": "GNU C23",
                               "fullName": "GNU C23 (GCC) version 16.1.1 20260703 (Red Hat 16.1.1-4) (x86_64-redhat-linux)",
                               "version": "16.1.1 20260703 (Red Hat 16.1.1-4)",
                               "informationUri": "https://gcc.gnu.org/gcc-16/",
                               "rules": [{"id": "-Wanalyzer-possible-null-argument",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-possible-null-argument"},
                                         {"id": "-Wanalyzer-fd-leak",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-leak"},
                                         {"id": "-Wanalyzer-possible-null-dereference",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-possible-null-dereference"}]}},
           "taxonomies": [{"name": "CWE",
                           "version": "4.7",
                           "organization": "MITRE",
                           "shortDescription": {"text": "The MITRE Common Weakness Enumeration"},
                           "taxa": [{"id": "690",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/690.html"},
                                    {"id": "775",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/775.html"}]}],
           "invocations": [{"arguments": ["/usr/libexec/gcc/x86_64-redhat-linux/16/cc1",
                                          "-quiet",
                                          "-I",
                                          "lib/replace",
                                          "-I",
                                          "../../lib/replace",
                                          "-I",
                                          ".",
                                          "-I",
                                          "../..",
                                          "-D",
                                          "_GNU_SOURCE=1",
                                          "-D",
                                          "_XOPEN_SOURCE_EXTENDED=1",
                                          "-D",
                                          "__STDC_WANT_LIB_EXT1__=1",
                                          "-D",
                                          "STATIC_replace_test_MODULES=NULL",
                                          "-D",
                                          "STATIC_replace_test_MODULES_PROTO=extern void __replace_test_dummy_module_proto(void)",
                                          "-D",
                                          "HAVE_PYEMBED=1",
                                          "-D",
                                          "HAVE_PYEXT=1",
                                          "-D",
                                          "HAVE_PYTHON_H=1",
                                          "../../lib/replace/tests/testsuite.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "testsuite.c",
                                          "-dumpbase-ext",
                                          ".c",
                                          "-m64",
                                          "-mtune=generic",
                                          "-march=x86-64",
                                          "-mtls-dialect=gnu2",
                                          "-O2",
                                          "-Wformat-truncation=0",
                                          "-Wno-unknown-pragmas",
                                          "-flto=auto",
                                          "-ffat-lto-objects",
                                          "-fexceptions",
                                          "-fstack-protector-strong",
                                          "-fasynchronous-unwind-tables",
                                          "-fcf-protection=full",
                                          "-fno-omit-frame-pointer",
                                          "-fPIC",
                                          "-fstack-clash-protection",
                                          "-fanalyzer",
                                          "-fdiagnostics-path-format=separate-events",
                                          "-fno-diagnostics-show-caret",
                                          "-fno-lto",
                                          "-fanalyzer-assume-nothrow",
                                          "-fdiagnostics-text-art-charset=none",
                                          "-fdiagnostics-set-output=sarif:file=/builddir/gcc-results/6043-br7g.sarif",
                                          "-o",
                                          "/tmp/ccVs3jSP.s"],
                            "workingDirectory": {"uri": "/builddir/build/BUILD/libtalloc-2.4.4-build/talloc-2.4.4/bin/default"},
                            "startTimeUtc": "2026-08-03T17:57:51Z",
                            "executionSuccessful": true,
                            "toolExecutionNotifications": [],
                            "endTimeUtc": "2026-08-03T17:57:56Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/libtalloc-2.4.4-build/talloc-2.4.4/bin/default/"}},
           "artifacts": [{"location": {"uri": "../../lib/replace/tests/testsuite.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/*\n   Unix SMB/CIFS implementation.\n\n   libreplace tests\n\n   Copyright (C) Jelmer Vernooij 2006\n\n     ** NOTE! The following LGPL license applies to the talloc\n     ** library. This does NOT imply that all of Samba is released\n     ** under the LGPL\n\n   This library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 3 of the License, or (at your option) any later version.\n\n   This library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with this library; if not, see <http://www.gnu.org/licenses/>.\n*/\n\n#include \"replace.h\"\n#include \"replace-test.h\"\n#include \"replace-testsuite.h\"\n\n/*\n  we include all the system/ include files here so that libreplace tests\n  them in the build farm\n*/\n#include \"system/capability.h\"\n#include \"system/dir.h\"\n#include \"system/filesys.h\"\n#include \"system/glob.h\"\n#include \"system/iconv.h\"\n#include \"system/locale.h\"\n#include \"system/network.h\"\n#include \"system/passwd.h\"\n#include \"system/readline.h\"\n#include \"system/select.h\"\n#include \"system/shmem.h\"\n#include \"system/syslog.h\"\n#include \"system/terminal.h\"\n#include \"system/time.h\"\n#include \"system/wait.h\"\n\n#define TESTFILE \"testfile.dat\"\n\n\n/*\n  test ftruncate() function\n */\nstatic int test_ftruncate(void)\n{\n\tstruct stat st;\n\tint fd;\n\tconst int size = 1234;\n\tprintf(\"test: ftruncate\\n\");\n\tunlink(TESTFILE);\n\tfd = open(TESTFILE, O_RDWR|O_CREAT, 0600);\n\tif (fd == -1) {\n\t\tprintf(\"failure: ftruncate [\\n\"\n\t\t\t   \"creating '%s' failed - %s\\n]\\n\", TESTFILE, strerror(errno));\n\t\treturn false;\n\t}\n\tif (ftruncate(fd, size) != 0) {\n\t\tprintf(\"failure: ftruncate [\\n%s\\n]\\n\", strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\tif (fstat(fd, &st) != 0) {\n\t\tprintf(\"failure: ftruncate [\\nfstat failed - %s\\n]\\n\", strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\tif (st.st_size != size) {\n\t\tprintf(\"failure: ftruncate [\\ngave wrong size %d - expected %d\\n]\\n\",\n\t\t       (int)st.st_size, size);\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\tunlink(TESTFILE);\n\tprintf(\"success: ftruncate\\n\");\n\tclose(fd);\n\treturn true;\n}\n\n/*\n  test strlcpy() function.\n  see http://www.gratisoft.us/todd/papers/strlcpy.html\n */\nstatic int test_strlcpy(void)\n{\n\tchar buf[4];\n\tconst struct {\n\t\tconst char *src;\n\t\tsize_t result;\n\t} tests[] = {\n\t\t{ \"abc\", 3 },\n\t\t{ \"abcdef\", 6 },\n\t\t{ \"abcd\", 4 },\n\t\t{ \"\", 0 },\n\t\t{ NULL, 0 }\n\t};\n\tint i;\n\tprintf(\"test: strlcpy\\n\");\n\tfor (i=0;tests[i].src;i++) {\n\t\tif (strlcpy(buf, tests[i].src, sizeof(buf)) != tests[i].result) {\n\t\t\tprintf(\"failure: strlcpy [\\ntest %d failed\\n]\\n\", i);\n\t\t\treturn false;\n\t\t}\n\t}\n\tprintf(\"success: strlcpy\\n\");\n\treturn true;\n}\n\nstatic int test_strlcat(void)\n{\n\tchar tmp[10];\n\tprintf(\"test: strlcat\\n\");\n\tstrlcpy(tmp, \"\", sizeof(tmp));\n\tif (strlcat(tmp, \"bla\", 3) != 3) {\n\t\tprintf(\"failure: strlcat [\\ninvalid return code\\n]\\n\");\n\t\treturn false;\n\t}\n\tif (strcmp(tmp, \"bl\") != 0) {\n\t\tprintf(\"failure: strlcat [\\nexpected \\\"bl\\\", got \\\"%s\\\"\\n]\\n\",\n\t\t\t   tmp);\n\t\treturn false;\n\t}\n\n\tstrlcpy(tmp, \"da\", sizeof(tmp));\n\tif (strlcat(tmp, \"me\", 4) != 4) {\n\t\tprintf(\"failure: strlcat [\\nexpected \\\"dam\\\", got \\\"%s\\\"\\n]\\n\",\n\t\t\t   tmp);\n\t\treturn false;\n\t}\n\n\tprintf(\"success: strlcat\\n\");\n\treturn true;\n}\n\nstatic int test_mktime(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_initgroups(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_memmove(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_strdup(void)\n{\n\tchar *x;\n\tint cmp;\n\n\tprintf(\"test: strdup\\n\");\n\tx = strdup(\"bla\");\n\n\tcmp = strcmp(\"bla\", x);\n\tif (cmp != 0) {\n\t\tprintf(\"failure: strdup [\\nfailed: expected \\\"bla\\\", got \\\"%s\\\"\\n]\\n\",\n\t\t\t   x);\n\t\tfree(x);\n\t\treturn false;\n\t}\n\tfree(x);\n\tprintf(\"success: strdup\\n\");\n\treturn true;\n}\n\nstatic int test_setlinebuf(void)\n{\n\tprintf(\"test: setlinebuf\\n\");\n\tsetlinebuf(stdout);\n\tprintf(\"success: setlinebuf\\n\");\n\treturn true;\n}\n\nstatic int test_vsyslog(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_timegm(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_setenv(void)\n{\n#define TEST_SETENV(key, value, overwrite, result) do { \\\n\tint _ret; \\\n\tchar *_v; \\\n\t_ret = setenv(key, value, overwrite); \\\n\tif (_ret != 0) { \\\n\t\tprintf(\"failure: setenv [\\n\" \\\n\t\t\t\"setenv(%s, %s, %d) failed\\n\" \\\n\t\t\t\"]\\n\", \\\n\t\t\tkey, value, overwrite); \\\n\t\treturn false; \\\n\t} \\\n\t_v=getenv(key); \\\n\tif (!_v) { \\\n\t\tprintf(\"failure: setenv [\\n\" \\\n\t\t\t\"getenv(%s) returned NULL\\n\" \\\n\t\t\t\"]\\n\", \\\n\t\t\tkey); \\\n\t\treturn false; \\\n\t} \\\n\tif (strcmp(result, _v) != 0) { \\\n\t\tprintf(\"failure: setenv [\\n\" \\\n\t\t\t\"getenv(%s): '%s' != '%s'\\n\" \\\n\t\t\t\"]\\n\", \\\n\t\t\tkey, result, _v); \\\n\t\treturn false; \\\n\t} \\\n} while(0)\n\n#define TEST_UNSETENV(key) do { \\\n\tchar *_v; \\\n\tunsetenv(key); \\\n\t_v=getenv(key); \\\n\tif (_v) { \\\n\t\tprintf(\"failure: setenv [\\n\" \\\n\t\t\t\"getenv(%s): NULL != '%s'\\n\" \\\n\t\t\t\"]\\n\", \\\n\t\t\tSETENVTEST_KEY, _v); \\\n\t\treturn false; \\\n\t} \\\n} while (0)\n\n#define SETENVTEST_KEY \"SETENVTESTKEY\"\n#define SETENVTEST_VAL \"SETENVTESTVAL\"\n\n\tprintf(\"test: setenv\\n\");\n\tTEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL\"1\", 0, SETENVTEST_VAL\"1\");\n\tTEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL\"2\", 0, SETENVTEST_VAL\"1\");\n\tTEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL\"3\", 1, SETENVTEST_VAL\"3\");\n\tTEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL\"4\", 1, SETENVTEST_VAL\"4\");\n\tTEST_UNSETENV(SETENVTEST_KEY);\n\tTEST_UNSETENV(SETENVTEST_KEY);\n\tTEST_SETENV(SETENVTEST_KEY, SETENVTEST_VAL\"5\", 0, SETENVTEST_VAL\"5\");\n\tTEST_UNSETENV(SETENVTEST_KEY);\n\tTEST_UNSETENV(SETENVTEST_KEY);\n\tprintf(\"success: setenv\\n\");\n\treturn true;\n}\n\nstatic int test_strndup(void)\n{\n\tchar *x;\n\tint cmp;\n\n\tprintf(\"test: strndup\\n\");\n\tx = strndup(\"bla\", 0);\n\tcmp = strcmp(x, \"\");\n\tfree(x);\n\tif (cmp != 0) {\n\t\tprintf(\"failure: strndup [\\ninvalid\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tx = strndup(\"bla\", 2);\n\tcmp = strcmp(x, \"bl\");\n\tfree(x);\n\tif (cmp != 0) {\n\t\tprintf(\"failure: strndup [\\ninvalid\\n]\\n\");\n\t\treturn false;\n\t}\n\n#ifdef __GNUC__\n# if __GNUC__ < 11\n\t/*\n\t * This code will not compile with gcc11 -O3 anymore.\n\t *\n\t * error: ‘strndup’ specified bound 10 exceeds source size 4 [-Werror=stringop-overread]\n\t *          x = strndup(\"bla\", 10);\n\t *          ^~~~~~~~~~~~~~~~~~\n\t */\n\tx = strndup(\"bla\", 10);\n\tcmp = strcmp(x, \"bla\");\n\tfree(x);\n\tif (cmp != 0) {\n\t\tprintf(\"failure: strndup [\\ninvalid\\n]\\n\");\n\t\treturn false;\n\t}\n# endif\n#endif /* __GNUC__ */\n\n\tprintf(\"success: strndup\\n\");\n\treturn true;\n}\n\nstatic int test_strnlen(void)\n{\n\tchar longlen[20] = { 0 };\n\n\tprintf(\"test: strnlen\\n\");\n\tif (strnlen(\"bla\", 2) != 2) {\n\t\tprintf(\"failure: strnlen [\\nunexpected length\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tif (strnlen(\"some text\\n\", 0) != 0) {\n\t\tprintf(\"failure: strnlen [\\nunexpected length\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tmemcpy(longlen, \"some text\", 10);\n\n\tif (strnlen(longlen, 20) != 9) {\n\t\tprintf(\"failure: strnlen [\\nunexpected length\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tprintf(\"success: strnlen\\n\");\n\treturn true;\n}\n\nstatic int test_waitpid(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_seteuid(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_setegid(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_asprintf(void)\n{\n\tchar *x = NULL;\n\n\tprintf(\"test: asprintf\\n\");\n\tif (asprintf(&x, \"%d\", 9) != 1) {\n\t\tprintf(\"failure: asprintf [\\ngenerate asprintf\\n]\\n\");\n\t\tfree(x);\n\t\treturn false;\n\t}\n\tif (strcmp(x, \"9\") != 0) {\n\t\tprintf(\"failure: asprintf [\\ngenerate asprintf\\n]\\n\");\n\t\tfree(x);\n\t\treturn false;\n\t}\n\tif (asprintf(&x, \"dat%s\", \"a\") != 4) {\n\t\tprintf(\"failure: asprintf [\\ngenerate asprintf\\n]\\n\");\n\t\tfree(x);\n\t\treturn false;\n\t}\n\tif (strcmp(x, \"data\") != 0) {\n\t\tprintf(\"failure: asprintf [\\ngenerate asprintf\\n]\\n\");\n\t\tfree(x);\n\t\treturn false;\n\t}\n\tfree(x);\n\tprintf(\"success: asprintf\\n\");\n\treturn true;\n}\n\n/* This test explicitly triggers truncation, so we need to\n * suppress the warning\n */\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wformat-truncation\"\nstatic int test_snprintf(void)\n{\n\tchar tmp[10];\n\tprintf(\"test: snprintf\\n\");\n\tif (snprintf(tmp, 3, \"foo%d\", 9) != 4) {\n\t\tprintf(\"failure: snprintf [\\nsnprintf return code failed\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tif (strcmp(tmp, \"fo\") != 0) {\n\t\tprintf(\"failure: snprintf [\\nsnprintf failed\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tprintf(\"success: snprintf\\n\");\n\treturn true;\n}\n#pragma GCC diagnostic pop\n\nstatic int test_vasprintf(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_vsnprintf(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_opendir(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_readdir(void)\n{\n\tprintf(\"test: readdir\\n\");\n\tif (test_readdir_os2_delete() != 0) {\n\t\treturn false;\n\t}\n\tprintf(\"success: readdir\\n\");\n\treturn true;\n}\n\nstatic int test_telldir(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_seekdir(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_dlopen(void)\n{\n\t/* FIXME: test dlopen, dlsym, dlclose, dlerror */\n\treturn true;\n}\n\n\nstatic int test_chroot(void)\n{\n\t/* FIXME: chroot() */\n\treturn true;\n}\n\nstatic int test_strerror(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_errno(void)\n{\n\tprintf(\"test: errno\\n\");\n\terrno = 3;\n\tif (errno != 3) {\n\t\tprintf(\"failure: errno [\\nerrno failed\\n]\\n\");\n\t\treturn false;\n\t}\n\n\tprintf(\"success: errno\\n\");\n\treturn true;\n}\n\nstatic int test_mkdtemp(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_mkstemp(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_pread(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_pwrite(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_inet_ntoa(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\n#define TEST_STRTO_X(type,fmt,func,str,base,res,diff,rrnoo) do {\\\n\ttype _v; \\\n\tchar _s[64]; \\\n\tchar *_p = NULL;\\\n\tchar *_ep = NULL; \\\n\tstrlcpy(_s, str, sizeof(_s));\\\n\tif (diff >= 0) { \\\n\t\t_ep = &_s[diff]; \\\n\t} \\\n\terrno = 0; \\\n\t_v = func(_s, &_p, base); \\\n\tif (errno != rrnoo) { \\\n\t\tprintf(\"failure: %s [\\n\" \\\n\t\t       \"\\t%s\\n\" \\\n\t\t       \"\\t%s(\\\"%s\\\",%d,%d): \" fmt \" (=/!)= \" fmt \"\\n\" \\\n\t\t       \"\\terrno: %d != %d\\n\" \\\n\t\t       \"]\\n\", \\\n\t\t        __STRING(func), __location__, __STRING(func), \\\n\t\t       str, diff, base, res, _v, rrnoo, errno); \\\n\t\treturn false; \\\n\t} else if (_v != res) { \\\n\t\tprintf(\"failure: %s [\\n\" \\\n\t\t       \"\\t%s\\n\" \\\n\t\t       \"\\t%s(\\\"%s\\\",%d,%d): \" fmt \" != \" fmt \"\\n\" \\\n\t\t       \"]\\n\", \\\n\t\t       __STRING(func), __location__, __STRING(func), \\\n\t\t       str, diff, base, res, _v); \\\n\t\treturn false; \\\n\t} else if (_p != _ep) { \\\n\t\tprintf(\"failure: %s [\\n\" \\\n\t\t       \"\\t%s\\n\" \\\n\t\t       \"\\t%s(\\\"%s\\\",%d,%d): \" fmt \" (=/!)= \" fmt \"\\n\" \\\n\t\t       \"\\tptr: %p - %p = %d != %d\\n\" \\\n\t\t       \"]\\n\", \\\n\t\t       __STRING(func), __location__, __STRING(func), \\\n\t\t       str, diff, base, res, _v, _ep, _p, (int)(diff - (_ep - _p)), diff); \\\n\t\treturn false; \\\n\t} \\\n} while (0)\n\nstatic int test_strtoll(void)\n{\n\tprintf(\"test: strtoll\\n\");\n\n#define TEST_STRTOLL(str,base,res,diff,errnoo) TEST_STRTO_X(long long int, \"%lld\", strtoll,str,base,res,diff,errnoo)\n\n\tTEST_STRTOLL(\"15\",\t10,\t15LL,\t2, 0);\n\tTEST_STRTOLL(\"  15\",\t10,\t15LL,\t4, 0);\n\tTEST_STRTOLL(\"15\",\t0,\t15LL,\t2, 0);\n\tTEST_STRTOLL(\" 15 \",\t0,\t15LL,\t3, 0);\n\tTEST_STRTOLL(\"+15\",\t10,\t15LL,\t3, 0);\n\tTEST_STRTOLL(\"  +15\",\t10,\t15LL,\t5, 0);\n\tTEST_STRTOLL(\"+15\",\t0,\t15LL,\t3, 0);\n\tTEST_STRTOLL(\" +15 \",\t0,\t15LL,\t4, 0);\n\tTEST_STRTOLL(\"-15\",\t10,\t-15LL,\t3, 0);\n\tTEST_STRTOLL(\"  -15\",\t10,\t-15LL,\t5, 0);\n\tTEST_STRTOLL(\"-15\",\t0,\t-15LL,\t3, 0);\n\tTEST_STRTOLL(\" -15 \",\t0,\t-15LL,\t4, 0);\n\tTEST_STRTOLL(\"015\",\t10,\t15LL,\t3, 0);\n\tTEST_STRTOLL(\"  015\",\t10,\t15LL,\t5, 0);\n\tTEST_STRTOLL(\"015\",\t0,\t13LL,\t3, 0);\n\tTEST_STRTOLL(\"  015\",\t0,\t13LL,\t5, 0);\n\tTEST_STRTOLL(\"0x15\",\t10,\t0LL,\t1, 0);\n\tTEST_STRTOLL(\"  0x15\",\t10,\t0LL,\t3, 0);\n\tTEST_STRTOLL(\"0x15\",\t0,\t21LL,\t4, 0);\n\tTEST_STRTOLL(\"  0x15\",\t0,\t21LL,\t6, 0);\n\n\tTEST_STRTOLL(\"10\",\t16,\t16LL,\t2, 0);\n\tTEST_STRTOLL(\"  10 \",\t16,\t16LL,\t4, 0);\n\tTEST_STRTOLL(\"0x10\",\t16,\t16LL,\t4, 0);\n\tTEST_STRTOLL(\"0x10\",\t0,\t16LL,\t4, 0);\n\tTEST_STRTOLL(\" 0x10 \",\t0,\t16LL,\t5, 0);\n\tTEST_STRTOLL(\"+10\",\t16,\t16LL,\t3, 0);\n\tTEST_STRTOLL(\"  +10 \",\t16,\t16LL,\t5, 0);\n\tTEST_STRTOLL(\"+0x10\",\t16,\t16LL,\t5, 0);\n\tTEST_STRTOLL(\"+0x10\",\t0,\t16LL,\t5, 0);\n\tTEST_STRTOLL(\" +0x10 \",\t0,\t16LL,\t6, 0);\n\tTEST_STRTOLL(\"-10\",\t16,\t-16LL,\t3, 0);\n\tTEST_STRTOLL(\"  -10 \",\t16,\t-16LL,\t5, 0);\n\tTEST_STRTOLL(\"-0x10\",\t16,\t-16LL,\t5, 0);\n\tTEST_STRTOLL(\"-0x10\",\t0,\t-16LL,\t5, 0);\n\tTEST_STRTOLL(\" -0x10 \",\t0,\t-16LL,\t6, 0);\n\tTEST_STRTOLL(\"010\",\t16,\t16LL,\t3, 0);\n\tTEST_STRTOLL(\"  010 \",\t16,\t16LL,\t5, 0);\n\tTEST_STRTOLL(\"-010\",\t16,\t-16LL,\t4, 0);\n\n\tTEST_STRTOLL(\"11\",\t8,\t9LL,\t2, 0);\n\tTEST_STRTOLL(\"011\",\t8,\t9LL,\t3, 0);\n\tTEST_STRTOLL(\"011\",\t0,\t9LL,\t3, 0);\n\tTEST_STRTOLL(\"-11\",\t8,\t-9LL,\t3, 0);\n\tTEST_STRTOLL(\"-011\",\t8,\t-9LL,\t4, 0);\n\tTEST_STRTOLL(\"-011\",\t0,\t-9LL,\t4, 0);\n\n\tTEST_STRTOLL(\"011\",\t8,\t9LL,\t3, 0);\n\tTEST_STRTOLL(\"011\",\t0,\t9LL,\t3, 0);\n\tTEST_STRTOLL(\"-11\",\t8,\t-9LL,\t3, 0);\n\tTEST_STRTOLL(\"-011\",\t8,\t-9LL,\t4, 0);\n\tTEST_STRTOLL(\"-011\",\t0,\t-9LL,\t4, 0);\n\n\tTEST_STRTOLL(\"Text\",\t0,\t0LL,\t0, 0);\n\n\tTEST_STRTOLL(\"9223372036854775807\",\t10,\t9223372036854775807LL,\t19, 0);\n\tTEST_STRTOLL(\"9223372036854775807\",\t0,\t9223372036854775807LL,\t19, 0);\n\tTEST_STRTOLL(\"9223372036854775808\",\t0,\t9223372036854775807LL,\t19, ERANGE);\n\tTEST_STRTOLL(\"9223372036854775808\",\t10,\t9223372036854775807LL,\t19, ERANGE);\n\tTEST_STRTOLL(\"0x7FFFFFFFFFFFFFFF\",\t0,\t9223372036854775807LL,\t18, 0);\n\tTEST_STRTOLL(\"0x7FFFFFFFFFFFFFFF\",\t16,\t9223372036854775807LL,\t18, 0);\n\tTEST_STRTOLL(\"7FFFFFFFFFFFFFFF\",\t16,\t9223372036854775807LL,\t16, 0);\n\tTEST_STRTOLL(\"0x8000000000000000\",\t0,\t9223372036854775807LL,\t18, ERANGE);\n\tTEST_STRTOLL(\"0x8000000000000000\",\t16,\t9223372036854775807LL,\t18, ERANGE);\n\tTEST_STRTOLL(\"80000000000000000\",\t16,\t9223372036854775807LL,\t17, ERANGE);\n\tTEST_STRTOLL(\"0777777777777777777777\",\t0,\t9223372036854775807LL,\t22, 0);\n\tTEST_STRTOLL(\"0777777777777777777777\",\t8,\t9223372036854775807LL,\t22, 0);\n\tTEST_STRTOLL(\"777777777777777777777\",\t8,\t9223372036854775807LL,\t21, 0);\n\tTEST_STRTOLL(\"01000000000000000000000\",\t0,\t9223372036854775807LL,\t23, ERANGE);\n\tTEST_STRTOLL(\"01000000000000000000000\",\t8,\t9223372036854775807LL,\t23, ERANGE);\n\tTEST_STRTOLL(\"1000000000000000000000\",\t8,\t9223372036854775807LL,\t22, ERANGE);\n\n\tTEST_STRTOLL(\"-9223372036854775808\",\t10,\t-9223372036854775807LL -1,\t20, 0);\n\tTEST_STRTOLL(\"-9223372036854775808\",\t0,\t-9223372036854775807LL -1,\t20, 0);\n\tTEST_STRTOLL(\"-9223372036854775809\",\t0,\t-9223372036854775807LL -1,\t20, ERANGE);\n\tTEST_STRTOLL(\"-9223372036854775809\",\t10,\t-9223372036854775807LL -1,\t20, ERANGE);\n\tTEST_STRTOLL(\"-0x8000000000000000\",\t0,\t-9223372036854775807LL -1,\t19, 0);\n\tTEST_STRTOLL(\"-0x8000000000000000\",\t16,\t-9223372036854775807LL -1,\t19, 0);\n\tTEST_STRTOLL(\"-8000000000000000\",\t16,\t-9223372036854775807LL -1,\t17, 0);\n\tTEST_STRTOLL(\"-0x8000000000000001\",\t0,\t-9223372036854775807LL -1,\t19, ERANGE);\n\tTEST_STRTOLL(\"-0x8000000000000001\",\t16,\t-9223372036854775807LL -1,\t19, ERANGE);\n\tTEST_STRTOLL(\"-80000000000000001\",\t16,\t-9223372036854775807LL -1,\t18, ERANGE);\n\tTEST_STRTOLL(\"-01000000000000000000000\",0,\t-9223372036854775807LL -1,\t24, 0);\n\tTEST_STRTOLL(\"-01000000000000000000000\",8,\t-9223372036854775807LL -1,\t24, 0);\n\tTEST_STRTOLL(\"-1000000000000000000000\",\t8,\t-9223372036854775807LL -1,\t23, 0);\n\tTEST_STRTOLL(\"-01000000000000000000001\",0,\t-9223372036854775807LL -1,\t24, ERANGE);\n\tTEST_STRTOLL(\"-01000000000000000000001\",8,\t-9223372036854775807LL -1,\t24, ERANGE);\n\tTEST_STRTOLL(\"-1000000000000000000001\",\t8,\t-9223372036854775807LL -1,\t23, ERANGE);\n\n\tprintf(\"success: strtoll\\n\");\n\treturn true;\n}\n\nstatic int test_strtoull(void)\n{\n\tprintf(\"test: strtoull\\n\");\n\n#define TEST_STRTOULL(str,base,res,diff,errnoo) TEST_STRTO_X(long long unsigned int,\"%llu\",strtoull,str,base,res,diff,errnoo)\n\n\tTEST_STRTOULL(\"15\",\t10,\t15LLU,\t2, 0);\n\tTEST_STRTOULL(\"  15\",\t10,\t15LLU,\t4, 0);\n\tTEST_STRTOULL(\"15\",\t0,\t15LLU,\t2, 0);\n\tTEST_STRTOULL(\" 15 \",\t0,\t15LLU,\t3, 0);\n\tTEST_STRTOULL(\"+15\",\t10,\t15LLU,\t3, 0);\n\tTEST_STRTOULL(\"  +15\",\t10,\t15LLU,\t5, 0);\n\tTEST_STRTOULL(\"+15\",\t0,\t15LLU,\t3, 0);\n\tTEST_STRTOULL(\" +15 \",\t0,\t15LLU,\t4, 0);\n\tTEST_STRTOULL(\"-15\",\t10,\t18446744073709551601LLU,\t3, 0);\n\tTEST_STRTOULL(\"  -15\",\t10,\t18446744073709551601LLU,\t5, 0);\n\tTEST_STRTOULL(\"-15\",\t0,\t18446744073709551601LLU,\t3, 0);\n\tTEST_STRTOULL(\" -15 \",\t0,\t18446744073709551601LLU,\t4, 0);\n\tTEST_STRTOULL(\"015\",\t10,\t15LLU,\t3, 0);\n\tTEST_STRTOULL(\"  015\",\t10,\t15LLU,\t5, 0);\n\tTEST_STRTOULL(\"015\",\t0,\t13LLU,\t3, 0);\n\tTEST_STRTOULL(\"  015\",\t0,\t13LLU,\t5, 0);\n\tTEST_STRTOULL(\"0x15\",\t10,\t0LLU,\t1, 0);\n\tTEST_STRTOULL(\"  0x15\",\t10,\t0LLU,\t3, 0);\n\tTEST_STRTOULL(\"0x15\",\t0,\t21LLU,\t4, 0);\n\tTEST_STRTOULL(\"  0x15\",\t0,\t21LLU,\t6, 0);\n\n\tTEST_STRTOULL(\"10\",\t16,\t16LLU,\t2, 0);\n\tTEST_STRTOULL(\"  10 \",\t16,\t16LLU,\t4, 0);\n\tTEST_STRTOULL(\"0x10\",\t16,\t16LLU,\t4, 0);\n\tTEST_STRTOULL(\"0x10\",\t0,\t16LLU,\t4, 0);\n\tTEST_STRTOULL(\" 0x10 \",\t0,\t16LLU,\t5, 0);\n\tTEST_STRTOULL(\"+10\",\t16,\t16LLU,\t3, 0);\n\tTEST_STRTOULL(\"  +10 \",\t16,\t16LLU,\t5, 0);\n\tTEST_STRTOULL(\"+0x10\",\t16,\t16LLU,\t5, 0);\n\tTEST_STRTOULL(\"+0x10\",\t0,\t16LLU,\t5, 0);\n\tTEST_STRTOULL(\" +0x10 \",\t0,\t16LLU,\t6, 0);\n\tTEST_STRTOULL(\"-10\",\t16,\t-16LLU,\t3, 0);\n\tTEST_STRTOULL(\"  -10 \",\t16,\t-16LLU,\t5, 0);\n\tTEST_STRTOULL(\"-0x10\",\t16,\t-16LLU,\t5, 0);\n\tTEST_STRTOULL(\"-0x10\",\t0,\t-16LLU,\t5, 0);\n\tTEST_STRTOULL(\" -0x10 \",\t0,\t-16LLU,\t6, 0);\n\tTEST_STRTOULL(\"010\",\t16,\t16LLU,\t3, 0);\n\tTEST_STRTOULL(\"  010 \",\t16,\t16LLU,\t5, 0);\n\tTEST_STRTOULL(\"-010\",\t16,\t-16LLU,\t4, 0);\n\n\tTEST_STRTOULL(\"11\",\t8,\t9LLU,\t2, 0);\n\tTEST_STRTOULL(\"011\",\t8,\t9LLU,\t3, 0);\n\tTEST_STRTOULL(\"011\",\t0,\t9LLU,\t3, 0);\n\tTEST_STRTOULL(\"-11\",\t8,\t-9LLU,\t3, 0);\n\tTEST_STRTOULL(\"-011\",\t8,\t-9LLU,\t4, 0);\n\tTEST_STRTOULL(\"-011\",\t0,\t-9LLU,\t4, 0);\n\n\tTEST_STRTOULL(\"011\",\t8,\t9LLU,\t3, 0);\n\tTEST_STRTOULL(\"011\",\t0,\t9LLU,\t3, 0);\n\tTEST_STRTOULL(\"-11\",\t8,\t-9LLU,\t3, 0);\n\tTEST_STRTOULL(\"-011\",\t8,\t-9LLU,\t4, 0);\n\tTEST_STRTOULL(\"-011\",\t0,\t-9LLU,\t4, 0);\n\n\tTEST_STRTOULL(\"Text\",\t0,\t0LLU,\t0, 0);\n\n\tTEST_STRTOULL(\"9223372036854775807\",\t10,\t9223372036854775807LLU,\t19, 0);\n\tTEST_STRTOULL(\"9223372036854775807\",\t0,\t9223372036854775807LLU,\t19, 0);\n\tTEST_STRTOULL(\"9223372036854775808\",\t0,\t9223372036854775808LLU,\t19, 0);\n\tTEST_STRTOULL(\"9223372036854775808\",\t10,\t9223372036854775808LLU,\t19, 0);\n\tTEST_STRTOULL(\"0x7FFFFFFFFFFFFFFF\",\t0,\t9223372036854775807LLU,\t18, 0);\n\tTEST_STRTOULL(\"0x7FFFFFFFFFFFFFFF\",\t16,\t9223372036854775807LLU,\t18, 0);\n\tTEST_STRTOULL(\"7FFFFFFFFFFFFFFF\",\t16,\t9223372036854775807LLU,\t16, 0);\n\tTEST_STRTOULL(\"0x8000000000000000\",\t0,\t9223372036854775808LLU,\t18, 0);\n\tTEST_STRTOULL(\"0x8000000000000000\",\t16,\t9223372036854775808LLU,\t18, 0);\n\tTEST_STRTOULL(\"8000000000000000\",\t16,\t9223372036854775808LLU,\t16, 0);\n\tTEST_STRTOULL(\"0777777777777777777777\",\t0,\t9223372036854775807LLU,\t22, 0);\n\tTEST_STRTOULL(\"0777777777777777777777\",\t8,\t9223372036854775807LLU,\t22, 0);\n\tTEST_STRTOULL(\"777777777777777777777\",\t8,\t9223372036854775807LLU,\t21, 0);\n\tTEST_STRTOULL(\"01000000000000000000000\",0,\t9223372036854775808LLU,\t23, 0);\n\tTEST_STRTOULL(\"01000000000000000000000\",8,\t9223372036854775808LLU,\t23, 0);\n\tTEST_STRTOULL(\"1000000000000000000000\",\t8,\t9223372036854775808LLU,\t22, 0);\n\n\tTEST_STRTOULL(\"-9223372036854775808\",\t10,\t9223372036854775808LLU,\t20, 0);\n\tTEST_STRTOULL(\"-9223372036854775808\",\t0,\t9223372036854775808LLU,\t20, 0);\n\tTEST_STRTOULL(\"-9223372036854775809\",\t0,\t9223372036854775807LLU,\t20, 0);\n\tTEST_STRTOULL(\"-9223372036854775809\",\t10,\t9223372036854775807LLU,\t20, 0);\n\tTEST_STRTOULL(\"-0x8000000000000000\",\t0,\t9223372036854775808LLU,\t19, 0);\n\tTEST_STRTOULL(\"-0x8000000000000000\",\t16,\t9223372036854775808LLU,\t19, 0);\n\tTEST_STRTOULL(\"-8000000000000000\",\t16,\t9223372036854775808LLU,\t17, 0);\n\tTEST_STRTOULL(\"-0x8000000000000001\",\t0,\t9223372036854775807LLU,\t19, 0);\n\tTEST_STRTOULL(\"-0x8000000000000001\",\t16,\t9223372036854775807LLU,\t19, 0);\n\tTEST_STRTOULL(\"-8000000000000001\",\t16,\t9223372036854775807LLU,\t17, 0);\n\tTEST_STRTOULL(\"-01000000000000000000000\",0,\t9223372036854775808LLU,\t24, 0);\n\tTEST_STRTOULL(\"-01000000000000000000000\",8,\t9223372036854775808LLU,\t24, 0);\n\tTEST_STRTOULL(\"-1000000000000000000000\",8,\t9223372036854775808LLU,\t23, 0);\n\tTEST_STRTOULL(\"-01000000000000000000001\",0,\t9223372036854775807LLU,\t24, 0);\n\tTEST_STRTOULL(\"-01000000000000000000001\",8,\t9223372036854775807LLU,\t24, 0);\n\tTEST_STRTOULL(\"-1000000000000000000001\",8,\t9223372036854775807LLU,\t23, 0);\n\n\tTEST_STRTOULL(\"18446744073709551615\",\t0,\t18446744073709551615LLU,\t20, 0);\n\tTEST_STRTOULL(\"18446744073709551615\",\t10,\t18446744073709551615LLU,\t20, 0);\n\tTEST_STRTOULL(\"18446744073709551616\",\t0,\t18446744073709551615LLU,\t20, ERANGE);\n\tTEST_STRTOULL(\"18446744073709551616\",\t10,\t18446744073709551615LLU,\t20, ERANGE);\n\tTEST_STRTOULL(\"0xFFFFFFFFFFFFFFFF\",\t0,\t18446744073709551615LLU,\t18, 0);\n\tTEST_STRTOULL(\"0xFFFFFFFFFFFFFFFF\",\t16,\t18446744073709551615LLU,\t18, 0);\n\tTEST_STRTOULL(\"FFFFFFFFFFFFFFFF\",\t16,\t18446744073709551615LLU,\t16, 0);\n\tTEST_STRTOULL(\"0x10000000000000000\",\t0,\t18446744073709551615LLU,\t19, ERANGE);\n\tTEST_STRTOULL(\"0x10000000000000000\",\t16,\t18446744073709551615LLU,\t19, ERANGE);\n\tTEST_STRTOULL(\"10000000000000000\",\t16,\t18446744073709551615LLU,\t17, ERANGE);\n\tTEST_STRTOULL(\"01777777777777777777777\",0,\t18446744073709551615LLU,\t23, 0);\n\tTEST_STRTOULL(\"01777777777777777777777\",8,\t18446744073709551615LLU,\t23, 0);\n\tTEST_STRTOULL(\"1777777777777777777777\",\t8,\t18446744073709551615LLU,\t22, 0);\n\tTEST_STRTOULL(\"02000000000000000000000\",0,\t18446744073709551615LLU,\t23, ERANGE);\n\tTEST_STRTOULL(\"02000000000000000000000\",8,\t18446744073709551615LLU,\t23, ERANGE);\n\tTEST_STRTOULL(\"2000000000000000000000\",\t8,\t18446744073709551615LLU,\t22, ERANGE);\n\n\tTEST_STRTOULL(\"-18446744073709551615\",\t0,\t1LLU,\t\t\t\t21, 0);\n\tTEST_STRTOULL(\"-18446744073709551615\",\t10,\t1LLU,\t\t\t\t21, 0);\n\tTEST_STRTOULL(\"-18446744073709551616\",\t0,\t18446744073709551615LLU,\t21, ERANGE);\n\tTEST_STRTOULL(\"-18446744073709551616\",\t10,\t18446744073709551615LLU,\t21, ERANGE);\n\tTEST_STRTOULL(\"-0xFFFFFFFFFFFFFFFF\",\t0,\t1LLU,\t\t\t\t19, 0);\n\tTEST_STRTOULL(\"-0xFFFFFFFFFFFFFFFF\",\t16,\t1LLU,\t\t\t\t19, 0);\n\tTEST_STRTOULL(\"-FFFFFFFFFFFFFFFF\",\t16,\t1LLU,\t\t\t\t17, 0);\n\tTEST_STRTOULL(\"-0x10000000000000000\",\t0,\t18446744073709551615LLU,\t20, ERANGE);\n\tTEST_STRTOULL(\"-0x10000000000000000\",\t16,\t18446744073709551615LLU,\t20, ERANGE);\n\tTEST_STRTOULL(\"-10000000000000000\",\t16,\t18446744073709551615LLU,\t18, ERANGE);\n\tTEST_STRTOULL(\"-01777777777777777777777\",0,\t1LLU,\t\t\t\t24, 0);\n\tTEST_STRTOULL(\"-01777777777777777777777\",8,\t1LLU,\t\t\t\t24, 0);\n\tTEST_STRTOULL(\"-1777777777777777777777\",8,\t1LLU,\t\t\t\t23, 0);\n\tTEST_STRTOULL(\"-02000000000000000000000\",0,\t18446744073709551615LLU,\t24, ERANGE);\n\tTEST_STRTOULL(\"-02000000000000000000000\",8,\t18446744073709551615LLU,\t24, ERANGE);\n\tTEST_STRTOULL(\"-2000000000000000000000\",8,\t18446744073709551615LLU,\t23, ERANGE);\n\n\tprintf(\"success: strtoull\\n\");\n\treturn true;\n}\n\n/*\nFIXME:\nTypes:\nbool\nsocklen_t\nuint{8,16,32,64}_t\nint{8,16,32,64}_t\nintptr_t\n\nConstants:\nPATH_NAME_MAX\nUINT{16,32,64}_MAX\nINT32_MAX\n*/\n\nstatic int test_va_copy(void)\n{\n\t/* FIXME */\n\treturn true;\n}\n\nstatic int test_FUNCTION(void)\n{\n\tprintf(\"test: FUNCTION\\n\");\n\tif (strcmp(__FUNCTION__, \"test_FUNCTION\") != 0) {\n\t\tprintf(\"failure: FUNCTION [\\nFUNCTION invalid\\n]\\n\");\n\t\treturn false;\n\t}\n\tprintf(\"success: FUNCTION\\n\");\n\treturn true;\n}\n\nstatic int test_MIN(void)\n{\n\tprintf(\"test: MIN\\n\");\n\tif (MIN(20, 1) != 1) {\n\t\tprintf(\"failure: MIN [\\nMIN invalid\\n]\\n\");\n\t\treturn false;\n\t}\n\tif (MIN(1, 20) != 1) {\n\t\tprintf(\"failure: MIN [\\nMIN invalid\\n]\\n\");\n\t\treturn false;\n\t}\n\tprintf(\"success: MIN\\n\");\n\treturn true;\n}\n\nstatic int test_MAX(void)\n{\n\tprintf(\"test: MAX\\n\");\n\tif (MAX(20, 1) != 20) {\n\t\tprintf(\"failure: MAX [\\nMAX invalid\\n]\\n\");\n\t\treturn false;\n\t}\n\tif (MAX(1, 20) != 20) {\n\t\tprintf(\"failure: MAX [\\nMAX invalid\\n]\\n\");\n\t\treturn false;\n\t}\n\tprintf(\"success: MAX\\n\");\n\treturn true;\n}\n\nstatic int test_socketpair(void)\n{\n\tint sock[2];\n\tchar buf[20];\n\n\tprintf(\"test: socketpair\\n\");\n\n\tif (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) == -1) {\n\t\tprintf(\"failure: socketpair [\\n\"\n\t\t\t   \"socketpair() failed\\n\"\n\t\t\t   \"]\\n\");\n\t\treturn false;\n\t}\n\n\tif (write(sock[1], \"automatisch\", 12) != 12) {\n\t\tprintf(\"failure: socketpair [\\n\"\n\t\t\t   \"write() failed: %s\\n\"\n\t\t\t   \"]\\n\", strerror(errno));\n\t\treturn false;\n\t}\n\n\tif (read(sock[0], buf, 12) != 12) {\n\t\tprintf(\"failure: socketpair [\\n\"\n\t\t\t   \"read() failed: %s\\n\"\n\t\t\t   \"]\\n\", strerror(errno));\n\t\treturn false;\n\t}\n\n\tif (strcmp(buf, \"automatisch\") != 0) {\n\t\tprintf(\"failure: socketpair [\\n\"\n\t\t\t   \"expected: automatisch, got: %s\\n\"\n\t\t\t   \"]\\n\", buf);\n\t\treturn false;\n\t}\n\n\tprintf(\"success: socketpair\\n\");\n\n\treturn true;\n}\n\nextern int libreplace_test_strptime(void);\n\nstatic int test_strptime(void)\n{\n\treturn libreplace_test_strptime();\n}\n\nextern int getifaddrs_test(void);\n\nstatic int test_getifaddrs(void)\n{\n\n\tprintf(\"test: getifaddrs\\n\");\n\n\tif (getifaddrs_test() != 0) {\n\t\tprintf(\"failure: getifaddrs\\n\");\n\t\treturn false;\n\t}\n\n\tprintf(\"success: getifaddrs\\n\");\n\treturn true;\n}\n\nstatic int test_utime(void)\n{\n\tstruct utimbuf u;\n\tstruct stat st1, st2, st3;\n\tint fd;\n\n\tprintf(\"test: utime\\n\");\n\tunlink(TESTFILE);\n\n\tfd = open(TESTFILE, O_RDWR|O_CREAT, 0600);\n\tif (fd == -1) {\n\t\tprintf(\"failure: utime [\\n\"\n\t\t       \"creating '%s' failed - %s\\n]\\n\",\n\t\t       TESTFILE, strerror(errno));\n\t\treturn false;\n\t}\n\n\tif (fstat(fd, &st1) != 0) {\n\t\tprintf(\"failure: utime [\\n\"\n\t\t       \"fstat (1) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n\tu.actime = st1.st_atime + 300;\n\tu.modtime = st1.st_mtime - 300;\n\tif (utime(TESTFILE, &u) != 0) {\n\t\tprintf(\"failure: utime [\\n\"\n\t\t       \"utime(&u) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n\tif (fstat(fd, &st2) != 0) {\n\t\tprintf(\"failure: utime [\\n\"\n\t\t       \"fstat (2) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n\tif (utime(TESTFILE, NULL) != 0) {\n\t\tprintf(\"failure: utime [\\n\"\n\t\t       \"utime(NULL) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n\tif (fstat(fd, &st3) != 0) {\n\t\tprintf(\"failure: utime [\\n\"\n\t\t       \"fstat (3) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n#define CMP_VAL(a,c,b) do { \\\n\tif (a c b) { \\\n\t\tprintf(\"failure: utime [\\n\" \\\n\t\t       \"%s: %s(%d) %s %s(%d)\\n]\\n\", \\\n\t\t       __location__, \\\n\t\t       #a, (int)a, #c, #b, (int)b); \\\n\t\tclose(fd); \\\n\t\treturn false; \\\n\t} \\\n} while(0)\n#define EQUAL_VAL(a,b) CMP_VAL(a,!=,b)\n#define GREATER_VAL(a,b) CMP_VAL(a,<=,b)\n#define LESSER_VAL(a,b) CMP_VAL(a,>=,b)\n\n\tEQUAL_VAL(st2.st_atime, st1.st_atime + 300);\n\tEQUAL_VAL(st2.st_mtime, st1.st_mtime - 300);\n\tLESSER_VAL(st3.st_atime, st2.st_atime);\n\tGREATER_VAL(st3.st_mtime, st2.st_mtime);\n\n#undef CMP_VAL\n#undef EQUAL_VAL\n#undef GREATER_VAL\n#undef LESSER_VAL\n\n\tunlink(TESTFILE);\n\tprintf(\"success: utime\\n\");\n\tclose(fd);\n\treturn true;\n}\n\nstatic int test_utimes(void)\n{\n\tstruct timeval tv[2];\n\tstruct stat st1, st2;\n\tint fd;\n\n\tprintf(\"test: utimes\\n\");\n\tunlink(TESTFILE);\n\n\tfd = open(TESTFILE, O_RDWR|O_CREAT, 0600);\n\tif (fd == -1) {\n\t\tprintf(\"failure: utimes [\\n\"\n\t\t       \"creating '%s' failed - %s\\n]\\n\",\n\t\t       TESTFILE, strerror(errno));\n\t\treturn false;\n\t}\n\n\tif (fstat(fd, &st1) != 0) {\n\t\tprintf(\"failure: utimes [\\n\"\n\t\t       \"fstat (1) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n\tZERO_STRUCT(tv);\n\ttv[0].tv_sec = st1.st_atime + 300;\n\ttv[1].tv_sec = st1.st_mtime - 300;\n\tif (utimes(TESTFILE, tv) != 0) {\n\t\tprintf(\"failure: utimes [\\n\"\n\t\t       \"utimes(tv) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n\tif (fstat(fd, &st2) != 0) {\n\t\tprintf(\"failure: utimes [\\n\"\n\t\t       \"fstat (2) failed - %s\\n]\\n\",\n\t\t       strerror(errno));\n\t\tclose(fd);\n\t\treturn false;\n\t}\n\n#define EQUAL_VAL(a,b) do { \\\n\tif (a != b) { \\\n\t\tprintf(\"failure: utimes [\\n\" \\\n\t\t       \"%s: %s(%d) != %s(%d)\\n]\\n\", \\\n\t\t       __location__, \\\n\t\t       #a, (int)a, #b, (int)b); \\\n\t\tclose(fd); \\\n\t\treturn false; \\\n\t} \\\n} while(0)\n\n\tEQUAL_VAL(st2.st_atime, st1.st_atime + 300);\n\tEQUAL_VAL(st2.st_mtime, st1.st_mtime - 300);\n\n#undef EQUAL_VAL\n\n\tunlink(TESTFILE);\n\tprintf(\"success: utimes\\n\");\n\tclose(fd);\n\treturn true;\n}\n\nstatic int test_memmem(void)\n{\n\tchar *s;\n\n\tprintf(\"test: memmem\\n\");\n\n\ts = (char *)memmem(\"foo\", 3, \"fo\", 2);\n\tif (strcmp(s, \"foo\") != 0) {\n\t\tprintf(__location__ \": Failed memmem\\n\");\n\t\treturn false;\n\t}\n\n\ts = (char *)memmem(\"foo\", 3, \"\", 0);\n\t/* it is allowable for this to return NULL (as happens on\n\t   FreeBSD) */\n\tif (s && strcmp(s, \"foo\") != 0) {\n\t\tprintf(__location__ \": Failed memmem\\n\");\n\t\treturn false;\n\t}\n\n\ts = (char *)memmem(\"foo\", 4, \"o\", 1);\n\tif (strcmp(s, \"oo\") != 0) {\n\t\tprintf(__location__ \": Failed memmem\\n\");\n\t\treturn false;\n\t}\n\n\ts = (char *)memmem(\"foobarfodx\", 11, \"fod\", 3);\n\tif (strcmp(s, \"fodx\") != 0) {\n\t\tprintf(__location__ \": Failed memmem\\n\");\n\t\treturn false;\n\t}\n\n\tprintf(\"success: memmem\\n\");\n\n\treturn true;\n}\n\nstatic bool test_closefrom(void)\n{\n\tint i, fd;\n\n\tfor (i=0; i<100; i++) {\n\t\tfd = dup(0);\n\t\tif (fd == -1) {\n\t\t\tperror(\"dup failed\");\n\t\t\tclosefrom(3);\n\t\t\treturn false;\n\t\t}\n\n\t\t/* 1000 is just an arbitrarily chosen upper bound */\n\n\t\tif (fd >= 1000) {\n\t\t\tprintf(\"fd=%d\\n\", fd);\n\t\t\tclosefrom(3);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclosefrom(3);\n\n\tfor (i=3; i<=fd; i++) {\n\t\toff_t off;\n\t\toff = lseek(i, 0, SEEK_CUR);\n\t\tif ((off != (off_t)-1) || (errno != EBADF)) {\n\t\t\tprintf(\"fd %d not closed\\n\", i);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nstatic bool test_array_del_element(void)\n{\n\tint a[] = { 1,2,3,4,5 };\n\n\tprintf(\"test: array_del_element\\n\");\n\n\tARRAY_DEL_ELEMENT(a, 4, ARRAY_SIZE(a));\n\n\tif ((a[0] != 1) ||\n\t    (a[1] != 2) ||\n\t    (a[2] != 3) ||\n\t    (a[3] != 4) ||\n\t    (a[4] != 5)) {\n\t\treturn false;\n\t}\n\n\tARRAY_DEL_ELEMENT(a, 0, ARRAY_SIZE(a));\n\n\tif ((a[0] != 2) ||\n\t    (a[1] != 3) ||\n\t    (a[2] != 4) ||\n\t    (a[3] != 5) ||\n\t    (a[4] != 5)) {\n\t\treturn false;\n\t}\n\n\tARRAY_DEL_ELEMENT(a, 2, ARRAY_SIZE(a));\n\n\tif ((a[0] != 2) ||\n\t    (a[1] != 3) ||\n\t    (a[2] != 5) ||\n\t    (a[3] != 5) ||\n\t    (a[4] != 5)) {\n\t\treturn false;\n\t}\n\n\tprintf(\"success: array_del_element\\n\");\n\n\treturn true;\n}\n\nbool torture_local_replace(struct torture_context *ctx)\n{\n\tbool ret = true;\n\tret &= test_ftruncate();\n\tret &= test_strlcpy();\n\tret &= test_strlcat();\n\tret &= test_mktime();\n\tret &= test_initgroups();\n\tret &= test_memmove();\n\tret &= test_strdup();\n\tret &= test_setlinebuf();\n\tret &= test_vsyslog();\n\tret &= test_timegm();\n\tret &= test_setenv();\n\tret &= test_strndup();\n\tret &= test_strnlen();\n\tret &= test_waitpid();\n\tret &= test_seteuid();\n\tret &= test_setegid();\n\tret &= test_asprintf();\n\tret &= test_snprintf();\n\tret &= test_vasprintf();\n\tret &= test_vsnprintf();\n\tret &= test_opendir();\n\tret &= test_readdir();\n\tret &= test_telldir();\n\tret &= test_seekdir();\n\tret &= test_dlopen();\n\tret &= test_chroot();\n\tret &= test_strerror();\n\tret &= test_errno();\n\tret &= test_mkdtemp();\n\tret &= test_mkstemp();\n\tret &= test_pread();\n\tret &= test_pwrite();\n\tret &= test_inet_ntoa();\n\tret &= test_strtoll();\n\tret &= test_strtoull();\n\tret &= test_va_copy();\n\tret &= test_FUNCTION();\n\tret &= test_MIN();\n\tret &= test_MAX();\n\tret &= test_socketpair();\n\tret &= test_strptime();\n\tret &= test_getifaddrs();\n\tret &= test_utime();\n\tret &= test_utimes();\n\tret &= test_memmem();\n\tret &= test_closefrom();\n\tret &= test_array_del_element();\n\n\treturn ret;\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]},
                         {"location": {"uri": "/usr/include/string.h"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/* Copyright (C) 1991-2026 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, see\n   <https://www.gnu.org/licenses/>.  */\n\n/*\n *\tISO C99 Standard: 7.21 String handling\t<string.h>\n */\n\n#ifndef\t_STRING_H\n#define\t_STRING_H\t1\n\n#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION\n#include <bits/libc-header-start.h>\n\n__BEGIN_DECLS\n\n#if __GLIBC_USE (ISOC23)\n# define __STDC_VERSION_STRING_H__ 202311L\n#endif\n\n/* Get size_t and NULL from <stddef.h>.  */\n#define\t__need_size_t\n#define\t__need_NULL\n#include <stddef.h>\n\n/* Tell the caller that we provide correct C++ prototypes.  */\n#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \\\n\t\t\t    || __glibc_clang_prereq (3, 5))\n# define __CORRECT_ISO_CPP_STRING_H_PROTO\n#endif\n\n\n/* Copy N bytes of SRC to DEST.  */\nextern void *memcpy (void *__restrict __dest, const void *__restrict __src,\n\t\t     size_t __n) __THROW __nonnull ((1, 2));\n/* Copy N bytes of SRC to DEST, guaranteeing\n   correct behavior for overlapping strings.  */\nextern void *memmove (void *__dest, const void *__src, size_t __n)\n     __THROW __nonnull ((1, 2));\n\n/* Copy no more than N bytes of SRC to DEST, stopping when C is found.\n   Return the position in DEST one byte past where C was copied,\n   or NULL if C was not found in the first N bytes of SRC.  */\n#if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC23)\nextern void *memccpy (void *__restrict __dest, const void *__restrict __src,\n\t\t      int __c, size_t __n)\n    __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4));\n#endif /* Misc || X/Open.  */\n\n\n/* Set N bytes of S to C.  */\nextern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));\n\n#if defined __USE_MISC || __GLIBC_USE (ISOC23)\n/* Like memset, but the compiler will not delete a call to this\n   function, even if S is dead after the call.  */\nextern void *memset_explicit (void *__s, int __c, size_t __n)\n     __THROW __nonnull ((1)) __fortified_attr_access (__write_only__, 1, 3);\n#endif\n\n/* Compare N bytes of S1 and S2.  */\nextern int memcmp (const void *__s1, const void *__s2, size_t __n)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.\n   Return some non-zero value otherwise.\n\n   Essentially __memcmpeq has the exact same semantics as memcmp\n   except the return value is less constrained.  memcmp is always a\n   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,\n   or bcmp are correct implementations.\n\n   __memcmpeq is meant to be used by compilers when memcmp return is\n   only used for its boolean value.\n\n   __memcmpeq is declared only for use by compilers.  Programs should\n   continue to use memcmp.  */\nextern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Search N bytes of S for C.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern void *memchr (void *__s, int __c, size_t __n)\n      __THROW __asm (\"memchr\") __attribute_pure__ __nonnull ((1));\nextern const void *memchr (const void *__s, int __c, size_t __n)\n      __THROW __asm (\"memchr\") __attribute_pure__ __nonnull ((1));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline void *\nmemchr (void *__s, int __c, size_t __n) __THROW\n{\n  return __builtin_memchr (__s, __c, __n);\n}\n\n__extern_always_inline const void *\nmemchr (const void *__s, int __c, size_t __n) __THROW\n{\n  return __builtin_memchr (__s, __c, __n);\n}\n# endif\n}\n#else\nextern void *memchr (const void *__s, int __c, size_t __n)\n      __THROW __attribute_pure__ __nonnull ((1));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define memchr(S, C, N)\t\t\t\t\t\\\n  __glibc_const_generic (S, const void *, memchr (S, C, N))\n# endif\n#endif\n\n#ifdef __USE_GNU\n/* Search in S for C.  This is similar to `memchr' but there is no\n   length limit.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" void *rawmemchr (void *__s, int __c)\n     __THROW __asm (\"rawmemchr\") __attribute_pure__ __nonnull ((1));\nextern \"C++\" const void *rawmemchr (const void *__s, int __c)\n     __THROW __asm (\"rawmemchr\") __attribute_pure__ __nonnull ((1));\n# else\nextern void *rawmemchr (const void *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# endif\n\n/* Search N bytes of S for the final occurrence of C.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" void *memrchr (void *__s, int __c, size_t __n)\n      __THROW __asm (\"memrchr\") __attribute_pure__ __nonnull ((1))\n      __attr_access ((__read_only__, 1, 3));\nextern \"C++\" const void *memrchr (const void *__s, int __c, size_t __n)\n      __THROW __asm (\"memrchr\") __attribute_pure__ __nonnull ((1))\n      __attr_access ((__read_only__, 1, 3));\n# else\nextern void *memrchr (const void *__s, int __c, size_t __n)\n      __THROW __attribute_pure__ __nonnull ((1))\n      __attr_access ((__read_only__, 1, 3));\n# endif\n#endif\n\n\n/* Copy SRC to DEST.  */\nextern char *strcpy (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\n/* Copy no more than N characters of SRC to DEST.  */\nextern char *strncpy (char *__restrict __dest,\n\t\t      const char *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\n\n/* Append SRC onto DEST.  */\nextern char *strcat (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\n/* Append no more than N characters from SRC onto DEST.  */\nextern char *strncat (char *__restrict __dest, const char *__restrict __src,\n\t\t      size_t __n) __THROW __nonnull ((1, 2));\n\n/* Compare S1 and S2.  */\nextern int strcmp (const char *__s1, const char *__s2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Compare N characters of S1 and S2.  */\nextern int strncmp (const char *__s1, const char *__s2, size_t __n)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Compare the collated forms of S1 and S2.  */\nextern int strcoll (const char *__s1, const char *__s2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Put a transformation of SRC into no more than N bytes of DEST.  */\nextern size_t strxfrm (char *__restrict __dest,\n\t\t       const char *__restrict __src, size_t __n)\n    __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3));\n\n#ifdef __USE_XOPEN2K8\n/* POSIX.1-2008 extended locale interface (see locale.h).  */\n# include <bits/types/locale_t.h>\n\n/* Compare the collated forms of S1 and S2, using sorting rules from L.  */\nextern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)\n     __THROW __attribute_pure__ __nonnull ((1, 2, 3));\n/* Put a transformation of SRC into no more than N bytes of DEST,\n   using sorting rules from L.  */\nextern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,\n\t\t\t locale_t __l) __THROW __nonnull ((2, 4))\n     __attr_access ((__write_only__, 1, 3));\n#endif\n\n#if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8\t\\\n     || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23))\n/* Duplicate S, returning an identical malloc'd string.  */\nextern char *strdup (const char *__s)\n     __THROW __attribute_malloc__ __nonnull ((1));\n#endif\n\n/* Return a malloc'd copy of at most N bytes of STRING.  The\n   resultant string is terminated even if no null terminator\n   appears before STRING[N].  */\n#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23)\nextern char *strndup (const char *__string, size_t __n)\n     __THROW __attribute_malloc__ __nonnull ((1));\n#endif\n\n#if defined __USE_GNU && defined __GNUC__\n/* Duplicate S, returning an identical alloca'd string.  */\n# define strdupa(s)\t\t\t\t\t\t\t      \\\n  (__extension__\t\t\t\t\t\t\t      \\\n    ({\t\t\t\t\t\t\t\t\t      \\\n      const char *__old = (s);\t\t\t\t\t\t      \\\n      size_t __len = strlen (__old) + 1;\t\t\t\t      \\\n      char *__new = (char *) __builtin_alloca (__len);\t\t\t      \\\n      (char *) memcpy (__new, __old, __len);\t\t\t\t      \\\n    }))\n\n/* Return an alloca'd copy of at most N bytes of string.  */\n# define strndupa(s, n)\t\t\t\t\t\t\t      \\\n  (__extension__\t\t\t\t\t\t\t      \\\n    ({\t\t\t\t\t\t\t\t\t      \\\n      const char *__old = (s);\t\t\t\t\t\t      \\\n      size_t __len = strnlen (__old, (n));\t\t\t\t      \\\n      char *__new = (char *) __builtin_alloca (__len + 1);\t\t      \\\n      __new[__len] = '\\0';\t\t\t\t\t\t      \\\n      (char *) memcpy (__new, __old, __len);\t\t\t\t      \\\n    }))\n#endif\n\n/* Find the first occurrence of C in S.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strchr (char *__s, int __c)\n     __THROW __asm (\"strchr\") __attribute_pure__ __nonnull ((1));\nextern const char *strchr (const char *__s, int __c)\n     __THROW __asm (\"strchr\") __attribute_pure__ __nonnull ((1));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrchr (char *__s, int __c) __THROW\n{\n  return __builtin_strchr (__s, __c);\n}\n\n__extern_always_inline const char *\nstrchr (const char *__s, int __c) __THROW\n{\n  return __builtin_strchr (__s, __c);\n}\n# endif\n}\n#else\nextern char *strchr (const char *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strchr(S, C)\t\t\t\t\t\t\\\n  __glibc_const_generic (S, const char *, strchr (S, C))\n# endif\n#endif\n/* Find the last occurrence of C in S.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strrchr (char *__s, int __c)\n     __THROW __asm (\"strrchr\") __attribute_pure__ __nonnull ((1));\nextern const char *strrchr (const char *__s, int __c)\n     __THROW __asm (\"strrchr\") __attribute_pure__ __nonnull ((1));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrrchr (char *__s, int __c) __THROW\n{\n  return __builtin_strrchr (__s, __c);\n}\n\n__extern_always_inline const char *\nstrrchr (const char *__s, int __c) __THROW\n{\n  return __builtin_strrchr (__s, __c);\n}\n# endif\n}\n#else\nextern char *strrchr (const char *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strrchr(S, C)\t\t\t\t\t\t\\\n  __glibc_const_generic (S, const char *, strrchr (S, C))\n# endif\n#endif\n\n#ifdef __USE_MISC\n/* This function is similar to `strchr'.  But it returns a pointer to\n   the closing NUL byte in case C is not found in S.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" char *strchrnul (char *__s, int __c)\n     __THROW __asm (\"strchrnul\") __attribute_pure__ __nonnull ((1));\nextern \"C++\" const char *strchrnul (const char *__s, int __c)\n     __THROW __asm (\"strchrnul\") __attribute_pure__ __nonnull ((1));\n# else\nextern char *strchrnul (const char *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# endif\n#endif\n\n/* Return the length of the initial segment of S which\n   consists entirely of characters not in REJECT.  */\nextern size_t strcspn (const char *__s, const char *__reject)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Return the length of the initial segment of S which\n   consists entirely of characters in ACCEPT.  */\nextern size_t strspn (const char *__s, const char *__accept)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Find the first occurrence in S of any character in ACCEPT.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strpbrk (char *__s, const char *__accept)\n     __THROW __asm (\"strpbrk\") __attribute_pure__ __nonnull ((1, 2));\nextern const char *strpbrk (const char *__s, const char *__accept)\n     __THROW __asm (\"strpbrk\") __attribute_pure__ __nonnull ((1, 2));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrpbrk (char *__s, const char *__accept) __THROW\n{\n  return __builtin_strpbrk (__s, __accept);\n}\n\n__extern_always_inline const char *\nstrpbrk (const char *__s, const char *__accept) __THROW\n{\n  return __builtin_strpbrk (__s, __accept);\n}\n# endif\n}\n#else\nextern char *strpbrk (const char *__s, const char *__accept)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strpbrk(S, ACCEPT)\t\t\t\t\t\\\n  __glibc_const_generic (S, const char *, strpbrk (S, ACCEPT))\n# endif\n#endif\n/* Find the first occurrence of NEEDLE in HAYSTACK.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strstr (char *__haystack, const char *__needle)\n     __THROW __asm (\"strstr\") __attribute_pure__ __nonnull ((1, 2));\nextern const char *strstr (const char *__haystack, const char *__needle)\n     __THROW __asm (\"strstr\") __attribute_pure__ __nonnull ((1, 2));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrstr (char *__haystack, const char *__needle) __THROW\n{\n  return __builtin_strstr (__haystack, __needle);\n}\n\n__extern_always_inline const char *\nstrstr (const char *__haystack, const char *__needle) __THROW\n{\n  return __builtin_strstr (__haystack, __needle);\n}\n# endif\n}\n#else\nextern char *strstr (const char *__haystack, const char *__needle)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strstr(HAYSTACK, NEEDLE)\t\t\t\\\n  __glibc_const_generic (HAYSTACK, const char *,\t\\\n\t\t\t strstr (HAYSTACK, NEEDLE))\n# endif\n#endif\n\n\n/* Divide S into tokens separated by characters in DELIM.  */\nextern char *strtok (char *__restrict __s, const char *__restrict __delim)\n     __THROW __nonnull ((2));\n\n/* Divide S into tokens separated by characters in DELIM.  Information\n   passed between calls are stored in SAVE_PTR.  */\nextern char *__strtok_r (char *__restrict __s,\n\t\t\t const char *__restrict __delim,\n\t\t\t char **__restrict __save_ptr)\n     __THROW __nonnull ((2, 3));\n#ifdef __USE_POSIX\nextern char *strtok_r (char *__restrict __s, const char *__restrict __delim,\n\t\t       char **__restrict __save_ptr)\n     __THROW __nonnull ((2, 3));\n#endif\n\n#ifdef __USE_MISC\n/* Similar to `strstr' but this function ignores the case of both strings.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" char *strcasestr (char *__haystack, const char *__needle)\n     __THROW __asm (\"strcasestr\") __attribute_pure__ __nonnull ((1, 2));\nextern \"C++\" const char *strcasestr (const char *__haystack,\n\t\t\t\t     const char *__needle)\n     __THROW __asm (\"strcasestr\") __attribute_pure__ __nonnull ((1, 2));\n# else\nextern char *strcasestr (const char *__haystack, const char *__needle)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# endif\n#endif\n\n#ifdef __USE_MISC\n/* Find the first occurrence of NEEDLE in HAYSTACK.\n   NEEDLE is NEEDLELEN bytes long;\n   HAYSTACK is HAYSTACKLEN bytes long.  */\nextern void *memmem (const void *__haystack, size_t __haystacklen,\n\t\t     const void *__needle, size_t __needlelen)\n     __THROW __attribute_pure__ __nonnull ((1, 3))\n    __attr_access ((__read_only__, 1, 2))\n    __attr_access ((__read_only__, 3, 4));\n\n/* Copy N bytes of SRC to DEST, return pointer to bytes after the\n   last written byte.  */\nextern void *__mempcpy (void *__restrict __dest,\n\t\t\tconst void *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\nextern void *mempcpy (void *__restrict __dest,\n\t\t      const void *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\n#endif\n\n\n/* Return the length of S.  */\nextern size_t strlen (const char *__s)\n     __THROW __attribute_pure__ __nonnull ((1));\n\n#ifdef\t__USE_XOPEN2K8\n/* Find the length of STRING, but scan at most MAXLEN characters.\n   If no '\\0' terminator is found in that many characters, return MAXLEN.  */\nextern size_t strnlen (const char *__string, size_t __maxlen)\n     __THROW __attribute_pure__ __nonnull ((1));\n#endif\n\n\n/* Return a string describing the meaning of the `errno' code in ERRNUM.  */\nextern char *strerror (int __errnum) __THROW;\n#ifdef __USE_XOPEN2K\n/* Reentrant version of `strerror'.\n   There are 2 flavors of `strerror_r', GNU which returns the string\n   and may or may not use the supplied temporary buffer and POSIX one\n   which fills the string into the buffer.\n   To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L\n   without -D_GNU_SOURCE is needed, otherwise the GNU version is\n   preferred.  */\n# if defined __USE_XOPEN2K && !defined __USE_GNU\n/* Fill BUF with a string describing the meaning of the `errno' code in\n   ERRNUM.  */\n#  ifdef __REDIRECT_NTH\nextern int __REDIRECT_NTH (strerror_r,\n\t\t\t   (int __errnum, char *__buf, size_t __buflen),\n\t\t\t   __xpg_strerror_r) __nonnull ((2))\n    __attr_access ((__write_only__, 2, 3));\n#  else\nextern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)\n     __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3));\n#   define strerror_r __xpg_strerror_r\n#  endif\n# else\n/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be\n   used.  */\nextern char *strerror_r (int __errnum, char *__buf, size_t __buflen)\n     __THROW __nonnull ((2)) __wur  __attr_access ((__write_only__, 2, 3));\n# endif\n\n# ifdef __USE_GNU\n/* Return a string describing the meaning of tthe error in ERR.  */\nextern const char *strerrordesc_np (int __err) __THROW;\n/* Return a string with the error name in ERR.  */\nextern const char *strerrorname_np (int __err) __THROW;\n# endif\n#endif\n\n#ifdef __USE_XOPEN2K8\n/* Translate error number to string according to the locale L.  */\nextern char *strerror_l (int __errnum, locale_t __l) __THROW;\n#endif\n\n#ifdef __USE_MISC\n# include <strings.h>\n\n/* Set N bytes of S to 0.  The compiler will not delete a call to this\n   function, even if S is dead after the call.  */\nextern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1))\n    __fortified_attr_access (__write_only__, 1, 2);\n\n/* Return the next DELIM-delimited token from *STRINGP,\n   terminating it with a '\\0', and update *STRINGP to point past it.  */\nextern char *strsep (char **__restrict __stringp,\n\t\t     const char *__restrict __delim)\n     __THROW __nonnull ((1, 2));\n#endif\n\n#ifdef\t__USE_XOPEN2K8\n/* Return a string describing the meaning of the signal number in SIG.  */\nextern char *strsignal (int __sig) __THROW;\n\n# ifdef __USE_GNU\n/* Return an abbreviation string for the signal number SIG.  */\nextern const char *sigabbrev_np (int __sig) __THROW;\n/* Return a string describing the meaning of the signal number in SIG,\n   the result is not translated.  */\nextern const char *sigdescr_np (int __sig) __THROW;\n# endif\n\n/* Copy SRC to DEST, returning the address of the terminating '\\0' in DEST.  */\nextern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\nextern char *stpcpy (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\n\n/* Copy no more than N characters of SRC to DEST, returning the address of\n   the last character written into DEST.  */\nextern char *__stpncpy (char *__restrict __dest,\n\t\t\tconst char *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\nextern char *stpncpy (char *__restrict __dest,\n\t\t      const char *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\n#endif\n\n#ifdef __USE_MISC\n/* Copy at most N - 1 characters from SRC to DEST.  */\nextern size_t strlcpy (char *__restrict __dest,\n\t\t       const char *__restrict __src, size_t __n)\n  __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 3));\n\n/* Append SRC to DEST, possibly with truncation to keep the total size\n   below N.  */\nextern size_t strlcat (char *__restrict __dest,\n\t\t       const char *__restrict __src, size_t __n)\n  __THROW __nonnull ((1, 2))  __attr_access ((__read_write__, 1, 3));\n#endif\n\n#ifdef\t__USE_GNU\n/* Compare S1 and S2 as strings holding name & indices/version numbers.  */\nextern int strverscmp (const char *__s1, const char *__s2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Sautee STRING briskly.  */\nextern char *strfry (char *__string) __THROW __nonnull ((1));\n\n/* Frobnicate N bytes of S.  */\nextern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1))\n    __attr_access ((__read_write__, 1, 2));\n\n# ifndef basename\n/* Return the file name within directory of FILENAME.  We don't\n   declare the function if the `basename' macro is available (defined\n   in <libgen.h>) which makes the XPG version of this function\n   available.  */\n#  ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" char *basename (char *__filename)\n     __THROW __asm (\"basename\") __nonnull ((1));\nextern \"C++\" const char *basename (const char *__filename)\n     __THROW __asm (\"basename\") __nonnull ((1));\n#  else\nextern char *basename (const char *__filename) __THROW __nonnull ((1));\n#  endif\n# endif\n#endif\n\n#if __GNUC_PREREQ (3,4)\n# if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function\n/* Functions with security checks.  */\n#  include <bits/string_fortified.h>\n# endif\n#endif\n\n__END_DECLS\n\n#endif /* string.h  */\n"},
                          "roles": ["resultFile"]},
                         {"location": {"uri": "../../lib/replace/replace.h",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c"}],
           "results": [{"ruleId": "-Wanalyzer-possible-null-argument",
                        "taxa": [{"id": "690",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 12390},
                                       "gcc/analyzer/saved_diagnostic/var": "x_6",
                                       "gcc/analyzer/saved_diagnostic/sval": "&HEAP_ALLOCATED_REGION(1419)",
                                       "gcc/analyzer/saved_diagnostic/state": "unchecked ({free})",
                                       "gcc/analyzer/saved_diagnostic/idx": 9,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 146},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "x_6",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "&HEAP_ALLOCATED_REGION(1419)",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "unchecked ({free})",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 0,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "possible_null_arg"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "possible_null_arg"},
                        "level": "warning",
                        "message": {"text": "use of possibly-NULL ‘x’ where non-null expected"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 172,
                                                                       "startColumn": 15,
                                                                       "endColumn": 31},
                                                            "contextRegion": {"startLine": 172,
                                                                              "snippet": {"text": "\tcmp = strcmp(\"bla\", x);\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "test_strdup"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 170,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 26},
                                                                                                         "contextRegion": {"startLine": 170,
                                                                                                                           "snippet": {"text": "\tx = strdup(\"bla\");\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_strdup"}],
                                                                                    "message": {"text": "this call could return NULL"}},
                                                                       "kinds": ["acquire",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 172,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 31},
                                                                                                         "contextRegion": {"startLine": 172,
                                                                                                                           "snippet": {"text": "\tcmp = strcmp(\"bla\", x);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_strdup"}],
                                                                                    "message": {"text": "argument 2 (‘x’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2}]}]}],
                        "relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "/usr/include/string.h"},
                                                                   "region": {"startLine": 171,
                                                                              "startColumn": 12,
                                                                              "endColumn": 18},
                                                                   "contextRegion": {"startLine": 171,
                                                                                     "snippet": {"text": "extern int strcmp (const char *__s1, const char *__s2)\n"}}},
                                              "message": {"text": "argument 2 of ‘strcmp’ must be non-null"},
                                              "properties": {"nestingLevel": 0},
                                              "id": 0,
                                              "relationships": [{"target": 1,
                                                                 "kinds": ["isIncludedBy"]}]},
                                             {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/replace.h",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 176},
                                                                   "contextRegion": {"startLine": 176,
                                                                                     "snippet": {"text": "#include <string.h>\n"}}},
                                              "relationships": [{"target": 0,
                                                                 "kinds": ["includes"]},
                                                                {"target": 2,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 1},
                                             {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 26},
                                                                   "contextRegion": {"startLine": 26,
                                                                                     "snippet": {"text": "#include \"replace.h\"\n"}}},
                                              "relationships": [{"target": 1,
                                                                 "kinds": ["includes"]}],
                                              "id": 2}]},
                       {"ruleId": "-Wanalyzer-fd-leak",
                        "taxa": [{"id": "775",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 6296},
                                       "gcc/analyzer/saved_diagnostic/var": "fd_18",
                                       "gcc/analyzer/saved_diagnostic/sval": "CONJURED(fd_18 = dup (0);, fd_18)",
                                       "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                       "gcc/analyzer/saved_diagnostic/idx": 3,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 6296},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "fd_18",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "CONJURED(fd_18 = dup (0);, fd_18)",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 4,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "fd_leak"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "fd_leak"},
                        "level": "warning",
                        "message": {"text": "leak of file descriptor ‘fd’"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 189,
                                                                       "startColumn": 16,
                                                                       "endColumn": 17},
                                                            "contextRegion": {"startLine": 189,
                                                                              "snippet": {"text": "\treturn true;\n"}}},
                                       "logicalLocations": [{"index": 1,
                                                             "fullyQualifiedName": "test_closefrom"}],
                                       "id": 0,
                                       "relationships": [{"target": 1,
                                                          "kinds": ["isIncludedBy"]}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1174,
                                                                                                                    "startColumn": 6,
                                                                                                                    "endColumn": 27},
                                                                                                         "contextRegion": {"startLine": 1174,
                                                                                                                           "snippet": {"text": "bool torture_local_replace(struct torture_context *ctx)\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "torture_local_replace"}],
                                                                                    "message": {"text": "entry to ‘torture_local_replace’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 3,
                                                                                                                                 "dst_id": 4}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1178,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 1178,
                                                                                                                           "snippet": {"text": "\tret &= test_strlcpy();\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "torture_local_replace"}],
                                                                                    "message": {"text": "calling ‘test_strlcpy’ from ‘torture_local_replace’"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 95,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 24},
                                                                                                         "contextRegion": {"startLine": 95,
                                                                                                                           "snippet": {"text": "static int test_strlcpy(void)\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "test_strlcpy"}],
                                                                                    "message": {"text": "entry to ‘test_strlcpy’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 6168,
                                                                                                                                 "dst_id": 6169}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 110,
                                                                                                                    "startColumn": 18,
                                                                                                                    "endColumn": 23},
                                                                                                         "contextRegion": {"startLine": 110,
                                                                                                                           "snippet": {"text": "\tfor (i=0;tests[i].src;i++) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "test_strlcpy"}],
                                                                                    "message": {"text": "following ‘true’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 6168,
                                                                                                                                 "dst_id": 6169}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 21,
                                                                                                                    "endColumn": 60},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\t\tif (strlcpy(buf, tests[i].src, sizeof(buf)) != tests[i].result) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "test_strlcpy"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1178,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 1178,
                                                                                                                           "snippet": {"text": "\tret &= test_strlcpy();\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "torture_local_replace"}],
                                                                                    "message": {"text": "returning to ‘torture_local_replace’ from ‘test_strlcpy’"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 47,
                                                                                                                                 "dst_id": 48}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1222,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 32},
                                                                                                         "contextRegion": {"startLine": 1222,
                                                                                                                           "snippet": {"text": "\tret &= test_closefrom();\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "torture_local_replace"}],
                                                                                    "message": {"text": "calling ‘test_closefrom’ from ‘torture_local_replace’"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1098,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 27},
                                                                                                         "contextRegion": {"startLine": 1098,
                                                                                                                           "snippet": {"text": "static bool test_closefrom(void)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "entry to ‘test_closefrom’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 58,
                                                                                                                                 "dst_id": 59}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1102,
                                                                                                                    "startColumn": 19,
                                                                                                                    "endColumn": 24},
                                                                                                         "contextRegion": {"startLine": 1102,
                                                                                                                           "snippet": {"text": "\tfor (i=0; i<100; i++) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "following ‘true’ branch (when ‘i != 100’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 58,
                                                                                                                                 "dst_id": 59}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1103,
                                                                                                                    "startColumn": 22,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 1103,
                                                                                                                           "snippet": {"text": "\t\tfd = dup(0);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1103,
                                                                                                                    "startColumn": 22,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 1103,
                                                                                                                           "snippet": {"text": "\t\tfd = dup(0);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "opened here"}},
                                                                       "kinds": ["acquire",
                                                                                 "resource"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1104,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 1104,
                                                                                                                           "snippet": {"text": "\t\tif (fd == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "assuming ‘fd’ is a valid file descriptor (>= 0)"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 60,
                                                                                                                                 "dst_id": 64}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1104,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 1104,
                                                                                                                           "snippet": {"text": "\t\tif (fd == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "following ‘false’ branch (when ‘fd != -1’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 60,
                                                                                                                                 "dst_id": 64}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1112,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 1112,
                                                                                                                           "snippet": {"text": "\t\tif (fd >= 1000) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning",
                                                                                      "gcc/analyzer/checker_event/original_fndecl": {"index": 1,
                                                                                                                                     "fullyQualifiedName": "test_closefrom"}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 189,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 17},
                                                                                                         "contextRegion": {"startLine": 189,
                                                                                                                           "snippet": {"text": "\treturn true;\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "test_setlinebuf"}],
                                                                                    "message": {"text": "‘fd’ leaks here; was opened at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)"},
                                                                                    "id": 2,
                                                                                    "relationships": [{"target": 1,
                                                                                                       "kinds": ["isIncludedBy"]}]},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 15}]}]}],
                        "relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 26},
                                                                   "contextRegion": {"startLine": 26,
                                                                                     "snippet": {"text": "#include \"replace.h\"\n"}}},
                                              "relationships": [{"target": 0,
                                                                 "kinds": ["includes"]},
                                                                {"target": 2,
                                                                 "kinds": ["includes"]}],
                                              "id": 1}]},
                       {"ruleId": "-Wanalyzer-possible-null-dereference",
                        "taxa": [{"id": "690",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 12258},
                                       "gcc/analyzer/saved_diagnostic/var": "x_7",
                                       "gcc/analyzer/saved_diagnostic/sval": "&HEAP_ALLOCATED_REGION(1419)",
                                       "gcc/analyzer/saved_diagnostic/state": "unchecked ({free})",
                                       "gcc/analyzer/saved_diagnostic/idx": 7,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 281},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "x_7",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "&HEAP_ALLOCATED_REGION(1419)",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "unchecked ({free})",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 1,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "possible_null_deref"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "possible_null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of possibly-NULL ‘x’"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 271,
                                                                       "startColumn": 15,
                                                                       "endColumn": 28},
                                                            "contextRegion": {"startLine": 271,
                                                                              "snippet": {"text": "\tcmp = strcmp(x, \"\");\n"}}},
                                       "logicalLocations": [{"index": 5,
                                                             "fullyQualifiedName": "test_strndup"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 270,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 270,
                                                                                                                           "snippet": {"text": "\tx = strndup(\"bla\", 0);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "this call could return NULL"}},
                                                                       "kinds": ["acquire",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 271,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 271,
                                                                                                                           "snippet": {"text": "\tcmp = strcmp(x, \"\");\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "‘x’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2}]}]}]},
                       {"ruleId": "-Wanalyzer-possible-null-argument",
                        "taxa": [{"id": "690",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 12265},
                                       "gcc/analyzer/saved_diagnostic/var": "x_10",
                                       "gcc/analyzer/saved_diagnostic/sval": "&HEAP_ALLOCATED_REGION(1419)",
                                       "gcc/analyzer/saved_diagnostic/state": "unchecked ({free})",
                                       "gcc/analyzer/saved_diagnostic/idx": 8,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 288},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "x_10",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "&HEAP_ALLOCATED_REGION(1419)",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "unchecked ({free})",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 2,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "possible_null_arg"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "possible_null_arg"},
                        "level": "warning",
                        "message": {"text": "use of possibly-NULL ‘x’ where non-null expected"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 279,
                                                                       "startColumn": 15,
                                                                       "endColumn": 30},
                                                            "contextRegion": {"startLine": 279,
                                                                              "snippet": {"text": "\tcmp = strcmp(x, \"bl\");\n"}}},
                                       "logicalLocations": [{"index": 5,
                                                             "fullyQualifiedName": "test_strndup"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 270,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 270,
                                                                                                                           "snippet": {"text": "\tx = strndup(\"bla\", 0);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "this call could return NULL"}},
                                                                       "kinds": ["acquire",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 271,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 271,
                                                                                                                           "snippet": {"text": "\tcmp = strcmp(x, \"\");\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "assuming ‘x’ is non-NULL"}},
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 5982,
                                                                                                                                 "dst_id": 5985}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 273,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 273,
                                                                                                                           "snippet": {"text": "\tif (cmp != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 5982,
                                                                                                                                 "dst_id": 5985}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 278,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 278,
                                                                                                                           "snippet": {"text": "\tx = strndup(\"bla\", 2);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 278,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 278,
                                                                                                                           "snippet": {"text": "\tx = strndup(\"bla\", 2);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "this call could return NULL"}},
                                                                       "kinds": ["acquire",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 279,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 30},
                                                                                                         "contextRegion": {"startLine": 279,
                                                                                                                           "snippet": {"text": "\tcmp = strcmp(x, \"bl\");\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "test_strndup"}],
                                                                                    "message": {"text": "argument 1 (‘x’) from [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4) could be NULL where non-null expected"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 6}]}]}],
                        "relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "/usr/include/string.h"},
                                                                   "region": {"startLine": 171,
                                                                              "startColumn": 12,
                                                                              "endColumn": 18},
                                                                   "contextRegion": {"startLine": 171,
                                                                                     "snippet": {"text": "extern int strcmp (const char *__s1, const char *__s2)\n"}}},
                                              "message": {"text": "argument 1 of ‘strcmp’ must be non-null"},
                                              "properties": {"nestingLevel": 0},
                                              "id": 0,
                                              "relationships": [{"target": 1,
                                                                 "kinds": ["isIncludedBy"]}]},
                                             {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/replace.h",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 176},
                                                                   "contextRegion": {"startLine": 176,
                                                                                     "snippet": {"text": "#include <string.h>\n"}}},
                                              "relationships": [{"target": 0,
                                                                 "kinds": ["includes"]},
                                                                {"target": 2,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 1},
                                             {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 26},
                                                                   "contextRegion": {"startLine": 26,
                                                                                     "snippet": {"text": "#include \"replace.h\"\n"}}},
                                              "relationships": [{"target": 1,
                                                                 "kinds": ["includes"]}],
                                              "id": 2}]},
                       {"ruleId": "-Wanalyzer-fd-leak",
                        "taxa": [{"id": "775",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 6378},
                                       "gcc/analyzer/saved_diagnostic/var": "fd_18",
                                       "gcc/analyzer/saved_diagnostic/sval": "CONJURED(fd_18 = dup (0);, fd_18)",
                                       "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                       "gcc/analyzer/saved_diagnostic/idx": 5,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 6378},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "fd_18",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "CONJURED(fd_18 = dup (0);, fd_18)",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 6,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "fd_leak"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "fd_leak"},
                        "level": "warning",
                        "message": {"text": "leak of file descriptor ‘fd’"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 1131,
                                                                       "startColumn": 1,
                                                                       "endColumn": 2},
                                                            "contextRegion": {"startLine": 1131,
                                                                              "snippet": {"text": "}\n"}}},
                                       "logicalLocations": [{"index": 1,
                                                             "fullyQualifiedName": "test_closefrom"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 58,
                                                                                                                                 "dst_id": 59}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1102,
                                                                                                                    "startColumn": 19,
                                                                                                                    "endColumn": 24},
                                                                                                         "contextRegion": {"startLine": 1102,
                                                                                                                           "snippet": {"text": "\tfor (i=0; i<100; i++) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "following ‘true’ branch (when ‘i != 100’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 58,
                                                                                                                                 "dst_id": 59}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1103,
                                                                                                                    "startColumn": 22,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 1103,
                                                                                                                           "snippet": {"text": "\t\tfd = dup(0);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1103,
                                                                                                                    "startColumn": 22,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 1103,
                                                                                                                           "snippet": {"text": "\t\tfd = dup(0);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "opened here"}},
                                                                       "kinds": ["acquire",
                                                                                 "resource"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1104,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 1104,
                                                                                                                           "snippet": {"text": "\t\tif (fd == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "assuming ‘fd’ is a valid file descriptor (>= 0)"}},
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 60,
                                                                                                                                 "dst_id": 64}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1104,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 1104,
                                                                                                                           "snippet": {"text": "\t\tif (fd == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "following ‘false’ branch (when ‘fd != -1’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 60,
                                                                                                                                 "dst_id": 64}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1112,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 1112,
                                                                                                                           "snippet": {"text": "\t\tif (fd >= 1000) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/testsuite.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1131,
                                                                                                                    "startColumn": 1,
                                                                                                                    "endColumn": 2},
                                                                                                         "contextRegion": {"startLine": 1131,
                                                                                                                           "snippet": {"text": "}\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "test_closefrom"}],
                                                                                    "message": {"text": "‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 7}]}]}]}],
           "logicalLocations": [{"name": "test_strdup",
                                 "fullyQualifiedName": "test_strdup",
                                 "decoratedName": "test_strdup",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "test_closefrom",
                                 "fullyQualifiedName": "test_closefrom",
                                 "decoratedName": "test_closefrom",
                                 "kind": "function",
                                 "index": 1},
                                {"name": "torture_local_replace",
                                 "fullyQualifiedName": "torture_local_replace",
                                 "decoratedName": "torture_local_replace",
                                 "kind": "function",
                                 "index": 2},
                                {"name": "test_strlcpy",
                                 "fullyQualifiedName": "test_strlcpy",
                                 "decoratedName": "test_strlcpy",
                                 "kind": "function",
                                 "index": 3},
                                {"name": "test_setlinebuf",
                                 "fullyQualifiedName": "test_setlinebuf",
                                 "decoratedName": "test_setlinebuf",
                                 "kind": "function",
                                 "index": 4},
                                {"name": "test_strndup",
                                 "fullyQualifiedName": "test_strndup",
                                 "decoratedName": "test_strndup",
                                 "kind": "function",
                                 "index": 5}]}]}
