{"$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-fd-leak",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-leak"}]}},
           "taxonomies": [{"name": "CWE",
                           "version": "4.7",
                           "organization": "MITRE",
                           "shortDescription": {"text": "The MITRE Common Weakness Enumeration"},
                           "taxa": [{"id": "775",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/775.html"}]}],
           "invocations": [{"arguments": ["/usr/libexec/gcc/x86_64-redhat-linux/16/cc1",
                                          "-quiet",
                                          "-I",
                                          "../src/include/",
                                          "-D",
                                          "_GNU_SOURCE",
                                          "-D",
                                          "__SANE_USERSPACE_TYPES__",
                                          "-D",
                                          "_LARGEFILE_SOURCE",
                                          "-D",
                                          "_FILE_OFFSET_BITS=64",
                                          "-D",
                                          "LIBURING_BUILD_TEST",
                                          "-include",
                                          "../config-host.h",
                                          "splice.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "splice.c",
                                          "-dumpbase-ext",
                                          ".c",
                                          "-m64",
                                          "-mtune=generic",
                                          "-march=x86-64",
                                          "-mtls-dialect=gnu2",
                                          "-O2",
                                          "-Wno-unused-parameter",
                                          "-Wno-sign-compare",
                                          "-Wno-unknown-pragmas",
                                          "-flto=auto",
                                          "-ffat-lto-objects",
                                          "-fexceptions",
                                          "-fstack-protector-strong",
                                          "-fasynchronous-unwind-tables",
                                          "-fstack-clash-protection",
                                          "-fcf-protection=full",
                                          "-fno-omit-frame-pointer",
                                          "-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/5093-gbaG.sarif",
                                          "-o",
                                          "/tmp/ccXj1ghg.s"],
                            "workingDirectory": {"uri": "/builddir/build/BUILD/liburing-2.13-build/liburing-2.13/test"},
                            "startTimeUtc": "2026-08-03T18:02:03Z",
                            "executionSuccessful": true,
                            "toolExecutionNotifications": [],
                            "endTimeUtc": "2026-08-03T18:02:04Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/liburing-2.13-build/liburing-2.13/test/"}},
           "artifacts": [{"location": {"uri": "splice.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/* SPDX-License-Identifier: MIT */\n#include <errno.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <stdlib.h>\n#include <string.h>\n#include <fcntl.h>\n#include <sys/mman.h>\n\n#include \"helpers.h\"\n#include \"liburing.h\"\n\n#define BUF_SIZE (16 * 4096)\n\nstruct test_ctx {\n\tint real_pipe1[2];\n\tint real_pipe2[2];\n\tint real_fd_in;\n\tint real_fd_out;\n\n\t/* fds or for registered files */\n\tint pipe1[2];\n\tint pipe2[2];\n\tint fd_in;\n\tint fd_out;\n\n\tvoid *buf_in;\n\tvoid *buf_out;\n};\n\nstatic unsigned int splice_flags = 0;\nstatic unsigned int sqe_flags = 0;\nstatic int has_splice = 0;\nstatic int has_tee = 0;\n\nstatic int read_buf(int fd, void *buf, int len)\n{\n\tint ret;\n\n\twhile (len) {\n\t\tret = read(fd, buf, len);\n\t\tif (ret < 0)\n\t\t\treturn ret;\n\t\tlen -= ret;\n\t\tbuf += ret;\n\t}\n\treturn 0;\n}\n\nstatic int write_buf(int fd, const void *buf, int len)\n{\n\tint ret;\n\n\twhile (len) {\n\t\tret = write(fd, buf, len);\n\t\tif (ret < 0)\n\t\t\treturn ret;\n\t\tlen -= ret;\n\t\tbuf += ret;\n\t}\n\treturn 0;\n}\n\nstatic int check_content(int fd, void *buf, int len, const void *src)\n{\n\tint ret;\n\n\tret = read_buf(fd, buf, len);\n\tif (ret)\n\t\treturn ret;\n\n\tret = memcmp(buf, src, len);\n\treturn (ret != 0) ? -1 : 0;\n}\n\nstatic int create_file(const char *filename)\n{\n\tint fd, save_errno;\n\n\tfd = open(filename, O_RDWR | O_CREAT, 0644);\n\tsave_errno = errno;\n\tunlink(filename);\n\terrno = save_errno;\n\treturn fd;\n}\n\nstatic int init_splice_ctx(struct test_ctx *ctx)\n{\n\tint ret, rnd_fd;\n\n\tctx->buf_in = t_calloc(BUF_SIZE, 1);\n\tctx->buf_out = t_calloc(BUF_SIZE, 1);\n\n\tctx->fd_in = create_file(\".splice-test-in\");\n\tif (ctx->fd_in < 0) {\n\t\tperror(\"file open\");\n\t\treturn 1;\n\t}\n\n\tctx->fd_out = create_file(\".splice-test-out\");\n\tif (ctx->fd_out < 0) {\n\t\tperror(\"file open\");\n\t\treturn 1;\n\t}\n\n\t/* get random data */\n\trnd_fd = open(\"/dev/urandom\", O_RDONLY);\n\tif (rnd_fd < 0)\n\t\treturn 1;\n\n\tret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);\n\tif (ret != 0)\n\t\treturn 1;\n\tclose(rnd_fd);\n\n\t/* populate file */\n\tret = write_buf(ctx->fd_in, ctx->buf_in, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\n\tif (pipe(ctx->pipe1) < 0)\n\t\treturn 1;\n\tif (pipe(ctx->pipe2) < 0)\n\t\treturn 1;\n\n\tctx->real_pipe1[0] = ctx->pipe1[0];\n\tctx->real_pipe1[1] = ctx->pipe1[1];\n\tctx->real_pipe2[0] = ctx->pipe2[0];\n\tctx->real_pipe2[1] = ctx->pipe2[1];\n\tctx->real_fd_in = ctx->fd_in;\n\tctx->real_fd_out = ctx->fd_out;\n\treturn 0;\n}\n\nstatic int do_splice_op(struct io_uring *ring,\n\t\t\tint fd_in, loff_t off_in,\n\t\t\tint fd_out, loff_t off_out,\n\t\t\tunsigned int len,\n\t\t\t__u8 opcode)\n{\n\tstruct io_uring_cqe *cqe;\n\tstruct io_uring_sqe *sqe;\n\tint ret = -1;\n\n\tdo {\n\t\tsqe = io_uring_get_sqe(ring);\n\t\tif (!sqe) {\n\t\t\tfprintf(stderr, \"get sqe failed\\n\");\n\t\t\treturn -1;\n\t\t}\n\t\tio_uring_prep_splice(sqe, fd_in, off_in, fd_out, off_out,\n\t\t\t\t     len, splice_flags);\n\t\tsqe->flags |= sqe_flags;\n\t\tsqe->user_data = 42;\n\t\tsqe->opcode = opcode;\n\n\t\tret = io_uring_submit(ring);\n\t\tif (ret != 1) {\n\t\t\tfprintf(stderr, \"sqe submit failed: %d\\n\", ret);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = io_uring_wait_cqe(ring, &cqe);\n\t\tif (ret < 0) {\n\t\t\tfprintf(stderr, \"wait completion %d\\n\", cqe->res);\n\t\t\treturn ret;\n\t\t}\n\n\t\tif (cqe->res <= 0) {\n\t\t\tio_uring_cqe_seen(ring, cqe);\n\t\t\treturn cqe->res;\n\t\t}\n\n\t\tlen -= cqe->res;\n\t\tif (off_in != -1)\n\t\t\toff_in += cqe->res;\n\t\tif (off_out != -1)\n\t\t\toff_out += cqe->res;\n\t\tio_uring_cqe_seen(ring, cqe);\n\t} while (len);\n\n\treturn 0;\n}\n\nstatic int do_splice(struct io_uring *ring,\n\t\t\tint fd_in, loff_t off_in,\n\t\t\tint fd_out, loff_t off_out,\n\t\t\tunsigned int len)\n{\n\treturn do_splice_op(ring, fd_in, off_in, fd_out, off_out, len,\n\t\t\t    IORING_OP_SPLICE);\n}\n\nstatic int do_tee(struct io_uring *ring, int fd_in, int fd_out,\n\t\t  unsigned int len)\n{\n\treturn do_splice_op(ring, fd_in, 0, fd_out, 0, len, IORING_OP_TEE);\n}\n\nstatic void check_splice_support(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_splice(ring, -1, 0, -1, 0, BUF_SIZE);\n\thas_splice = (ret == -EBADF);\n}\n\nstatic void check_tee_support(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_tee(ring, -1, -1, BUF_SIZE);\n\thas_tee = (ret == -EBADF);\n}\n\nstatic int check_zero_splice(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_splice(ring, ctx->fd_in, -1, ctx->pipe1[1], -1, 0);\n\tif (ret)\n\t\treturn ret;\n\n\tret = do_splice(ring, ctx->pipe2[0], -1, ctx->pipe1[1], -1, 0);\n\tif (ret)\n\t\treturn ret;\n\n\treturn 0;\n}\n\nstatic int splice_to_pipe(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = lseek(ctx->real_fd_in, 0, SEEK_SET);\n\tif (ret)\n\t\treturn ret;\n\n\t/* implicit file offset */\n\tret = do_splice(ring, ctx->fd_in, -1, ctx->pipe1[1], -1, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\n\tret = check_content(ctx->real_pipe1[0], ctx->buf_out, BUF_SIZE,\n\t\t\t     ctx->buf_in);\n\tif (ret)\n\t\treturn ret;\n\n\t/* explicit file offset */\n\tret = do_splice(ring, ctx->fd_in, 0, ctx->pipe1[1], -1, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\n\treturn check_content(ctx->real_pipe1[0], ctx->buf_out, BUF_SIZE,\n\t\t\t     ctx->buf_in);\n}\n\nstatic int splice_from_pipe(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = write_buf(ctx->real_pipe1[1], ctx->buf_in, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\tret = do_splice(ring, ctx->pipe1[0], -1, ctx->fd_out, 0, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\tret = check_content(ctx->real_fd_out, ctx->buf_out, BUF_SIZE,\n\t\t\t     ctx->buf_in);\n\tif (ret)\n\t\treturn ret;\n\n\tret = ftruncate(ctx->real_fd_out, 0);\n\tif (ret)\n\t\treturn ret;\n\treturn lseek(ctx->real_fd_out, 0, SEEK_SET);\n}\n\nstatic int splice_pipe_to_pipe(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_splice(ring, ctx->fd_in, 0, ctx->pipe1[1], -1, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\tret = do_splice(ring, ctx->pipe1[0], -1, ctx->pipe2[1], -1, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\n\treturn check_content(ctx->real_pipe2[0], ctx->buf_out, BUF_SIZE,\n\t\t\t\tctx->buf_in);\n}\n\nstatic int fail_splice_pipe_offset(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_splice(ring, ctx->fd_in, 0, ctx->pipe1[1], 0, BUF_SIZE);\n\tif (ret != -ESPIPE && ret != -EINVAL)\n\t\treturn ret;\n\n\tret = do_splice(ring, ctx->pipe1[0], 0, ctx->fd_out, 0, BUF_SIZE);\n\tif (ret != -ESPIPE && ret != -EINVAL)\n\t\treturn ret;\n\n\treturn 0;\n}\n\nstatic int fail_tee_nonpipe(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_tee(ring, ctx->fd_in, ctx->pipe1[1], BUF_SIZE);\n\tif (ret != -ESPIPE && ret != -EINVAL)\n\t\treturn ret;\n\n\treturn 0;\n}\n\nstatic int fail_tee_offset(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = do_splice_op(ring, ctx->pipe2[0], -1, ctx->pipe1[1], 0,\n\t\t\t   BUF_SIZE, IORING_OP_TEE);\n\tif (ret != -ESPIPE && ret != -EINVAL)\n\t\treturn ret;\n\n\tret = do_splice_op(ring, ctx->pipe2[0], 0, ctx->pipe1[1], -1,\n\t\t\t   BUF_SIZE, IORING_OP_TEE);\n\tif (ret != -ESPIPE && ret != -EINVAL)\n\t\treturn ret;\n\n\treturn 0;\n}\n\nstatic int check_tee(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tret = write_buf(ctx->real_pipe1[1], ctx->buf_in, BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\tret = do_tee(ring, ctx->pipe1[0], ctx->pipe2[1], BUF_SIZE);\n\tif (ret)\n\t\treturn ret;\n\n\tret = check_content(ctx->real_pipe1[0], ctx->buf_out, BUF_SIZE,\n\t\t\t\tctx->buf_in);\n\tif (ret) {\n\t\tfprintf(stderr, \"tee(), invalid src data\\n\");\n\t\treturn ret;\n\t}\n\n\tret = check_content(ctx->real_pipe2[0], ctx->buf_out, BUF_SIZE,\n\t\t\t\tctx->buf_in);\n\tif (ret) {\n\t\tfprintf(stderr, \"tee(), invalid dst data\\n\");\n\t\treturn ret;\n\t}\n\n\treturn 0;\n}\n\nstatic int check_zero_tee(struct io_uring *ring, struct test_ctx *ctx)\n{\n\treturn do_tee(ring, ctx->pipe2[0], ctx->pipe1[1], 0);\n}\n\nstatic int test_splice(struct io_uring *ring, struct test_ctx *ctx)\n{\n\tint ret;\n\n\tif (has_splice) {\n\t\tret = check_zero_splice(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"check_zero_splice failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = splice_to_pipe(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"splice_to_pipe failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = splice_from_pipe(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"splice_from_pipe failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = splice_pipe_to_pipe(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"splice_pipe_to_pipe failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = fail_splice_pipe_offset(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"fail_splice_pipe_offset failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tif (has_tee) {\n\t\tret = check_zero_tee(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"check_zero_tee() failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = fail_tee_nonpipe(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"fail_tee_nonpipe() failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = fail_tee_offset(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"fail_tee_offset failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = check_tee(ring, ctx);\n\t\tif (ret) {\n\t\t\tfprintf(stderr, \"check_tee() failed %i %i\\n\",\n\t\t\t\tret, errno);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\nint main(int argc, char *argv[])\n{\n\tstruct io_uring ring;\n\tstruct io_uring_params p = { };\n\tstruct test_ctx ctx;\n\tint ret;\n\tint reg_fds[6];\n\n\tif (argc > 1)\n\t\treturn 0;\n\n\tret = io_uring_queue_init_params(8, &ring, &p);\n\tif (ret) {\n\t\tfprintf(stderr, \"ring setup failed\\n\");\n\t\treturn 1;\n\t}\n\tif (!(p.features & IORING_FEAT_FAST_POLL)) {\n\t\tfprintf(stdout, \"No splice support, skipping\\n\");\n\t\treturn 0;\n\t}\n\n\tret = init_splice_ctx(&ctx);\n\tif (ret) {\n\t\tfprintf(stderr, \"init failed %i %i\\n\", ret, errno);\n\t\treturn 1;\n\t}\n\n\tcheck_splice_support(&ring, &ctx);\n\tif (!has_splice)\n\t\tfprintf(stdout, \"skip, doesn't support splice()\\n\");\n\tcheck_tee_support(&ring, &ctx);\n\tif (!has_tee)\n\t\tfprintf(stdout, \"skip, doesn't support tee()\\n\");\n\n\tret = test_splice(&ring, &ctx);\n\tif (ret) {\n\t\tfprintf(stderr, \"basic splice tests failed\\n\");\n\t\treturn ret;\n\t}\n\n\treg_fds[0] = ctx.real_pipe1[0];\n\treg_fds[1] = ctx.real_pipe1[1];\n\treg_fds[2] = ctx.real_pipe2[0];\n\treg_fds[3] = ctx.real_pipe2[1];\n\treg_fds[4] = ctx.real_fd_in;\n\treg_fds[5] = ctx.real_fd_out;\n\tret = io_uring_register_files(&ring, reg_fds, 6);\n\tif (ret) {\n\t\tfprintf(stderr, \"%s: register ret=%d\\n\", __FUNCTION__, ret);\n\t\treturn 1;\n\t}\n\n\t/* remap fds to registered */\n\tctx.pipe1[0] = 0;\n\tctx.pipe1[1] = 1;\n\tctx.pipe2[0] = 2;\n\tctx.pipe2[1] = 3;\n\tctx.fd_in = 4;\n\tctx.fd_out = 5;\n\n\tsplice_flags = SPLICE_F_FD_IN_FIXED;\n\tsqe_flags = IOSQE_FIXED_FILE;\n\tret = test_splice(&ring, &ctx);\n\tfree(ctx.buf_in);\n\tfree(ctx.buf_out);\n\tif (ret) {\n\t\tfprintf(stderr, \"registered fds splice tests failed\\n\");\n\t\treturn ret;\n\t}\n\treturn 0;\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]}],
           "results": [{"ruleId": "-Wanalyzer-fd-leak",
                        "taxa": [{"id": "775",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 137},
                                       "gcc/analyzer/saved_diagnostic/var": "open (\"/dev/urandom\", 0)",
                                       "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_31 = open (\"/dev/urandom\", 0);, _31)",
                                       "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-only",
                                       "gcc/analyzer/saved_diagnostic/idx": 0,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 137},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "open (\"/dev/urandom\", 0)",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_31 = open (\"/dev/urandom\", 0);, _31)",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-only",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 1,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "fd_leak"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "fd_leak"},
                        "level": "warning",
                        "message": {"text": "leak of file descriptor ‘open(\"/dev/urandom\", 0)’"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 111,
                                                                       "startColumn": 15,
                                                                       "endColumn": 54},
                                                            "contextRegion": {"startLine": 111,
                                                                              "snippet": {"text": "\tret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "init_splice_ctx"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 444,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 444,
                                                                                                                           "snippet": {"text": "int main(int argc, char *argv[])\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "entry to ‘main’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 23,
                                                                                                                                 "dst_id": 25}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 452,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 452,
                                                                                                                           "snippet": {"text": "\tif (argc > 1)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "following ‘false’ branch (when ‘argc <= 1’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 23,
                                                                                                                                 "dst_id": 25}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 455,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 55},
                                                                                                         "contextRegion": {"startLine": 455,
                                                                                                                           "snippet": {"text": "\tret = io_uring_queue_init_params(8, &ring, &p);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "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": 26,
                                                                                                                                 "dst_id": 30}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 456,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 456,
                                                                                                                           "snippet": {"text": "\tif (ret) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "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": 26,
                                                                                                                                 "dst_id": 30}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 460,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 460,
                                                                                                                           "snippet": {"text": "\tif (!(p.features & IORING_FEAT_FAST_POLL)) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 32,
                                                                                                                                 "dst_id": 36}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 460,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 460,
                                                                                                                           "snippet": {"text": "\tif (!(p.features & IORING_FEAT_FAST_POLL)) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 32,
                                                                                                                                 "dst_id": 36}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 465,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 36},
                                                                                                         "contextRegion": {"startLine": 465,
                                                                                                                           "snippet": {"text": "\tret = init_splice_ctx(&ctx);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 36,
                                                                                                                                 "dst_id": 37}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 465,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 36},
                                                                                                         "contextRegion": {"startLine": 465,
                                                                                                                           "snippet": {"text": "\tret = init_splice_ctx(&ctx);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "calling ‘init_splice_ctx’ from ‘main’"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 87,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 27},
                                                                                                         "contextRegion": {"startLine": 87,
                                                                                                                           "snippet": {"text": "static int init_splice_ctx(struct test_ctx *ctx)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "entry to ‘init_splice_ctx’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 498,
                                                                                                                                 "dst_id": 501}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 95,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 95,
                                                                                                                           "snippet": {"text": "\tif (ctx->fd_in < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 498,
                                                                                                                                 "dst_id": 501}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 100,
                                                                                                                    "startColumn": 23,
                                                                                                                    "endColumn": 54},
                                                                                                         "contextRegion": {"startLine": 100,
                                                                                                                           "snippet": {"text": "\tctx->fd_out = create_file(\".splice-test-out\");\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 503,
                                                                                                                                 "dst_id": 506}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 101,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 101,
                                                                                                                           "snippet": {"text": "\tif (ctx->fd_out < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 503,
                                                                                                                                 "dst_id": 506}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 107,
                                                                                                                    "startColumn": 18,
                                                                                                                    "endColumn": 48},
                                                                                                         "contextRegion": {"startLine": 107,
                                                                                                                           "snippet": {"text": "\trnd_fd = open(\"/dev/urandom\", O_RDONLY);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 107,
                                                                                                                    "startColumn": 18,
                                                                                                                    "endColumn": 48},
                                                                                                         "contextRegion": {"startLine": 107,
                                                                                                                           "snippet": {"text": "\trnd_fd = open(\"/dev/urandom\", O_RDONLY);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "opened here"}},
                                                                       "kinds": ["acquire",
                                                                                 "resource"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 108,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 108,
                                                                                                                           "snippet": {"text": "\tif (rnd_fd < 0)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "assuming ‘open(\"/dev/urandom\", 0)’ is a valid file descriptor (>= 0)"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 15},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(16)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 507,
                                                                                                                                 "dst_id": 509}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 108,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 108,
                                                                                                                           "snippet": {"text": "\tif (rnd_fd < 0)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 16},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(17)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 507,
                                                                                                                                 "dst_id": 509}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 54},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\tret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 17},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(18)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 510,
                                                                                                                                 "dst_id": 511}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 54},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\tret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "calling ‘read_buf’ from ‘init_splice_ctx’"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 18},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(19)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 36,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 36,
                                                                                                                           "snippet": {"text": "static int read_buf(int fd, void *buf, int len)\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "read_buf"}],
                                                                                    "message": {"text": "entry to ‘read_buf’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 3,
                                                                       "executionOrder": 19},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(20)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 591,
                                                                                                                                 "dst_id": 592}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 40,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 19},
                                                                                                         "contextRegion": {"startLine": 40,
                                                                                                                           "snippet": {"text": "\twhile (len) {\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "read_buf"}],
                                                                                    "message": {"text": "following ‘true’ branch (when ‘len != 0’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 3,
                                                                       "executionOrder": 20},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(21)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 591,
                                                                                                                                 "dst_id": 592}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 41,
                                                                                                                    "startColumn": 23,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 41,
                                                                                                                           "snippet": {"text": "\t\tret = read(fd, buf, len);\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "read_buf"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 3,
                                                                       "executionOrder": 21},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(22)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 54},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\tret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "returning to ‘init_splice_ctx’ from ‘read_buf’"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 22},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(23)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "splice.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 111,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 54},
                                                                                                         "contextRegion": {"startLine": 111,
                                                                                                                           "snippet": {"text": "\tret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "init_splice_ctx"}],
                                                                                    "message": {"text": "‘open(\"/dev/urandom\", 0)’ leaks here; was opened at [(14)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/13)"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 23}]}]}]}],
           "logicalLocations": [{"name": "init_splice_ctx",
                                 "fullyQualifiedName": "init_splice_ctx",
                                 "decoratedName": "init_splice_ctx",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "main",
                                 "fullyQualifiedName": "main",
                                 "decoratedName": "main",
                                 "kind": "function",
                                 "index": 1},
                                {"name": "read_buf",
                                 "fullyQualifiedName": "read_buf",
                                 "decoratedName": "read_buf",
                                 "kind": "function",
                                 "index": 2}]}]}
