{"$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"}]}},
           "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"}]}],
           "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/os2_delete.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "os2_delete.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/6079-tHxy.sarif",
                                          "-o",
                                          "/tmp/ccI2ASzb.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:52Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/libtalloc-2.4.4-build/talloc-2.4.4/bin/default/"}},
           "artifacts": [{"location": {"uri": "../../lib/replace/tests/os2_delete.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/*\n  test readdir/unlink pattern that OS/2 uses\n  tridge@samba.org July 2005\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <unistd.h>\n#include <sys/types.h>\n#include <dirent.h>\n#include <errno.h>\n#include <string.h>\n#include <fcntl.h>\n#include \"replace-test.h\"\n\n#define NUM_FILES 700\n#define READDIR_SIZE 100\n#define DELETE_SIZE 4\n\n#define TESTDIR \"test.dir\"\n\nstatic int test_readdir_os2_delete_ret;\n\n#define FAILED(d) (printf(\"failure: readdir [\\nFailed for %s - %d = %s\\n]\\n\", d, errno, strerror(errno)), test_readdir_os2_delete_ret = 1)\n\n#ifndef MIN\n#define MIN(a,b) ((a)<(b)?(a):(b))\n#endif\n\n#ifdef _WIN32\n#define mkdir(d,m) _mkdir(d)\n#endif\n\nstatic void cleanup(void)\n{\n\t/* I'm a lazy bastard */\n\tif (system(\"rm -rf \" TESTDIR)) {\n\t\tFAILED(\"system\");\n\t}\n\tmkdir(TESTDIR, 0700) == 0 || FAILED(\"mkdir\");\n}\n\nstatic void create_files(void)\n{\n\tint i;\n\tfor (i=0;i<NUM_FILES;i++) {\n\t\tchar fname[40];\n\t\tint fd;\n\t\tsnprintf(fname, sizeof(fname), TESTDIR \"/test%u.txt\", i);\n\t\tfd = open(fname, O_CREAT|O_RDWR, 0600);\n\t\tif (fd < 0) {\n\t\t\tFAILED(\"open\");\n\t\t}\n\t\tif (close(fd) != 0) {\n\t\t\tFAILED(\"close\");\n\t\t}\n\t}\n}\n\nstatic int os2_delete(DIR *d)\n{\n\toff_t offsets[READDIR_SIZE];\n\tint i, j;\n\tstruct dirent *de;\n\tchar names[READDIR_SIZE][256];\n\n\t/* scan, remembering offsets */\n\tfor (i=0, de=readdir(d);\n\t     de && i < READDIR_SIZE;\n\t     de=readdir(d), i++) {\n\t\toffsets[i] = telldir(d);\n\t\t/* strlcpy not available here */\n\t\tsnprintf(names[i], sizeof(names[i]), \"%s\", de->d_name);\n\t}\n\n\tif (i == 0) {\n\t\treturn 0;\n\t}\n\n\t/* delete the first few */\n\tfor (j=0; j<MIN(i, DELETE_SIZE); j++) {\n\t\tchar fname[40];\n\t\tsnprintf(fname, sizeof(fname), TESTDIR \"/%s\", names[j]);\n\t\tunlink(fname) == 0 || FAILED(\"unlink\");\n\t}\n\n\t/* seek to just after the deletion */\n\tseekdir(d, offsets[j-1]);\n\n\t/* return number deleted */\n\treturn j;\n}\n\nint test_readdir_os2_delete(void)\n{\n\tint total_deleted = 0;\n\tDIR *d;\n\tstruct dirent *de;\n\n\ttest_readdir_os2_delete_ret = 0;\n\n\tcleanup();\n\tcreate_files();\n\n\td = opendir(TESTDIR \"/test0.txt\");\n\tif (d != NULL) FAILED(\"opendir() on file succeed\");\n\tif (errno != ENOTDIR) FAILED(\"opendir() on file didn't give ENOTDIR\");\n\tif (d != NULL) closedir(d);\n\n\td = opendir(TESTDIR);\n\n\t/* skip past . and .. */\n\tde = readdir(d);\n\tstrcmp(de->d_name, \".\") == 0 || FAILED(\"match .\");\n\tde = readdir(d);\n\tstrcmp(de->d_name, \"..\") == 0 || FAILED(\"match ..\");\n\n\twhile (1) {\n\t\tint n = os2_delete(d);\n\t\tif (n == 0) break;\n\t\ttotal_deleted += n;\n\t}\n\tclosedir(d);\n\n\tfprintf(stderr, \"Deleted %d files of %d\\n\", total_deleted, NUM_FILES);\n\n\trmdir(TESTDIR) == 0 || FAILED(\"rmdir\");\n\n\tif (system(\"rm -rf \" TESTDIR) == -1) {\n\t\tFAILED(\"system\");\n\t}\n\n\treturn test_readdir_os2_delete_ret;\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]},
                         {"location": {"uri": "/usr/include/dirent.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 *\tPOSIX Standard: 5.1.2 Directory Operations\t<dirent.h>\n */\n\n#ifndef\t_DIRENT_H\n#define\t_DIRENT_H\t1\n\n#include <features.h>\n\n__BEGIN_DECLS\n\n#include <bits/types.h>\n\n#ifdef __USE_XOPEN\n# ifndef __ino_t_defined\n#  ifndef __USE_FILE_OFFSET64\ntypedef __ino_t ino_t;\n#  else\ntypedef __ino64_t ino_t;\n#  endif\n#  define __ino_t_defined\n# endif\n# if defined __USE_LARGEFILE64 && !defined __ino64_t_defined\ntypedef __ino64_t ino64_t;\n#  define __ino64_t_defined\n# endif\n#endif\n\n/* This file defines `struct dirent'.\n\n   It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen'\n   member that gives the length of `d_name'.\n\n   It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen'\n   member that gives the size of the entire directory entry.\n\n   It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off'\n   member that gives the file offset of the next directory entry.\n\n   It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type'\n   member that gives the type of the file.\n */\n\n#include <bits/dirent.h>\n\n#if defined __USE_MISC && !defined d_fileno\n# define d_ino\td_fileno\t\t /* Backward compatibility.  */\n#endif\n\n/* These macros extract size information from a `struct dirent *'.\n   They may evaluate their argument multiple times, so it must not\n   have side effects.  Each of these may involve a relatively costly\n   call to `strlen' on some systems, so these values should be cached.\n\n   _D_EXACT_NAMLEN (DP)\treturns the length of DP->d_name, not including\n   its terminating null character.\n\n   _D_ALLOC_NAMLEN (DP)\treturns a size at least (_D_EXACT_NAMLEN (DP) + 1);\n   that is, the allocation size needed to hold the DP->d_name string.\n   Use this macro when you don't need the exact length, just an upper bound.\n   This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN.\n   */\n\n#ifdef _DIRENT_HAVE_D_NAMLEN\n# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)\n# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)\n#else\n# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))\n# ifdef _DIRENT_HAVE_D_RECLEN\n#  define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])\n# else\n#  define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name \\\n\t\t\t      : _D_EXACT_NAMLEN (d) + 1)\n# endif\n#endif\n\n\n#ifdef __USE_MISC\n/* File types for `d_type'.  */\nenum\n  {\n    DT_UNKNOWN = 0,\n# define DT_UNKNOWN\tDT_UNKNOWN\n    DT_FIFO = 1,\n# define DT_FIFO\tDT_FIFO\n    DT_CHR = 2,\n# define DT_CHR\t\tDT_CHR\n    DT_DIR = 4,\n# define DT_DIR\t\tDT_DIR\n    DT_BLK = 6,\n# define DT_BLK\t\tDT_BLK\n    DT_REG = 8,\n# define DT_REG\t\tDT_REG\n    DT_LNK = 10,\n# define DT_LNK\t\tDT_LNK\n    DT_SOCK = 12,\n# define DT_SOCK\tDT_SOCK\n    DT_WHT = 14\n# define DT_WHT\t\tDT_WHT\n  };\n\n/* Convert between stat structure types and directory types.  */\n# define IFTODT(mode)\t(((mode) & 0170000) >> 12)\n# define DTTOIF(dirtype)\t((dirtype) << 12)\n#endif\n\n\n/* This is the data type of directory stream objects.\n   The actual structure is opaque to users.  */\ntypedef struct __dirstream DIR;\n\n/* Close the directory stream DIRP.\n   Return 0 if successful, -1 if not.\n\n   This function is a possible cancellation point and therefore not\n   marked with __THROW.  */\nextern int closedir (DIR *__dirp) __nonnull ((1));\n\n/* Open a directory stream on NAME.\n   Return a DIR stream on the directory, or NULL if it could not be opened.\n\n   This function is a possible cancellation point and therefore not\n   marked with __THROW.  */\nextern DIR *opendir (const char *__name) __nonnull ((1))\n\t__attribute_malloc__ __attr_dealloc (closedir, 1);\n\n#ifdef __USE_XOPEN2K8\n/* Same as opendir, but open the stream on the file descriptor FD.\n\n   This function is a possible cancellation point and therefore not\n   marked with __THROW.  */\nextern DIR *fdopendir (int __fd)\n\t__attribute_malloc__ __attr_dealloc (closedir, 1);\n#endif\n\n/* Read a directory entry from DIRP.  Return a pointer to a `struct\n   dirent' describing the entry, or NULL for EOF or error.  The\n   storage returned may be overwritten by a later readdir call on the\n   same DIR stream.\n\n   If the Large File Support API is selected we have to use the\n   appropriate interface.\n\n   This function is a possible cancellation point and therefore not\n   marked with __THROW.  */\n#ifndef __USE_FILE_OFFSET64\nextern struct dirent *readdir (DIR *__dirp) __nonnull ((1));\n#else\n# ifdef __REDIRECT\nextern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)\n     __nonnull ((1));\n# else\n#  define readdir readdir64\n# endif\n#endif\n\n#ifdef __USE_LARGEFILE64\nextern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));\n#endif\n\n#ifdef __USE_POSIX\n/* Reentrant version of `readdir'.  Return in RESULT a pointer to the\n   next entry.\n\n   This function is a possible cancellation point and therefore not\n   marked with __THROW.  */\n# ifndef __USE_FILE_OFFSET64\nextern int readdir_r (DIR *__restrict __dirp,\n\t\t      struct dirent *__restrict __entry,\n\t\t      struct dirent **__restrict __result)\n     __nonnull ((1, 2, 3)) __attribute_deprecated__;\n# else\n#  ifdef __REDIRECT\nextern int __REDIRECT (readdir_r,\n\t\t       (DIR *__restrict __dirp,\n\t\t\tstruct dirent *__restrict __entry,\n\t\t\tstruct dirent **__restrict __result),\n\t\t       readdir64_r)\n  __nonnull ((1, 2, 3)) __attribute_deprecated__;\n#  else\n#   define readdir_r readdir64_r\n#  endif\n# endif\n\n# ifdef __USE_LARGEFILE64\nextern int readdir64_r (DIR *__restrict __dirp,\n\t\t\tstruct dirent64 *__restrict __entry,\n\t\t\tstruct dirent64 **__restrict __result)\n  __nonnull ((1, 2, 3)) __attribute_deprecated__;\n# endif\n#endif\t/* POSIX or misc */\n\n/* Rewind DIRP to the beginning of the directory.  */\nextern void rewinddir (DIR *__dirp) __THROW __nonnull ((1));\n\n#if defined __USE_MISC || defined __USE_XOPEN\n# include <bits/types.h>\n\n/* Seek to position POS on DIRP.  */\nextern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));\n\n/* Return the current position of DIRP.  */\nextern long int telldir (DIR *__dirp) __THROW __nonnull ((1));\n#endif\n\n#ifdef __USE_XOPEN2K8\n\n/* Return the file descriptor used by DIRP.  */\nextern int dirfd (DIR *__dirp) __THROW __nonnull ((1));\n\n# if defined __OPTIMIZE__ && defined _DIR_dirfd\n#  define dirfd(dirp)\t_DIR_dirfd (dirp)\n# endif\n\n# ifdef __USE_MISC\n#  ifndef MAXNAMLEN\n/* Get the definitions of the POSIX.1 limits.  */\n#  include <bits/posix1_lim.h>\n\n/* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'.  */\n#   ifdef NAME_MAX\n#    define MAXNAMLEN\tNAME_MAX\n#   else\n#    define MAXNAMLEN\t255\n#   endif\n#  endif\n# endif\n\n# define __need_size_t\n# include <stddef.h>\n\n/* Scan the directory DIR, calling SELECTOR on each directory entry.\n   Entries for which SELECT returns nonzero are individually malloc'd,\n   sorted using qsort with CMP, and collected in a malloc'd array in\n   *NAMELIST.  Returns the number of entries selected, or -1 on error.\n\n   This function is a cancellation point and therefore not marked with\n   __THROW.  */\n# ifndef __USE_FILE_OFFSET64\nextern int scandir (const char *__restrict __dir,\n\t\t    struct dirent ***__restrict __namelist,\n\t\t    int (*__selector) (const struct dirent *),\n\t\t    int (*__cmp) (const struct dirent **,\n\t\t\t\t  const struct dirent **))\n     __nonnull ((1, 2));\n# else\n#  ifdef __REDIRECT\nextern int __REDIRECT (scandir,\n\t\t       (const char *__restrict __dir,\n\t\t\tstruct dirent ***__restrict __namelist,\n\t\t\tint (*__selector) (const struct dirent *),\n\t\t\tint (*__cmp) (const struct dirent **,\n\t\t\t\t      const struct dirent **)),\n\t\t       scandir64) __nonnull ((1, 2));\n#  else\n#   define scandir scandir64\n#  endif\n# endif\n\n# if defined __USE_GNU && defined __USE_LARGEFILE64\n/* This function is like `scandir' but it uses the 64bit dirent structure.\n   Please note that the CMP function must now work with struct dirent64 **.  */\nextern int scandir64 (const char *__restrict __dir,\n\t\t      struct dirent64 ***__restrict __namelist,\n\t\t      int (*__selector) (const struct dirent64 *),\n\t\t      int (*__cmp) (const struct dirent64 **,\n\t\t\t\t    const struct dirent64 **))\n     __nonnull ((1, 2));\n# endif\n\n# ifdef __USE_GNU\n/* Similar to `scandir' but a relative DIR name is interpreted relative\n   to the directory for which DFD is a descriptor.\n\n   This function is a cancellation point and therefore not marked with\n   __THROW.  */\n#  ifndef __USE_FILE_OFFSET64\nextern int scandirat (int __dfd, const char *__restrict __dir,\n\t\t      struct dirent ***__restrict __namelist,\n\t\t      int (*__selector) (const struct dirent *),\n\t\t      int (*__cmp) (const struct dirent **,\n\t\t\t\t    const struct dirent **))\n     __nonnull ((2, 3));\n#  else\n#   ifdef __REDIRECT\nextern int __REDIRECT (scandirat,\n\t\t       (int __dfd, const char *__restrict __dir,\n\t\t\tstruct dirent ***__restrict __namelist,\n\t\t\tint (*__selector) (const struct dirent *),\n\t\t\tint (*__cmp) (const struct dirent **,\n\t\t\t\t      const struct dirent **)),\n\t\t       scandirat64) __nonnull ((2, 3));\n#   else\n#    define scandirat scandirat64\n#   endif\n#  endif\n\n/* This function is like `scandir' but it uses the 64bit dirent structure.\n   Please note that the CMP function must now work with struct dirent64 **.  */\nextern int scandirat64 (int __dfd, const char *__restrict __dir,\n\t\t\tstruct dirent64 ***__restrict __namelist,\n\t\t\tint (*__selector) (const struct dirent64 *),\n\t\t\tint (*__cmp) (const struct dirent64 **,\n\t\t\t\t      const struct dirent64 **))\n     __nonnull ((2, 3));\n# endif\n\n/* Function to compare two `struct dirent's alphabetically.  */\n# ifndef __USE_FILE_OFFSET64\nextern int alphasort (const struct dirent **__e1,\n\t\t      const struct dirent **__e2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# else\n#  ifdef __REDIRECT\nextern int __REDIRECT_NTH (alphasort,\n\t\t\t   (const struct dirent **__e1,\n\t\t\t    const struct dirent **__e2),\n\t\t\t   alphasort64) __attribute_pure__ __nonnull ((1, 2));\n#  else\n#   define alphasort alphasort64\n#  endif\n# endif\n\n# if defined __USE_GNU && defined __USE_LARGEFILE64\nextern int alphasort64 (const struct dirent64 **__e1,\n\t\t\tconst struct dirent64 **__e2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# endif\n#endif /* Use XPG7.  */\n\n\n#ifdef __USE_MISC\n/* Read directory entries from FD into BUF, reading at most NBYTES.\n   Reading starts at offset *BASEP, and *BASEP is updated with the new\n   position after reading.  Returns the number of bytes read; zero when at\n   end of directory; or -1 for errors.  */\n# ifndef __USE_FILE_OFFSET64\nextern __ssize_t getdirentries (int __fd, char *__restrict __buf,\n\t\t\t\tsize_t __nbytes,\n\t\t\t\t__off_t *__restrict __basep)\n     __THROW __nonnull ((2, 4));\n# else\n#  ifdef __REDIRECT\nextern __ssize_t __REDIRECT_NTH (getdirentries,\n\t\t\t\t (int __fd, char *__restrict __buf,\n\t\t\t\t  size_t __nbytes,\n\t\t\t\t  __off64_t *__restrict __basep),\n\t\t\t\t getdirentries64) __nonnull ((2, 4));\n#  else\n#   define getdirentries getdirentries64\n#  endif\n# endif\n\n# ifdef __USE_LARGEFILE64\nextern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,\n\t\t\t\t  size_t __nbytes,\n\t\t\t\t  __off64_t *__restrict __basep)\n     __THROW __nonnull ((2, 4));\n# endif\n#endif /* Use misc.  */\n\n#ifdef __USE_GNU\n/* Function to compare two `struct dirent's by name & version.  */\n# ifndef __USE_FILE_OFFSET64\nextern int versionsort (const struct dirent **__e1,\n\t\t\tconst struct dirent **__e2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# else\n#  ifdef __REDIRECT\nextern int __REDIRECT_NTH (versionsort,\n\t\t\t   (const struct dirent **__e1,\n\t\t\t    const struct dirent **__e2),\n\t\t\t   versionsort64)\n     __attribute_pure__ __nonnull ((1, 2));\n#  else\n#   define versionsort versionsort64\n#  endif\n# endif\n\n# ifdef __USE_LARGEFILE64\nextern int versionsort64 (const struct dirent64 **__e1,\n\t\t\t  const struct dirent64 **__e2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# endif\n#endif /* Use GNU.  */\n\n__END_DECLS\n\n#include <bits/dirent_ext.h>\n\n#endif /* dirent.h  */\n"},
                          "roles": ["resultFile"]}],
           "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": 134},
                                       "gcc/analyzer/saved_diagnostic/var": "_50",
                                       "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_50 = opendir (\"test.dir\");, _50)",
                                       "gcc/analyzer/saved_diagnostic/state": "unchecked ({‘closedir’})",
                                       "gcc/analyzer/saved_diagnostic/idx": 0,
                                       "gcc/analyzer/pending_diagnostic/kind": "possible_null_arg"},
                        "level": "warning",
                        "message": {"text": "use of possibly-NULL ‘opendir(\"test.dir\")’ where non-null expected"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 114,
                                                                       "startColumn": 14,
                                                                       "endColumn": 24},
                                                            "contextRegion": {"startLine": 114,
                                                                              "snippet": {"text": "\tde = readdir(d);\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "test_readdir_os2_delete"}]}],
                        "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/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 95,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 95,
                                                                                                                           "snippet": {"text": "int test_readdir_os2_delete(void)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "entry to ‘test_readdir_os2_delete’"}},
                                                                       "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/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 104,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 23},
                                                                                                         "contextRegion": {"startLine": 104,
                                                                                                                           "snippet": {"text": "\tcreate_files();\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "calling ‘create_files’ from ‘test_readdir_os2_delete’"}},
                                                                       "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/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 44,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 44,
                                                                                                                           "snippet": {"text": "static void create_files(void)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "create_files"}],
                                                                                    "message": {"text": "entry to ‘create_files’"}},
                                                                       "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": 143,
                                                                                                                                 "dst_id": 144}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 47,
                                                                                                                    "startColumn": 18,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 47,
                                                                                                                           "snippet": {"text": "\tfor (i=0;i<NUM_FILES;i++) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "create_files"}],
                                                                                    "message": {"text": "following ‘true’ branch (when ‘i != 700’)..."}},
                                                                       "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": 143,
                                                                                                                                 "dst_id": 144}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 50,
                                                                                                                    "startColumn": 17,
                                                                                                                    "endColumn": 73},
                                                                                                         "contextRegion": {"startLine": 50,
                                                                                                                           "snippet": {"text": "\t\tsnprintf(fname, sizeof(fname), TESTDIR \"/test%u.txt\", i);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "create_files"}],
                                                                                    "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/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 104,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 23},
                                                                                                         "contextRegion": {"startLine": 104,
                                                                                                                           "snippet": {"text": "\tcreate_files();\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "returning to ‘test_readdir_os2_delete’ from ‘create_files’"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 25,
                                                                                                                                 "dst_id": 28}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 109,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 109,
                                                                                                                           "snippet": {"text": "\tif (d != NULL) closedir(d);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 25,
                                                                                                                                 "dst_id": 28}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 29},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\td = opendir(TESTDIR);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 29},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\td = opendir(TESTDIR);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "this call could return NULL"}},
                                                                       "kinds": ["acquire",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 114,
                                                                                                                    "startColumn": 14,
                                                                                                                    "endColumn": 24},
                                                                                                         "contextRegion": {"startLine": 114,
                                                                                                                           "snippet": {"text": "\tde = readdir(d);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_readdir_os2_delete"}],
                                                                                    "message": {"text": "argument 1 (‘opendir(\"test.dir\")’) from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8) could be NULL where non-null expected"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 10}]}]}],
                        "relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "/usr/include/dirent.h"},
                                                                   "region": {"startLine": 164,
                                                                              "startColumn": 23,
                                                                              "endColumn": 30},
                                                                   "contextRegion": {"startLine": 164,
                                                                                     "snippet": {"text": "extern struct dirent *readdir (DIR *__dirp) __nonnull ((1));\n"}}},
                                              "message": {"text": "argument 1 of ‘readdir’ must be non-null"},
                                              "properties": {"nestingLevel": 0},
                                              "id": 0,
                                              "relationships": [{"target": 1,
                                                                 "kinds": ["isIncludedBy"]}]},
                                             {"physicalLocation": {"artifactLocation": {"uri": "../../lib/replace/tests/os2_delete.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 11},
                                                                   "contextRegion": {"startLine": 11,
                                                                                     "snippet": {"text": "#include <dirent.h>\n"}}},
                                              "relationships": [{"target": 0,
                                                                 "kinds": ["includes"]}],
                                              "id": 1}]}],
           "logicalLocations": [{"name": "test_readdir_os2_delete",
                                 "fullyQualifiedName": "test_readdir_os2_delete",
                                 "decoratedName": "test_readdir_os2_delete",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "create_files",
                                 "fullyQualifiedName": "create_files",
                                 "decoratedName": "create_files",
                                 "kind": "function",
                                 "index": 1}]}]}
