Task #132321 - liburing-2.13-2.fc44/scan-results.err
back to task #132321download
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/examples/helpers.c:71:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
liburing-2.13/examples/helpers.c:35:14: acquire_resource: stream socket created here
liburing-2.13/examples/helpers.c:36:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
liburing-2.13/examples/helpers.c:41:9: branch_false: ...to here
liburing-2.13/examples/helpers.c:43:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
liburing-2.13/examples/helpers.c:48:12: branch_false: ...to here
liburing-2.13/examples/helpers.c:60:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
liburing-2.13/examples/helpers.c:65:13: branch_false: ...to here
liburing-2.13/examples/helpers.c:65:12: branch_true: following ‘true’ branch...
liburing-2.13/examples/helpers.c:66:17: branch_true: ...to here
liburing-2.13/examples/helpers.c:71:1: danger: ‘fd’ leaks here
# 69|
# 70| return fd;
# 71|-> }
# 72|
# 73| void *t_aligned_alloc(size_t alignment, size_t size)
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/io_uring-close-test.c:69: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: iovecs
# 67| if (posix_memalign(&buf, 4096, 4096))
# 68| return 1;
# 69|-> iovecs[i].iov_base = buf;
# 70| iovecs[i].iov_len = 4096;
# 71| fsize += 4096;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/examples/io_uring-close-test.c:69:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘iovecs’
liburing-2.13/examples/io_uring-close-test.c:31:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
liburing-2.13/examples/io_uring-close-test.c:36:15: branch_false: ...to here
liburing-2.13/examples/io_uring-close-test.c:37:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-close-test.c:42:15: branch_false: ...to here
liburing-2.13/examples/io_uring-close-test.c:43:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-close-test.c:47:15: branch_false: ...to here
liburing-2.13/examples/io_uring-close-test.c:48:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-close-test.c:53:14: branch_false: ...to here
liburing-2.13/examples/io_uring-close-test.c:54:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-close-test.c:59:13: branch_false: ...to here
liburing-2.13/examples/io_uring-close-test.c:59:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-close-test.c:65:18: branch_false: ...to here
liburing-2.13/examples/io_uring-close-test.c:65:18: acquire_memory: this call could return NULL
liburing-2.13/examples/io_uring-close-test.c:66:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
liburing-2.13/examples/io_uring-close-test.c:67:21: branch_true: ...to here
liburing-2.13/examples/io_uring-close-test.c:67:21: branch_true: following ‘true’ branch...
liburing-2.13/examples/io_uring-close-test.c:67:21: branch_true: ...to here
liburing-2.13/examples/io_uring-close-test.c:69:17: danger: ‘iovecs + (long unsigned int)i * 16’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
# 67| if (posix_memalign(&buf, 4096, 4096))
# 68| return 1;
# 69|-> iovecs[i].iov_base = buf;
# 70| iovecs[i].iov_len = 4096;
# 71| fsize += 4096;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/io_uring-close-test.c:70: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: iovecs
# 68| return 1;
# 69| iovecs[i].iov_base = buf;
# 70|-> iovecs[i].iov_len = 4096;
# 71| fsize += 4096;
# 72| }
Error: GCC_ANALYZER_WARNING (CWE-401):
liburing-2.13/examples/io_uring-cp.c:105:1: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
liburing-2.13/examples/io_uring-cp.c:249:5: enter_function: entry to ‘main’
liburing-2.13/examples/io_uring-cp.c:255:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
liburing-2.13/examples/io_uring-cp.c:260:16: branch_false: ...to here
liburing-2.13/examples/io_uring-cp.c:261:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-cp.c:265:17: branch_false: ...to here
liburing-2.13/examples/io_uring-cp.c:266:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-cp.c:271:13: branch_false: ...to here
liburing-2.13/examples/io_uring-cp.c:271:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-cp.c:273:13: branch_false: ...to here
liburing-2.13/examples/io_uring-cp.c:273:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-cp.c:276:15: branch_false: ...to here
liburing-2.13/examples/io_uring-cp.c:276:15: call_function: calling ‘copy_file’ from ‘main’
# 103| io_uring_sqe_set_data(sqe, data);
# 104| return 0;
# 105|-> }
# 106|
# 107| static void queue_write(struct io_uring *ring, struct io_data *data)
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/io_uring-test.c:58: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: iovecs
# 56| if (posix_memalign(&buf, 4096, 4096))
# 57| return 1;
# 58|-> iovecs[i].iov_base = buf;
# 59| iovecs[i].iov_len = 4096;
# 60| fsize += 4096;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/examples/io_uring-test.c:58:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘iovecs’
liburing-2.13/examples/io_uring-test.c:31:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
liburing-2.13/examples/io_uring-test.c:36:15: branch_false: ...to here
liburing-2.13/examples/io_uring-test.c:37:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-test.c:42:14: branch_false: ...to here
liburing-2.13/examples/io_uring-test.c:43:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-test.c:48:13: branch_false: ...to here
liburing-2.13/examples/io_uring-test.c:48:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/io_uring-test.c:54:18: branch_false: ...to here
liburing-2.13/examples/io_uring-test.c:54:18: acquire_memory: this call could return NULL
liburing-2.13/examples/io_uring-test.c:55:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
liburing-2.13/examples/io_uring-test.c:56:21: branch_true: ...to here
liburing-2.13/examples/io_uring-test.c:56:21: branch_true: following ‘true’ branch...
liburing-2.13/examples/io_uring-test.c:56:21: branch_true: ...to here
liburing-2.13/examples/io_uring-test.c:58:17: danger: ‘iovecs + (long unsigned int)i * 16’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 56| if (posix_memalign(&buf, 4096, 4096))
# 57| return 1;
# 58|-> iovecs[i].iov_base = buf;
# 59| iovecs[i].iov_len = 4096;
# 60| fsize += 4096;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/io_uring-test.c:59: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: iovecs
# 57| return 1;
# 58| iovecs[i].iov_base = buf;
# 59|-> iovecs[i].iov_len = 4096;
# 60| fsize += 4096;
# 61| }
Error: CPPCHECK_WARNING (CWE-682):
liburing-2.13/examples/link-cp.c:73: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
# 71|
# 72| ptr = malloc(size + sizeof(*data));
# 73|-> data = ptr + size;
# 74| data->index = 0;
# 75| data->offset = offset;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:435: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: iovs
# 433| iovs = calloc(nr_bufs, sizeof(struct iovec));
# 434| for (i = 0; i < nr_bufs; i++) {
# 435|-> iovs[i].iov_base = buf;
# 436| iovs[i].iov_len = buf_size;
# 437| buf += buf_size;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:436: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: iovs
# 434| for (i = 0; i < nr_bufs; i++) {
# 435| iovs[i].iov_base = buf;
# 436|-> iovs[i].iov_len = buf_size;
# 437| buf += buf_size;
# 438| }
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:515: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sstat
# 513| for (i = 0; i <= nr_bufs; i++) {
# 514| snd_total += cd->snd_bucket[i];
# 515|-> sstat[i].nr_packets = i;
# 516| sstat[i].count = cd->snd_bucket[i];
# 517| rcv_total += cd->rcv_bucket[i];
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:515:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sstat’
liburing-2.13/examples/proxy.c:550:13: enter_function: entry to ‘__show_stats’
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:572:12: branch_false: following ‘false’ branch (when ‘qps != 0’)...
liburing-2.13/examples/proxy.c:575:12: branch_false: ...to here
liburing-2.13/examples/proxy.c:582:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:583:17: branch_true: ...to here
liburing-2.13/examples/proxy.c:600:17: call_function: calling ‘show_buckets’ from ‘__show_stats’
# 513| for (i = 0; i <= nr_bufs; i++) {
# 514| snd_total += cd->snd_bucket[i];
# 515|-> sstat[i].nr_packets = i;
# 516| sstat[i].count = cd->snd_bucket[i];
# 517| rcv_total += cd->rcv_bucket[i];
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:516: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sstat
# 514| snd_total += cd->snd_bucket[i];
# 515| sstat[i].nr_packets = i;
# 516|-> sstat[i].count = cd->snd_bucket[i];
# 517| rcv_total += cd->rcv_bucket[i];
# 518| rstat[i].nr_packets = i;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:518: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rstat
# 516| sstat[i].count = cd->snd_bucket[i];
# 517| rcv_total += cd->rcv_bucket[i];
# 518|-> rstat[i].nr_packets = i;
# 519| rstat[i].count = cd->rcv_bucket[i];
# 520| }
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:518:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rstat’
liburing-2.13/examples/proxy.c:550:13: enter_function: entry to ‘__show_stats’
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:572:12: branch_false: following ‘false’ branch (when ‘qps != 0’)...
liburing-2.13/examples/proxy.c:575:12: branch_false: ...to here
liburing-2.13/examples/proxy.c:582:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:583:17: branch_true: ...to here
liburing-2.13/examples/proxy.c:600:17: call_function: calling ‘show_buckets’ from ‘__show_stats’
# 516| sstat[i].count = cd->snd_bucket[i];
# 517| rcv_total += cd->rcv_bucket[i];
# 518|-> rstat[i].nr_packets = i;
# 519| rstat[i].count = cd->rcv_bucket[i];
# 520| }
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/proxy.c:519: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rstat
# 517| rcv_total += cd->rcv_bucket[i];
# 518| rstat[i].nr_packets = i;
# 519|-> rstat[i].count = cd->rcv_bucket[i];
# 520| }
# 521|
Error: GCC_ANALYZER_WARNING (CWE-416):
liburing-2.13/examples/proxy.c:534:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘rstat’
liburing-2.13/examples/proxy.c:550:13: enter_function: entry to ‘__show_stats’
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:572:12: branch_false: following ‘false’ branch (when ‘qps != 0’)...
liburing-2.13/examples/proxy.c:575:12: branch_false: ...to here
liburing-2.13/examples/proxy.c:582:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:583:17: branch_true: ...to here
liburing-2.13/examples/proxy.c:600:17: call_function: calling ‘show_buckets’ from ‘__show_stats’
# 532| for (i = 0; i <= nr_bufs; i++) {
# 533| double snd_prc = 0.0, rcv_prc = 0.0;
# 534|-> if (!rstat[i].count && !sstat[i].count)
# 535| continue;
# 536| if (rstat[i].count)
Error: GCC_ANALYZER_WARNING (CWE-415):
liburing-2.13/examples/proxy.c:546:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘sstat’
liburing-2.13/examples/proxy.c:550:13: enter_function: entry to ‘__show_stats’
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:572:12: branch_false: following ‘false’ branch (when ‘qps != 0’)...
liburing-2.13/examples/proxy.c:575:12: branch_false: ...to here
liburing-2.13/examples/proxy.c:582:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:583:17: branch_true: ...to here
liburing-2.13/examples/proxy.c:600:17: call_function: calling ‘show_buckets’ from ‘__show_stats’
# 544| }
# 545|
# 546|-> free(sstat);
# 547| free(rstat);
# 548| }
Error: GCC_ANALYZER_WARNING (CWE-415):
liburing-2.13/examples/proxy.c:547:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘rstat’
liburing-2.13/examples/proxy.c:550:13: enter_function: entry to ‘__show_stats’
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:569:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:570:24: branch_true: ...to here
liburing-2.13/examples/proxy.c:572:12: branch_false: following ‘false’ branch (when ‘qps != 0’)...
liburing-2.13/examples/proxy.c:575:12: branch_false: ...to here
liburing-2.13/examples/proxy.c:582:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/examples/proxy.c:583:17: branch_true: ...to here
liburing-2.13/examples/proxy.c:600:17: call_function: calling ‘show_buckets’ from ‘__show_stats’
# 545|
# 546| free(sstat);
# 547|-> free(rstat);
# 548| }
# 549|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/examples/ucontext-cp.c:207:35: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*<unknown>, 0)’
liburing-2.13/examples/ucontext-cp.c:174:5: enter_function: entry to ‘main’
liburing-2.13/examples/ucontext-cp.c:180:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
liburing-2.13/examples/ucontext-cp.c:185:15: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:186:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:191:21: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:194:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
liburing-2.13/examples/ucontext-cp.c:197:39: branch_true: ...to here
liburing-2.13/examples/ucontext-cp.c:199:20: branch_false: following ‘false’ branch (when ‘pctx’ is non-NULL)...
liburing-2.13/examples/ucontext-cp.c:199:30: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:199:30: call_function: calling ‘setup_context’ from ‘main’
liburing-2.13/examples/ucontext-cp.c:199:30: return_function: returning to ‘main’ from ‘setup_context’
liburing-2.13/examples/ucontext-cp.c:199:21: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:202:33: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:202:24: acquire_resource: opened here
liburing-2.13/examples/ucontext-cp.c:203:20: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:207:35: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:207:35: danger: ‘open(*<unknown>, 0)’ leaks here; was opened at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
# 205| return 1;
# 206| }
# 207|-> outfd = open(argv[i + 1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
# 208| if (outfd < 0) {
# 209| perror("open outfile");
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/ucontext-cp.c:214: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pbundle
# 212|
# 213| arguments_bundle *pbundle = malloc(sizeof(*pbundle));
# 214|-> pbundle->pctx = pctx;
# 215| pbundle->psuccess = &success;
# 216| pbundle->pfailure = &failure;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/examples/ucontext-cp.c:214:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pbundle’
liburing-2.13/examples/ucontext-cp.c:174:5: enter_function: entry to ‘main’
liburing-2.13/examples/ucontext-cp.c:180:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
liburing-2.13/examples/ucontext-cp.c:185:15: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:186:12: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:191:21: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:194:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
liburing-2.13/examples/ucontext-cp.c:197:39: branch_true: ...to here
liburing-2.13/examples/ucontext-cp.c:199:20: branch_false: following ‘false’ branch (when ‘pctx’ is non-NULL)...
liburing-2.13/examples/ucontext-cp.c:199:30: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:199:30: call_function: calling ‘setup_context’ from ‘main’
liburing-2.13/examples/ucontext-cp.c:199:30: return_function: returning to ‘main’ from ‘setup_context’
liburing-2.13/examples/ucontext-cp.c:199:21: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:202:33: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:203:20: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:207:35: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:208:20: branch_false: following ‘false’ branch...
liburing-2.13/examples/ucontext-cp.c:213:45: branch_false: ...to here
liburing-2.13/examples/ucontext-cp.c:213:45: acquire_memory: this call could return NULL
liburing-2.13/examples/ucontext-cp.c:214:17: danger: ‘pbundle’ could be NULL: unchecked value from [(23)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/22)
# 212|
# 213| arguments_bundle *pbundle = malloc(sizeof(*pbundle));
# 214|-> pbundle->pctx = pctx;
# 215| pbundle->psuccess = &success;
# 216| pbundle->pfailure = &failure;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/ucontext-cp.c:215: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pbundle
# 213| arguments_bundle *pbundle = malloc(sizeof(*pbundle));
# 214| pbundle->pctx = pctx;
# 215|-> pbundle->psuccess = &success;
# 216| pbundle->pfailure = &failure;
# 217| pbundle->infd = infd;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/ucontext-cp.c:216: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pbundle
# 214| pbundle->pctx = pctx;
# 215| pbundle->psuccess = &success;
# 216|-> pbundle->pfailure = &failure;
# 217| pbundle->infd = infd;
# 218| pbundle->outfd = outfd;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/ucontext-cp.c:217: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pbundle
# 215| pbundle->psuccess = &success;
# 216| pbundle->pfailure = &failure;
# 217|-> pbundle->infd = infd;
# 218| pbundle->outfd = outfd;
# 219|
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/examples/ucontext-cp.c:218: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pbundle
# 216| pbundle->pfailure = &failure;
# 217| pbundle->infd = infd;
# 218|-> pbundle->outfd = outfd;
# 219|
# 220| makecontext(&pctx->ctx_fnew, (void (*)(void)) copy_file_wrapper, 1, pbundle);
Error: GCC_ANALYZER_WARNING:
liburing-2.13/examples/zcrx.c:356:13: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘fd’
liburing-2.13/examples/zcrx.c:344:12: branch_true: following ‘true’ branch (when ‘fd == -1’)...
liburing-2.13/examples/zcrx.c:345:17: branch_true: ...to here
liburing-2.13/examples/zcrx.c:356:13: danger: ‘fd’ could be invalid
# 354| t_error(1, 0, "bind()");
# 355|
# 356|-> if (listen(fd, 1024) < 0)
# 357| t_error(1, 0, "listen()");
# 358|
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/src/include/liburing.h:588:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/buf-ring.c:404:5: enter_function: entry to ‘main’
liburing-2.13/test/buf-ring.c:410:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/buf-ring.c:413:20: branch_false: ...to here
liburing-2.13/test/buf-ring.c:415:21: branch_true: following ‘true’ branch...
liburing-2.13/test/buf-ring.c:416:23: branch_true: ...to here
liburing-2.13/test/buf-ring.c:417:20: branch_false: following ‘false’ branch...
liburing-2.13/test/buf-ring.c:421:21: branch_false: ...to here
liburing-2.13/test/buf-ring.c:421:20: branch_false: following ‘false’ branch...
liburing-2.13/test/buf-ring.c:424:23: branch_false: ...to here
liburing-2.13/test/buf-ring.c:425:20: branch_false: following ‘false’ branch...
liburing-2.13/test/buf-ring.c:430:23: branch_false: ...to here
liburing-2.13/test/buf-ring.c:431:20: branch_false: following ‘false’ branch...
liburing-2.13/test/buf-ring.c:436:23: branch_false: ...to here
liburing-2.13/test/buf-ring.c:436:23: call_function: calling ‘test_mixed_reg’ from ‘main’
# 586| LIBURING_NOEXCEPT
# 587| {
# 588|-> sqe->opcode = (__u8) op;
# 589| sqe->fd = fd;
# 590| sqe->off = offset;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/src/include/liburing.h:588:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sqe’
liburing-2.13/test/io_uring_enter.c:151:13: enter_function: entry to ‘submit_io’
liburing-2.13/test/io_uring_enter.c:160:14: call_function: calling ‘setup_file’ from ‘submit_io’
liburing-2.13/test/io_uring_enter.c:160:14: return_function: returning to ‘submit_io’ from ‘setup_file’
liburing-2.13/test/io_uring_enter.c:161:21: branch_true: following ‘true’ branch (when ‘i < nr’)...
liburing-2.13/test/io_uring_enter.c:163:23: call_function: inlined call to ‘io_uring_get_sqe’ from ‘submit_io’
liburing-2.13/test/io_uring_enter.c:163:23: call_function: inlined call to ‘io_uring_get_sqe’ from ‘submit_io’
liburing-2.13/test/io_uring_enter.c:165:17: call_function: calling ‘io_prep_read’ from ‘submit_io’
# 586| LIBURING_NOEXCEPT
# 587| {
# 588|-> sqe->opcode = (__u8) op;
# 589| sqe->fd = fd;
# 590| sqe->off = offset;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/src/include/liburing.h:589:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/vec-regbuf.c:576:5: enter_function: entry to ‘main’
liburing-2.13/test/vec-regbuf.c:581:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/vec-regbuf.c:584:19: branch_false: ...to here
liburing-2.13/test/vec-regbuf.c:586:9: call_function: calling ‘probe_support’ from ‘main’
liburing-2.13/test/vec-regbuf.c:586:9: return_function: returning to ‘main’ from ‘probe_support’
liburing-2.13/test/vec-regbuf.c:587:12: branch_true: following ‘true’ branch...
liburing-2.13/test/vec-regbuf.c:592:27: branch_true: ...to here
liburing-2.13/test/vec-regbuf.c:592:9: call_function: calling ‘init_buffers’ from ‘main’
liburing-2.13/test/vec-regbuf.c:592:9: return_function: returning to ‘main’ from ‘init_buffers’
liburing-2.13/test/vec-regbuf.c:595:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/test/vec-regbuf.c:596:22: branch_true: ...to here
liburing-2.13/test/vec-regbuf.c:600:17: call_function: calling ‘test_basic’ from ‘main’
# 587| {
# 588| sqe->opcode = (__u8) op;
# 589|-> sqe->fd = fd;
# 590| sqe->off = offset;
# 591| sqe->addr = (unsigned long) addr;
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/src/include/liburing.h:945: warning[uninitvar]: Uninitialized variable: events
# 943| LIBURING_NOEXCEPT
# 944| {
# 945|-> io_uring_prep_rw(IORING_OP_EPOLL_WAIT, sqe, fd, events, maxevents, 0);
# 946| sqe->rw_flags = flags;
# 947| }
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/src/include/liburing.h:1024: warning[uninitvar]: Uninitialized variable: buf
# 1022| LIBURING_NOEXCEPT
# 1023| {
# 1024|-> io_uring_prep_rw(IORING_OP_READ, sqe, fd, buf, nbytes, offset);
# 1025| }
# 1026|
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/src/include/liburing.h:1172: warning[uninitvar]: Uninitialized variable: buf
# 1170| LIBURING_NOEXCEPT
# 1171| {
# 1172|-> io_uring_prep_rw(IORING_OP_RECV, sqe, sockfd, buf, (__u32) len, 0);
# 1173| sqe->msg_flags = (__u32) flags;
# 1174| }
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/src/include/liburing.h:1293: warning[uninitvar]: Uninitialized variable: addr
# 1291| LIBURING_NOEXCEPT
# 1292| {
# 1293|-> io_uring_prep_rw(IORING_OP_PROVIDE_BUFFERS, sqe, nr, addr, (__u32) len,
# 1294| (__u64) bid);
# 1295| sqe->buf_group = (__u16) bgid;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/src/include/liburing.h:1532:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/bind-listen.c:514:5: enter_function: entry to ‘main’
liburing-2.13/test/bind-listen.c:519:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/bind-listen.c:527:17: branch_false: ...to here
liburing-2.13/test/bind-listen.c:528:12: branch_false: following ‘false’ branch...
liburing-2.13/test/bind-listen.c:530:14: call_function: inlined call to ‘io_uring_opcode_supported’ from ‘main’
liburing-2.13/test/bind-listen.c:530:12: branch_false: following ‘false’ branch...
liburing-2.13/test/bind-listen.c:533:15: branch_false: ...to here
liburing-2.13/test/bind-listen.c:533:15: call_function: calling ‘test_good_server’ from ‘main’
# 1530| LIBURING_NOEXCEPT
# 1531| {
# 1532|-> sqe->opcode = (__u8) op;
# 1533| sqe->fd = fd;
# 1534| sqe->cmd_op = cmd_op;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".short-read", 0)’
liburing-2.13/test/short-read.c:18:5: enter_function: entry to ‘main’
liburing-2.13/test/short-read.c:26:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/short-read.c:29:24: branch_false: ...to here
liburing-2.13/test/short-read.c:34:14: acquire_resource: opened here
liburing-2.13/test/short-read.c:38:12: branch_false: following ‘false’ branch...
liburing-2.13/test/short-read.c:43:15: branch_false: ...to here
liburing-2.13/test/short-read.c:44:12: branch_false: following ‘false’ branch...
liburing-2.13/test/short-read.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/short-read.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(".short-read", 0)’ leaks here; was opened at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 1689| * non-SQPOLL since then we drive updates.
# 1690| */
# 1691|-> if (ring->flags & IORING_SETUP_SQPOLL)
# 1692| return io_uring_smp_load_acquire(ring->sq.khead);
# 1693|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".sync_file_range", 2)’
liburing-2.13/test/fsync.c:146:12: enter_function: entry to ‘test_sync_file_range’
liburing-2.13/test/fsync.c:154:14: acquire_resource: opened here
liburing-2.13/test/fsync.c:158:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fsync.c:163:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_sync_file_range’
liburing-2.13/test/fsync.c:163:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_sync_file_range’
liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(".sync_file_range", 2)’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
# 1689| * non-SQPOLL since then we drive updates.
# 1690| */
# 1691|-> if (ring->flags & IORING_SETUP_SQPOLL)
# 1692| return io_uring_smp_load_acquire(ring->sq.khead);
# 1693|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".test_fpos_read", 0)’
liburing-2.13/test/fpos.c:225:5: enter_function: entry to ‘main’
liburing-2.13/test/fpos.c:230:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/fpos.c:233:15: branch_false: ...to here
liburing-2.13/test/fpos.c:234:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fpos.c:234:12: branch_false: ...to here
liburing-2.13/test/fpos.c:239:28: branch_true: following ‘true’ branch (when ‘test != 8’)...
liburing-2.13/test/fpos.c:240:21: branch_true: ...to here
liburing-2.13/test/fpos.c:242:33: branch_false: following ‘false’ branch...
liburing-2.13/test/fpos.c:242:33: branch_false: ...to here
liburing-2.13/test/fpos.c:244:23: branch_false: following ‘false’ branch (when ‘write == 0’)...
liburing-2.13/test/fpos.c:246:27: branch_false: ...to here
liburing-2.13/test/fpos.c:246:27: call_function: calling ‘test_read’ from ‘main’
# 1689| * non-SQPOLL since then we drive updates.
# 1690| */
# 1691|-> if (ring->flags & IORING_SETUP_SQPOLL)
# 1692| return io_uring_smp_load_acquire(ring->sq.khead);
# 1693|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 16384)’
liburing-2.13/test/sqwait.c:42:5: enter_function: entry to ‘main’
liburing-2.13/test/sqwait.c:63:21: branch_true: following ‘true’ branch (when ‘i != 256’)...
liburing-2.13/test/sqwait.c:64:21: branch_true: ...to here
liburing-2.13/test/sqwait.c:64:21: branch_true: following ‘true’ branch...
liburing-2.13/test/sqwait.c:70:12: branch_false: following ‘false’ branch...
liburing-2.13/test/sqwait.c:78:14: branch_false: ...to here
liburing-2.13/test/sqwait.c:78:14: acquire_resource: opened here
liburing-2.13/test/sqwait.c:79:12: branch_false: following ‘false’ branch...
liburing-2.13/test/sqwait.c:79:12: branch_false: ...to here
liburing-2.13/test/sqwait.c:88:21: branch_true: following ‘true’ branch (when ‘i != 10000’)...
liburing-2.13/test/sqwait.c:91:23: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/sqwait.c:91:23: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/sqwait.c:92:20: branch_true: following ‘true’ branch...
liburing-2.13/test/sqwait.c:93:31: branch_true: ...to here
liburing-2.13/test/sqwait.c:94:28: branch_true: following ‘true’ branch...
liburing-2.13/test/sqwait.c:95:36: branch_true: ...to here
liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(fname, 16384)’ leaks here; was opened at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
# 1689| * non-SQPOLL since then we drive updates.
# 1690| */
# 1691|-> if (ring->flags & IORING_SETUP_SQPOLL)
# 1692| return io_uring_smp_load_acquire(ring->sq.khead);
# 1693|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
liburing-2.13/test/statx.c:155:12: enter_function: entry to ‘test_statx_fd’
liburing-2.13/test/statx.c:162:14: acquire_resource: opened here
liburing-2.13/test/statx.c:163:12: branch_false: following ‘false’ branch...
liburing-2.13/test/statx.c:170:9: branch_false: ...to here
liburing-2.13/test/statx.c:172:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_statx_fd’
liburing-2.13/test/statx.c:172:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_statx_fd’
liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(path, 0)’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
# 1689| * non-SQPOLL since then we drive updates.
# 1690| */
# 1691|-> if (ring->flags & IORING_SETUP_SQPOLL)
# 1692| return io_uring_smp_load_acquire(ring->sq.khead);
# 1693|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/src/include/liburing.h:1879:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
liburing-2.13/test/defer-taskrun.c:335:5: enter_function: entry to ‘main’
liburing-2.13/test/defer-taskrun.c:340:12: branch_false: following ‘false’ branch (when ‘argc <= 2’)...
liburing-2.13/test/defer-taskrun.c:342:12: branch_false: ...to here
liburing-2.13/test/defer-taskrun.c:342:12: branch_true: following ‘true’ branch (when ‘argc == 2’)...
liburing-2.13/test/defer-taskrun.c:348:17: branch_true: ...to here
liburing-2.13/test/defer-taskrun.c:351:12: branch_true: following ‘true’ branch...
liburing-2.13/test/defer-taskrun.c:354:15: branch_true: ...to here
liburing-2.13/test/defer-taskrun.c:354:15: call_function: calling ‘test_thread_shutdown’ from ‘main’
liburing-2.13/test/defer-taskrun.c:354:15: return_function: returning to ‘main’ from ‘test_thread_shutdown’
liburing-2.13/test/defer-taskrun.c:355:12: branch_false: following ‘false’ branch...
liburing-2.13/test/defer-taskrun.c:360:15: branch_false: ...to here
liburing-2.13/test/defer-taskrun.c:360:15: call_function: calling ‘test_exec’ from ‘main’
# 1877| if (nr_available)
# 1878| *nr_available = available;
# 1879|-> return err;
# 1880| }
# 1881|
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/src/setup.c:359:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sq_array’
liburing-2.13/src/setup.c:597:16: enter_function: entry to ‘io_uring_mlock_size’
liburing-2.13/src/setup.c:603:16: call_function: calling ‘io_uring_mlock_size_params’ from ‘io_uring_mlock_size’
# 357| sq_array = ring->sq.array;
# 358| for (index = 0; index < sq_entries; index++)
# 359|-> sq_array[index] = index;
# 360| }
# 361| ring->features = p->features;
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/232c93d07b74.c:95:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘s0’
liburing-2.13/test/232c93d07b74.c:67:12: branch_true: following ‘true’ branch...
liburing-2.13/test/232c93d07b74.c:68:26: branch_true: ...to here
liburing-2.13/test/232c93d07b74.c:72:17: branch_true: following ‘true’ branch (when ‘res != -1’)...
liburing-2.13/test/232c93d07b74.c:73:23: branch_true: ...to here
liburing-2.13/test/232c93d07b74.c:74:17: branch_true: following ‘true’ branch (when ‘res != -1’)...
liburing-2.13/test/232c93d07b74.c:78:17: branch_true: ...to here
liburing-2.13/test/232c93d07b74.c:81:17: branch_true: following ‘true’ branch...
liburing-2.13/test/232c93d07b74.c:82:32: branch_true: ...to here
liburing-2.13/test/232c93d07b74.c:95:15: danger: ‘s0’ could be invalid
# 93| assert(res != -1);
# 94| }
# 95|-> res = listen(s0, 128);
# 96| assert(res != -1);
# 97|
Error: GCC_ANALYZER_WARNING (CWE-479):
liburing-2.13/test/35fa71a030ca.c:316:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
liburing-2.13/test/35fa71a030ca.c:319:5: enter_function: entry to ‘main’
liburing-2.13/test/35fa71a030ca.c:321:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/35fa71a030ca.c:323:9: branch_false: ...to here
liburing-2.13/test/35fa71a030ca.c:316:9: danger: call to ‘exit’ from within signal handler
# 314| static void sig_int(int sig)
# 315| {
# 316|-> exit(0);
# 317| }
# 318|
Error: GCC_ANALYZER_WARNING (CWE-479):
liburing-2.13/test/a4c0b3decb33.c:171:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
liburing-2.13/test/a4c0b3decb33.c:174:5: enter_function: entry to ‘main’
liburing-2.13/test/a4c0b3decb33.c:176:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/a4c0b3decb33.c:178:9: branch_false: ...to here
liburing-2.13/test/a4c0b3decb33.c:169:13: enter_function: entry to ‘sig_int’
liburing-2.13/test/a4c0b3decb33.c:171:9: danger: call to ‘exit’ from within signal handler
# 169| static void sig_int(int sig)
# 170| {
# 171|-> exit(0);
# 172| }
# 173|
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/accept-non-empty.c:56:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘fd’
liburing-2.13/test/accept-non-empty.c:222:5: enter_function: entry to ‘main’
liburing-2.13/test/accept-non-empty.c:226:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/accept-non-empty.c:229:15: branch_false: ...to here
liburing-2.13/test/accept-non-empty.c:229:15: call_function: calling ‘test’ from ‘main’
# 54| ret = bind(fd, (struct sockaddr *) &addr, sizeof(addr));
# 55| assert(ret != -1);
# 56|-> ret = listen(fd, 20000);
# 57| assert(ret != -1);
# 58|
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/accept-non-empty.c:127: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fds
# 125|
# 126| fds = malloc(MAX_ACCEPTS * sizeof(int));
# 127|-> memset(fds, -1, MAX_ACCEPTS * sizeof(int));
# 128|
# 129| if (fixed) {
Error: GCC_ANALYZER_WARNING (CWE-688):
liburing-2.13/test/accept-non-empty.c:127:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fds’ where non-null expected
liburing-2.13/test/accept-non-empty.c:222:5: enter_function: entry to ‘main’
liburing-2.13/test/accept-non-empty.c:226:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/accept-non-empty.c:229:15: branch_false: ...to here
liburing-2.13/test/accept-non-empty.c:229:15: call_function: calling ‘test’ from ‘main’
# 125|
# 126| fds = malloc(MAX_ACCEPTS * sizeof(int));
# 127|-> memset(fds, -1, MAX_ACCEPTS * sizeof(int));
# 128|
# 129| if (fixed) {
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/accept.c:204:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘fd’
liburing-2.13/test/accept.c:748:5: enter_function: entry to ‘main’
liburing-2.13/test/accept.c:752:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/accept.c:755:15: branch_false: ...to here
liburing-2.13/test/accept.c:755:15: call_function: calling ‘test_accept’ from ‘main’
# 202| ret = t_bind_ephemeral_port(fd, addr);
# 203| assert(!ret);
# 204|-> ret = listen(fd, 128);
# 205| assert(ret != -1);
# 206|
Error: CPPCHECK_WARNING (CWE-909):
liburing-2.13/test/bind-listen.c:134: error[uninitStructMember]: Uninitialized struct member: cqe.res
# 132| close(fd);
# 133| } else if (res < 0) {
# 134|-> fprintf(stderr, "getsockname server failed. %d\n", cqe->res);
# 135| return T_EXIT_FAIL;
# 136| }
Error: CPPCHECK_WARNING (CWE-401):
liburing-2.13/test/buf-ring.c:353: error[memleak]: Memory leak: buffers
# 351| read_fd = open("/dev/zero", O_RDONLY);
# 352| if (read_fd < 0)
# 353|-> return T_EXIT_SKIP;
# 354|
# 355| for (loop = 0; loop < loops; loop++) {
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/coredump.c:41: error[nullPointer]: Null pointer dereference: ptr
# 39|
# 40| io_uring_submit(&ring);
# 41|-> *ptr = 0;
# 42| exit(0);
# 43| }
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/coredump.c:41:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/coredump.c:20:13: enter_function: entry to ‘test’
liburing-2.13/test/coredump.c:28:12: branch_false: following ‘false’ branch...
liburing-2.13/test/coredump.c:33:9: branch_false: ...to here
liburing-2.13/test/coredump.c:35:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test’
liburing-2.13/test/coredump.c:35:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test’
liburing-2.13/test/coredump.c:41:9: danger: dereference of NULL ‘0’
# 39|
# 40| io_uring_submit(&ring);
# 41|-> *ptr = 0;
# 42| exit(0);
# 43| }
Error: GCC_ANALYZER_WARNING (CWE-479):
liburing-2.13/test/d77a67ed5f27.c:13:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
liburing-2.13/test/d77a67ed5f27.c:16:5: enter_function: entry to ‘main’
liburing-2.13/test/d77a67ed5f27.c:24:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/d77a67ed5f27.c:27:9: branch_false: ...to here
liburing-2.13/test/d77a67ed5f27.c:10:13: enter_function: entry to ‘sig_alrm’
liburing-2.13/test/d77a67ed5f27.c:13:9: danger: call to ‘exit’ from within signal handler
# 11| {
# 12| fprintf(stderr, "Timed out!\n");
# 13|-> exit(1);
# 14| }
# 15|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/defer-taskrun.c:221:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
liburing-2.13/test/defer-taskrun.c:180:9: branch_false: following ‘false’ branch (when ‘fork_pid >= 0’)...
liburing-2.13/test/defer-taskrun.c:181:12: branch_false: ...to here
liburing-2.13/test/defer-taskrun.c:181:12: branch_false: following ‘false’ branch (when ‘fork_pid == 0’)...
liburing-2.13/test/defer-taskrun.c:192:15: branch_false: ...to here
liburing-2.13/test/defer-taskrun.c:194:12: branch_false: following ‘false’ branch...
liburing-2.13/test/defer-taskrun.c:197:12: branch_false: ...to here
liburing-2.13/test/defer-taskrun.c:197:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
liburing-2.13/test/defer-taskrun.c:198:22: branch_true: ...to here
liburing-2.13/test/defer-taskrun.c:198:22: acquire_resource: opened here
liburing-2.13/test/defer-taskrun.c:199:20: branch_false: following ‘false’ branch...
liburing-2.13/test/defer-taskrun.c:211:9: branch_false: ...to here
liburing-2.13/test/defer-taskrun.c:221:1: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
# 219| fprintf(stderr, "execve failed %d\n", ret);
# 220| return T_EXIT_FAIL;
# 221|-> }
# 222|
# 223| static int test_flag(void)
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/eploop.c:54:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/eploop.c:17:5: enter_function: entry to ‘main’
liburing-2.13/test/eploop.c:25:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/eploop.c:28:15: branch_false: ...to here
liburing-2.13/test/eploop.c:29:12: branch_false: following ‘false’ branch...
liburing-2.13/test/eploop.c:34:19: branch_false: ...to here
liburing-2.13/test/eploop.c:35:12: branch_false: following ‘false’ branch (when ‘epollfd >= 0’)...
liburing-2.13/test/eploop.c:40:9: branch_false: ...to here
liburing-2.13/test/eploop.c:43:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
liburing-2.13/test/eploop.c:48:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/eploop.c:48:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/eploop.c:53:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/eploop.c:53:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/eploop.c:54:9: danger: dereference of NULL ‘_io_uring_get_sqe(&ring)’
# 52|
# 53| sqe = io_uring_get_sqe(&ring);
# 54|-> sqe->user_data = 2;
# 55| io_uring_prep_nop(sqe);
# 56| io_uring_submit(&ring);
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/evloop.c:53:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/evloop.c:19:5: enter_function: entry to ‘main’
liburing-2.13/test/evloop.c:26:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/evloop.c:29:15: branch_false: ...to here
liburing-2.13/test/evloop.c:30:12: branch_false: following ‘false’ branch...
liburing-2.13/test/evloop.c:35:15: branch_false: ...to here
liburing-2.13/test/evloop.c:36:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
liburing-2.13/test/evloop.c:41:15: branch_false: ...to here
liburing-2.13/test/evloop.c:42:12: branch_false: following ‘false’ branch...
liburing-2.13/test/evloop.c:47:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/evloop.c:47:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/evloop.c:52:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/evloop.c:52:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’
liburing-2.13/test/evloop.c:53:9: danger: dereference of NULL ‘_io_uring_get_sqe(&ring)’
# 51|
# 52| sqe = io_uring_get_sqe(&ring);
# 53|-> sqe->user_data = 2;
# 54| io_uring_prep_nop(sqe);
# 55| io_uring_submit(&ring);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/fc2a85cb02ef.c:51:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/thread-self/fail-nth", 2)’
liburing-2.13/test/fc2a85cb02ef.c:47:8: acquire_resource: opened here
liburing-2.13/test/fc2a85cb02ef.c:48:6: branch_false: following ‘false’ branch...
liburing-2.13/test/fc2a85cb02ef.c:51:3: branch_false: ...to here
liburing-2.13/test/fc2a85cb02ef.c:51:3: danger: ‘open("/proc/thread-self/fail-nth", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 49| exit(1);
# 50| char buf[16];
# 51|-> sprintf(buf, "%d", nth + 1);
# 52| if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf))
# 53| exit(1);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/fc2a85cb02ef.c:130:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘<return-value>’
liburing-2.13/test/fc2a85cb02ef.c:84:5: enter_function: entry to ‘main’
liburing-2.13/test/fc2a85cb02ef.c:86:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/fc2a85cb02ef.c:88:3: branch_false: ...to here
liburing-2.13/test/fc2a85cb02ef.c:89:7: call_function: calling ‘setup_fault’ from ‘main’
liburing-2.13/test/fc2a85cb02ef.c:89:7: return_function: returning to ‘main’ from ‘setup_fault’
liburing-2.13/test/fc2a85cb02ef.c:89:6: branch_false: following ‘false’ branch...
liburing-2.13/test/fc2a85cb02ef.c:94:3: branch_false: ...to here
liburing-2.13/test/fc2a85cb02ef.c:126:6: branch_false: following ‘false’ branch...
liburing-2.13/test/fc2a85cb02ef.c:128:28: branch_false: ...to here
liburing-2.13/test/fc2a85cb02ef.c:129:3: call_function: calling ‘inject_fault’ from ‘main’
liburing-2.13/test/fc2a85cb02ef.c:130:27: danger: ‘<return-value>’ leaks here; was opened at [(16)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/15)
# 128| *(uint32_t*)0x20000080 = r[1];
# 129| inject_fault(1);
# 130|-> __sys_io_uring_register(r[0], 2ul, (const void *) 0x20000080ul, 1ul);
# 131| return T_EXIT_PASS;
# 132| }
Error: GCC_ANALYZER_WARNING (CWE-910):
liburing-2.13/test/fd-install.c:227:15: warning[-Wanalyzer-fd-use-after-close]: ‘read’ on closed file descriptor ‘fds[0]’
liburing-2.13/test/fd-install.c:420:5: enter_function: entry to ‘main’
liburing-2.13/test/fd-install.c:425:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/fd-install.c:428:15: branch_false: ...to here
liburing-2.13/test/fd-install.c:429:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fd-install.c:434:15: branch_false: ...to here
liburing-2.13/test/fd-install.c:434:15: call_function: calling ‘test_working’ from ‘main’
# 225|
# 226| /* normal read should fail */
# 227|-> ret = read(fds[0], buf, 1);
# 228| if (ret != -1) {
# 229| fprintf(stderr, "unexpected read ret %d\n", ret);
Error: CPPCHECK_WARNING (CWE-401):
liburing-2.13/test/fdinfo-sqpoll.c:42: error[memleak]: Memory leak: buf
# 40| if (fd < 0) {
# 41| perror("open");
# 42|-> return NULL;
# 43| }
# 44|
Error: GCC_ANALYZER_WARNING (CWE-401):
liburing-2.13/test/fdinfo-sqpoll.c:59:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
liburing-2.13/test/fdinfo-sqpoll.c:36:15: acquire_memory: allocated here
liburing-2.13/test/fdinfo-sqpoll.c:40:12: branch_true: following ‘true’ branch...
liburing-2.13/test/fdinfo-sqpoll.c:41:17: branch_true: ...to here
liburing-2.13/test/fdinfo-sqpoll.c:59:1: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 57| free(buf);
# 58| return NULL;
# 59|-> }
# 60|
# 61| static int __test(void)
Error: CPPCHECK_WARNING (CWE-401):
liburing-2.13/test/fdinfo.c:39: error[memleak]: Memory leak: buf
# 37| if (fd < 0) {
# 38| perror("open");
# 39|-> return;
# 40| }
# 41|
Error: GCC_ANALYZER_WARNING (CWE-401):
liburing-2.13/test/fdinfo.c:56:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
liburing-2.13/test/fdinfo.c:337:12: enter_function: entry to ‘test_eventfd_read’
liburing-2.13/test/fdinfo.c:348:12: branch_false: following ‘false’ branch (when ‘ret != 1’)...
liburing-2.13/test/fdinfo.c:350:12: branch_false: ...to here
liburing-2.13/test/fdinfo.c:350:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
liburing-2.13/test/fdinfo.c:357:14: branch_false: ...to here
liburing-2.13/test/fdinfo.c:358:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
liburing-2.13/test/fdinfo.c:362:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_eventfd_read’
liburing-2.13/test/fdinfo.c:362:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_eventfd_read’
liburing-2.13/test/fdinfo.c:365:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fdinfo.c:369:9: branch_false: ...to here
liburing-2.13/test/fdinfo.c:369:9: call_function: calling ‘fdinfo_read’ from ‘test_eventfd_read’
# 54| close(fd);
# 55| free(buf);
# 56|-> }
# 57|
# 58| static int __test_io(const char *file, struct io_uring *ring, int write,
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/file-register.c:726: error[uninitvar]: Uninitialized variable: buffer
# 724| return -1;
# 725| }
# 726|-> io_uring_prep_write(sqe, 1, buffer, sizeof(buffer), 0);
# 727| sqe->flags |= IOSQE_FIXED_FILE;
# 728| sqe->user_data = 2;
Error: GCC_ANALYZER_WARNING (CWE-479):
liburing-2.13/test/files-exit-hang-poll.c:56:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
liburing-2.13/test/files-exit-hang-poll.c:59:5: enter_function: entry to ‘main’
liburing-2.13/test/files-exit-hang-poll.c:66:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/files-exit-hang-poll.c:69:26: branch_false: ...to here
liburing-2.13/test/files-exit-hang-poll.c:70:12: branch_false: following ‘false’ branch (when ‘sock_listen_fd >= 0’)...
liburing-2.13/test/files-exit-hang-poll.c:75:9: branch_false: ...to here
liburing-2.13/test/files-exit-hang-poll.c:81:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-poll.c:86:13: branch_false: ...to here
liburing-2.13/test/files-exit-hang-poll.c:86:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-poll.c:91:13: branch_false: ...to here
liburing-2.13/test/files-exit-hang-poll.c:91:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-poll.c:94:9: branch_false: ...to here
liburing-2.13/test/files-exit-hang-poll.c:94:9: call_function: calling ‘add_poll’ from ‘main’
liburing-2.13/test/files-exit-hang-poll.c:94:9: return_function: returning to ‘main’ from ‘add_poll’
liburing-2.13/test/files-exit-hang-poll.c:95:9: call_function: calling ‘add_accept’ from ‘main’
liburing-2.13/test/files-exit-hang-poll.c:95:9: return_function: returning to ‘main’ from ‘add_accept’
liburing-2.13/test/files-exit-hang-poll.c:98:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-poll.c:103:9: branch_false: ...to here
liburing-2.13/test/files-exit-hang-poll.c:54:13: enter_function: entry to ‘alarm_sig’
liburing-2.13/test/files-exit-hang-poll.c:56:9: danger: call to ‘exit’ from within signal handler
# 54| static void alarm_sig(int sig)
# 55| {
# 56|-> exit(0);
# 57| }
# 58|
Error: GCC_ANALYZER_WARNING (CWE-479):
liburing-2.13/test/files-exit-hang-timeout.c:63:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
liburing-2.13/test/files-exit-hang-timeout.c:66:5: enter_function: entry to ‘main’
liburing-2.13/test/files-exit-hang-timeout.c:74:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/files-exit-hang-timeout.c:77:26: branch_false: ...to here
liburing-2.13/test/files-exit-hang-timeout.c:78:12: branch_false: following ‘false’ branch (when ‘sock_listen_fd >= 0’)...
liburing-2.13/test/files-exit-hang-timeout.c:83:9: branch_false: ...to here
liburing-2.13/test/files-exit-hang-timeout.c:105:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-timeout.c:110:13: branch_false: ...to here
liburing-2.13/test/files-exit-hang-timeout.c:110:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-timeout.c:113:9: branch_false: ...to here
liburing-2.13/test/files-exit-hang-timeout.c:113:9: call_function: calling ‘add_timeout’ from ‘main’
liburing-2.13/test/files-exit-hang-timeout.c:113:9: return_function: returning to ‘main’ from ‘add_timeout’
liburing-2.13/test/files-exit-hang-timeout.c:114:9: call_function: calling ‘add_accept’ from ‘main’
liburing-2.13/test/files-exit-hang-timeout.c:114:9: return_function: returning to ‘main’ from ‘add_accept’
liburing-2.13/test/files-exit-hang-timeout.c:117:12: branch_false: following ‘false’ branch...
liburing-2.13/test/files-exit-hang-timeout.c:122:9: branch_false: ...to here
liburing-2.13/test/files-exit-hang-timeout.c:61:13: enter_function: entry to ‘alarm_sig’
liburing-2.13/test/files-exit-hang-timeout.c:63:9: danger: call to ‘exit’ from within signal handler
# 61| static void alarm_sig(int sig)
# 62| {
# 63|-> exit(0);
# 64| }
# 65|
Error: GCC_ANALYZER_WARNING (CWE-688):
liburing-2.13/test/fixed-buf-iter.c:42:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(4096)’ where non-null expected
liburing-2.13/test/fixed-buf-iter.c:28:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-buf-iter.c:33:18: branch_false: ...to here
liburing-2.13/test/fixed-buf-iter.c:34:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-buf-iter.c:34:12: branch_false: ...to here
liburing-2.13/test/fixed-buf-iter.c:39:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
liburing-2.13/test/fixed-buf-iter.c:40:35: branch_true: ...to here
liburing-2.13/test/fixed-buf-iter.c:40:35: acquire_memory: this call could return NULL
liburing-2.13/test/fixed-buf-iter.c:42:17: danger: argument 1 (‘malloc(4096)’) from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
# 40| iov[i].iov_base = malloc(BUF_SIZE);
# 41| iov[i].iov_len = BUF_SIZE;
# 42|-> memset(iov[i].iov_base, 0, BUF_SIZE);
# 43| }
# 44|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/fixed-link.c:42:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/zero", 0)’
liburing-2.13/test/fixed-link.c:21:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/fixed-link.c:24:14: branch_false: ...to here
liburing-2.13/test/fixed-link.c:24:14: acquire_resource: opened here
liburing-2.13/test/fixed-link.c:25:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-link.c:30:13: branch_false: ...to here
liburing-2.13/test/fixed-link.c:30:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-link.c:30:12: branch_false: ...to here
liburing-2.13/test/fixed-link.c:36:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/test/fixed-link.c:37:38: branch_true: ...to here
liburing-2.13/test/fixed-link.c:42:12: danger: ‘open("/dev/zero", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 40|
# 41| ret = io_uring_register_buffers(&ring, iovecs, IOVECS_LEN);
# 42|-> if (ret) {
# 43| fprintf(stderr, "Failed to register buffers\n");
# 44| return T_EXIT_FAIL;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/fixed-seg.c:135:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
liburing-2.13/test/fixed-seg.c:117:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-seg.c:121:15: branch_false: ...to here
liburing-2.13/test/fixed-seg.c:124:12: branch_true: following ‘true’ branch...
liburing-2.13/test/fixed-seg.c:124:20: branch_true: ...to here
liburing-2.13/test/fixed-seg.c:124:13: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-seg.c:129:18: branch_false: ...to here
liburing-2.13/test/fixed-seg.c:129:18: acquire_resource: opened here
liburing-2.13/test/fixed-seg.c:135:13: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 133| }
# 134|
# 135|-> if (posix_memalign(&wvec.iov_base, 4096, 512*1024))
# 136| goto err;
# 137| wvec.iov_len = 512*1024;
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/fixed-seg.c:139:15: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘open("/dev/urandom", 0)’
liburing-2.13/test/fixed-seg.c:117:12: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-seg.c:121:15: branch_false: ...to here
liburing-2.13/test/fixed-seg.c:124:12: branch_true: following ‘true’ branch...
liburing-2.13/test/fixed-seg.c:124:20: branch_true: ...to here
liburing-2.13/test/fixed-seg.c:124:13: branch_false: following ‘false’ branch...
liburing-2.13/test/fixed-seg.c:129:18: branch_false: ...to here
liburing-2.13/test/fixed-seg.c:129:18: acquire_resource: opened here
liburing-2.13/test/fixed-seg.c:135:13: branch_true: following ‘true’ branch...
liburing-2.13/test/fixed-seg.c:135:13: branch_true: ...to here
liburing-2.13/test/fixed-seg.c:139:15: danger: ‘open("/dev/urandom", 0)’ could be invalid: unchecked value from [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
# 137| wvec.iov_len = 512*1024;
# 138|
# 139|-> ret = read(rnd_fd, wvec.iov_base, wvec.iov_len);
# 140| if (ret != wvec.iov_len) {
# 141| fprintf(stderr, "Precondition, urandom read failed, ret: %d\n", ret);
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex-kill.c:41: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 39|
# 40| futex = malloc(sizeof(*futex));
# 41|-> *futex = 0;
# 42| fw.uaddr = (unsigned long) futex;
# 43| fw.flags = FUTEX2_SIZE_U32|FUTEX2_PRIVATE;
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/futex-kill.c:41:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘futex’
liburing-2.13/test/futex-kill.c:79:5: enter_function: entry to ‘main’
liburing-2.13/test/futex-kill.c:83:15: call_function: calling ‘test’ from ‘main’
# 39|
# 40| futex = malloc(sizeof(*futex));
# 41|-> *futex = 0;
# 42| fw.uaddr = (unsigned long) futex;
# 43| fw.flags = FUTEX2_SIZE_U32|FUTEX2_PRIVATE;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex.c:182: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 180|
# 181| futex = malloc(sizeof(*futex));
# 182|-> *futex = 0;
# 183|
# 184| fw.uaddr = (unsigned long) futex;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex.c:211: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 209| * Now submit wake for just one futex
# 210| */
# 211|-> *futex = 1;
# 212| sqe = io_uring_get_sqe(&ring);
# 213| io_uring_prep_futex_wake(sqe, futex, 1, FUTEX_BITSET_MATCH_ANY,
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex.c:271: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 269|
# 270| futex = malloc(sizeof(*futex));
# 271|-> *futex = 0;
# 272|
# 273| fw.val = 0;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex.c:302: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 300| * Now submit wake for both futexes
# 301| */
# 302|-> *futex = 1;
# 303| sqe = io_uring_get_sqe(&ring);
# 304| io_uring_prep_futex_wake(sqe, futex, 2, FUTEX_BITSET_MATCH_ANY,
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 352|
# 353| futex = malloc(sizeof(*futex));
# 354|-> *futex = 0;
# 355|
# 356| sqe = io_uring_get_sqe(&ring);
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/futex.c:412: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex
# 410|
# 411| futex = malloc(sizeof(*futex));
# 412|-> *futex = 0;
# 413|
# 414| sqe = io_uring_get_sqe(&ring);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/helpers.c:187:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor
liburing-2.13/test/helpers.c:184:17: acquire_resource: socket created here
liburing-2.13/test/helpers.c:185:12: branch_false: following ‘false’ branch...
liburing-2.13/test/helpers.c:187:17: branch_false: ...to here
liburing-2.13/test/helpers.c:187:17: danger: leaks here
# 185| if (fd[0] < 0)
# 186| return errno;
# 187|-> fd[1] = socket(AF_INET, type, 0);
# 188| if (fd[1] < 0) {
# 189| ret = errno;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/helpers.c:211:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*fd’
liburing-2.13/test/helpers.c:185:12: branch_false: following ‘false’ branch...
liburing-2.13/test/helpers.c:187:17: branch_false: ...to here
liburing-2.13/test/helpers.c:188:12: branch_false: following ‘false’ branch...
liburing-2.13/test/helpers.c:194:9: branch_false: ...to here
liburing-2.13/test/helpers.c:195:12: branch_false: following ‘false’ branch...
liburing-2.13/test/helpers.c:198:9: branch_false: ...to here
liburing-2.13/test/helpers.c:206:12: branch_false: following ‘false’ branch...
liburing-2.13/test/helpers.c:211:12: branch_false: ...to here
liburing-2.13/test/helpers.c:211:12: branch_true: following ‘true’ branch (when ‘stream != 0’)...
liburing-2.13/test/helpers.c:211:23: branch_true: ...to here
liburing-2.13/test/helpers.c:211:23: danger: ‘*fd’ leaks here
# 209| }
# 210|
# 211|-> if (stream && listen(fd[0], 16)) {
# 212| fprintf(stderr, "listen failed\n");
# 213| goto errno_cleanup;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/io-cancel.c:194:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/io-cancel.c:487:5: enter_function: entry to ‘main’
liburing-2.13/test/io-cancel.c:492:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/io-cancel.c:495:13: branch_false: ...to here
liburing-2.13/test/io-cancel.c:495:13: call_function: calling ‘test_dont_cancel_another_ring’ from ‘main’
# 192| if (ret) {
# 193| fprintf(stderr, "ring create failed: %d\n", ret);
# 194|-> return 1;
# 195| }
# 196| ret = io_uring_queue_init(8, &ring2, 0);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/io-cancel.c:194:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/io-cancel.c:487:5: enter_function: entry to ‘main’
liburing-2.13/test/io-cancel.c:492:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/io-cancel.c:495:13: branch_false: ...to here
liburing-2.13/test/io-cancel.c:495:13: call_function: calling ‘test_dont_cancel_another_ring’ from ‘main’
# 192| if (ret) {
# 193| fprintf(stderr, "ring create failed: %d\n", ret);
# 194|-> return 1;
# 195| }
# 196| ret = io_uring_queue_init(8, &ring2, 0);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/io_uring_register.c:178:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
liburing-2.13/test/io_uring_register.c:480:5: enter_function: entry to ‘main’
liburing-2.13/test/io_uring_register.c:487:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/io_uring_register.c:491:20: branch_false: ...to here
liburing-2.13/test/io_uring_register.c:493:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
liburing-2.13/test/io_uring_register.c:497:23: branch_false: ...to here
liburing-2.13/test/io_uring_register.c:499:12: branch_false: following ‘false’ branch...
liburing-2.13/test/io_uring_register.c:505:19: branch_false: ...to here
liburing-2.13/test/io_uring_register.c:511:14: call_function: calling ‘new_io_uring’ from ‘main’
liburing-2.13/test/io_uring_register.c:511:14: return_function: returning to ‘main’ from ‘new_io_uring’
liburing-2.13/test/io_uring_register.c:521:19: call_function: calling ‘test_iovec_size’ from ‘main’
liburing-2.13/test/io_uring_register.c:521:19: return_function: returning to ‘main’ from ‘test_iovec_size’
liburing-2.13/test/io_uring_register.c:524:19: call_function: calling ‘test_max_fds’ from ‘main’
# 176| fds = mmap(fd_as, 128*1024*1024, PROT_READ|PROT_WRITE,
# 177| MAP_SHARED|MAP_FIXED, fdtable_fd, 0);
# 178|-> if (fds == MAP_FAILED) {
# 179| perror("mmap fdtable");
# 180| exit(1);
Error: COMPILER_WARNING:
liburing-2.13/test/io_uring_register.c:410:9: warning[-Wstringop-overflow=]: ‘memset’ writing 63 bytes into a region of size 0 overflows the destination
#destination object is likely at address zero
# 408|
# 409| sqe = io_uring_get_sqe(ring);
# 410|-> memset(sqe, 0, sizeof(*sqe));
# 411| sqe->opcode = IORING_OP_POLL_ADD;
# 412| if (fixed)
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/io_uring_register.c:411:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
liburing-2.13/test/io_uring_register.c:403:12: enter_function: entry to ‘ioring_poll’
liburing-2.13/test/io_uring_register.c:409:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘ioring_poll’
liburing-2.13/test/io_uring_register.c:409:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘ioring_poll’
liburing-2.13/test/io_uring_register.c:411:9: danger: dereference of NULL ‘_io_uring_get_sqe(ring)’
# 409| sqe = io_uring_get_sqe(ring);
# 410| memset(sqe, 0, sizeof(*sqe));
# 411|-> sqe->opcode = IORING_OP_POLL_ADD;
# 412| if (fixed)
# 413| sqe->flags = IOSQE_FIXED_FILE;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/iowait.c:54:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/iowait.c:56:12: branch_false: following ‘false’ branch...
liburing-2.13/test/iowait.c:61:15: branch_false: ...to here
liburing-2.13/test/iowait.c:62:12: branch_true: following ‘true’ branch...
liburing-2.13/test/iowait.c:63:17: branch_true: ...to here
liburing-2.13/test/iowait.c:54:24: danger: ‘fds[0]’ leaks here
# 52|
# 53| if (!(ring->features & IORING_FEAT_NO_IOWAIT))
# 54|-> return T_EXIT_SKIP;
# 55|
# 56| if (pipe(fds) < 0) {
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/iowait.c:54:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/iowait.c:56:12: branch_false: following ‘false’ branch...
liburing-2.13/test/iowait.c:61:15: branch_false: ...to here
liburing-2.13/test/iowait.c:62:12: branch_true: following ‘true’ branch...
liburing-2.13/test/iowait.c:63:17: branch_true: ...to here
liburing-2.13/test/iowait.c:54:24: danger: ‘fds[1]’ leaks here
# 52|
# 53| if (!(ring->features & IORING_FEAT_NO_IOWAIT))
# 54|-> return T_EXIT_SKIP;
# 55|
# 56| if (pipe(fds) < 0) {
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/iowait.c:54:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[with_iowait]’
liburing-2.13/test/iowait.c:106:5: enter_function: entry to ‘main’
liburing-2.13/test/iowait.c:114:12: branch_false: following ‘false’ branch...
liburing-2.13/test/iowait.c:117:15: branch_false: ...to here
liburing-2.13/test/iowait.c:118:12: branch_false: following ‘false’ branch (when ‘ret != 1’)...
liburing-2.13/test/iowait.c:120:17: branch_false: ...to here
liburing-2.13/test/iowait.c:120:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
liburing-2.13/test/iowait.c:123:15: branch_false: ...to here
liburing-2.13/test/iowait.c:123:15: call_function: calling ‘test’ from ‘main’
# 52|
# 53| if (!(ring->features & IORING_FEAT_NO_IOWAIT))
# 54|-> return T_EXIT_SKIP;
# 55|
# 56| if (pipe(fds) < 0) {
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/lfs-openat-write.c:110:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/tmp", 65536)’
liburing-2.13/test/lfs-openat-write.c:102:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/lfs-openat-write.c:105:15: branch_false: ...to here
liburing-2.13/test/lfs-openat-write.c:105:15: acquire_resource: opened here
liburing-2.13/test/lfs-openat-write.c:106:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat-write.c:109:15: branch_false: ...to here
liburing-2.13/test/lfs-openat-write.c:110:12: danger: ‘open("/tmp", 65536)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 108|
# 109| ret = io_uring_queue_init(RSIZE, &ring, 0);
# 110|-> if (ret < 0)
# 111| DIE("failed to init io_uring: %s\n", strerror(-ret));
# 112|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/lfs-openat.c:93:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/lfs-openat.c:78:12: enter_function: entry to ‘test_linked_files’
liburing-2.13/test/lfs-openat.c:88:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:91:13: branch_false: ...to here
liburing-2.13/test/lfs-openat.c:91:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:96:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_linked_files’
liburing-2.13/test/lfs-openat.c:96:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_linked_files’
liburing-2.13/test/lfs-openat.c:97:12: branch_true: following ‘true’ branch...
liburing-2.13/test/lfs-openat.c:98:17: branch_true: ...to here
liburing-2.13/test/lfs-openat.c:93:24: danger: ‘fds[0]’ leaks here
# 91| if (pipe(fds)) {
# 92| perror("pipe");
# 93|-> return 1;
# 94| }
# 95|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/lfs-openat.c:93:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/lfs-openat.c:78:12: enter_function: entry to ‘test_linked_files’
liburing-2.13/test/lfs-openat.c:88:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:91:13: branch_false: ...to here
liburing-2.13/test/lfs-openat.c:91:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:96:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_linked_files’
liburing-2.13/test/lfs-openat.c:96:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_linked_files’
liburing-2.13/test/lfs-openat.c:97:12: branch_true: following ‘true’ branch...
liburing-2.13/test/lfs-openat.c:98:17: branch_true: ...to here
liburing-2.13/test/lfs-openat.c:93:24: danger: ‘fds[1]’ leaks here
# 91| if (pipe(fds)) {
# 92| perror("pipe");
# 93|-> return 1;
# 94| }
# 95|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/lfs-openat.c:146:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/lfs-openat.c:132:12: enter_function: entry to ‘test_drained_files’
liburing-2.13/test/lfs-openat.c:141:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:144:13: branch_false: ...to here
liburing-2.13/test/lfs-openat.c:144:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:149:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_drained_files’
liburing-2.13/test/lfs-openat.c:149:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_drained_files’
liburing-2.13/test/lfs-openat.c:150:12: branch_true: following ‘true’ branch...
liburing-2.13/test/lfs-openat.c:151:17: branch_true: ...to here
liburing-2.13/test/lfs-openat.c:146:24: danger: ‘fds[0]’ leaks here
# 144| if (pipe(fds)) {
# 145| perror("pipe");
# 146|-> return 1;
# 147| }
# 148|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/lfs-openat.c:146:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/lfs-openat.c:132:12: enter_function: entry to ‘test_drained_files’
liburing-2.13/test/lfs-openat.c:141:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:144:13: branch_false: ...to here
liburing-2.13/test/lfs-openat.c:144:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:149:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_drained_files’
liburing-2.13/test/lfs-openat.c:149:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_drained_files’
liburing-2.13/test/lfs-openat.c:150:12: branch_true: following ‘true’ branch...
liburing-2.13/test/lfs-openat.c:151:17: branch_true: ...to here
liburing-2.13/test/lfs-openat.c:146:24: danger: ‘fds[1]’ leaks here
# 144| if (pipe(fds)) {
# 145| perror("pipe");
# 146|-> return 1;
# 147| }
# 148|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/lfs-openat.c:227:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/tmp", 2097152)’
liburing-2.13/test/lfs-openat.c:219:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/lfs-openat.c:222:15: branch_false: ...to here
liburing-2.13/test/lfs-openat.c:222:15: acquire_resource: opened here
liburing-2.13/test/lfs-openat.c:223:12: branch_false: following ‘false’ branch...
liburing-2.13/test/lfs-openat.c:226:15: branch_false: ...to here
liburing-2.13/test/lfs-openat.c:227:12: danger: ‘open("/tmp", 2097152)’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 225|
# 226| ret = io_uring_queue_init(RSIZE, &ring, 0);
# 227|-> if (ret < 0)
# 228| DIE("failed to init io_uring: %s\n", strerror(-ret));
# 229|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/link-timeout.c:685:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/link-timeout.c:1143:5: enter_function: entry to ‘main’
liburing-2.13/test/link-timeout.c:1148:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/link-timeout.c:1151:15: branch_false: ...to here
liburing-2.13/test/link-timeout.c:1152:12: branch_false: following ‘false’ branch...
liburing-2.13/test/link-timeout.c:1157:15: branch_false: ...to here
liburing-2.13/test/link-timeout.c:1157:15: call_function: calling ‘test_timeout_link_chain1’ from ‘main’
# 683| if (pipe(fds)) {
# 684| perror("pipe");
# 685|-> return 1;
# 686| }
# 687|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/link-timeout.c:685:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/link-timeout.c:1143:5: enter_function: entry to ‘main’
liburing-2.13/test/link-timeout.c:1148:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/link-timeout.c:1151:15: branch_false: ...to here
liburing-2.13/test/link-timeout.c:1152:12: branch_false: following ‘false’ branch...
liburing-2.13/test/link-timeout.c:1157:15: branch_false: ...to here
liburing-2.13/test/link-timeout.c:1157:15: call_function: calling ‘test_timeout_link_chain1’ from ‘main’
# 683| if (pipe(fds)) {
# 684| perror("pipe");
# 685|-> return 1;
# 686| }
# 687|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0][0]’
liburing-2.13/test/min-timeout.c:82:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:15: branch_false: ...to here
liburing-2.13/test/min-timeout.c:84:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:12: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_true: following ‘true’ branch...
liburing-2.13/test/min-timeout.c:91:25: branch_true: ...to here
liburing-2.13/test/min-timeout.c:83:24: danger: ‘fds[0][0]’ leaks here
# 81| ret = io_uring_queue_init_params(NPIPES, &ring, &p);
# 82| if (ret == -EINVAL)
# 83|-> return T_EXIT_SKIP;
# 84| if (!(p.features & IORING_FEAT_MIN_TIMEOUT)) {
# 85| no_min_timeout = 1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0][1]’
liburing-2.13/test/min-timeout.c:82:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:15: branch_false: ...to here
liburing-2.13/test/min-timeout.c:84:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:12: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_true: following ‘true’ branch...
liburing-2.13/test/min-timeout.c:91:25: branch_true: ...to here
liburing-2.13/test/min-timeout.c:83:24: danger: ‘fds[0][1]’ leaks here
# 81| ret = io_uring_queue_init_params(NPIPES, &ring, &p);
# 82| if (ret == -EINVAL)
# 83|-> return T_EXIT_SKIP;
# 84| if (!(p.features & IORING_FEAT_MIN_TIMEOUT)) {
# 85| no_min_timeout = 1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1][0]’
liburing-2.13/test/min-timeout.c:82:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:15: branch_false: ...to here
liburing-2.13/test/min-timeout.c:84:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:12: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_true: following ‘true’ branch...
liburing-2.13/test/min-timeout.c:91:25: branch_true: ...to here
liburing-2.13/test/min-timeout.c:83:24: danger: ‘fds[1][0]’ leaks here
# 81| ret = io_uring_queue_init_params(NPIPES, &ring, &p);
# 82| if (ret == -EINVAL)
# 83|-> return T_EXIT_SKIP;
# 84| if (!(p.features & IORING_FEAT_MIN_TIMEOUT)) {
# 85| no_min_timeout = 1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1][1]’
liburing-2.13/test/min-timeout.c:82:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:15: branch_false: ...to here
liburing-2.13/test/min-timeout.c:84:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:12: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_true: following ‘true’ branch...
liburing-2.13/test/min-timeout.c:91:25: branch_true: ...to here
liburing-2.13/test/min-timeout.c:83:24: danger: ‘fds[1][1]’ leaks here
# 81| ret = io_uring_queue_init_params(NPIPES, &ring, &p);
# 82| if (ret == -EINVAL)
# 83|-> return T_EXIT_SKIP;
# 84| if (!(p.features & IORING_FEAT_MIN_TIMEOUT)) {
# 85| no_min_timeout = 1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[2][0]’
liburing-2.13/test/min-timeout.c:82:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:15: branch_false: ...to here
liburing-2.13/test/min-timeout.c:84:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:12: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_true: following ‘true’ branch...
liburing-2.13/test/min-timeout.c:91:25: branch_true: ...to here
liburing-2.13/test/min-timeout.c:83:24: danger: ‘fds[2][0]’ leaks here
# 81| ret = io_uring_queue_init_params(NPIPES, &ring, &p);
# 82| if (ret == -EINVAL)
# 83|-> return T_EXIT_SKIP;
# 84| if (!(p.features & IORING_FEAT_MIN_TIMEOUT)) {
# 85| no_min_timeout = 1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[2][1]’
liburing-2.13/test/min-timeout.c:82:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:15: branch_false: ...to here
liburing-2.13/test/min-timeout.c:84:12: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:84:12: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_false: following ‘false’ branch...
liburing-2.13/test/min-timeout.c:94:27: branch_false: ...to here
liburing-2.13/test/min-timeout.c:89:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
liburing-2.13/test/min-timeout.c:90:26: branch_true: ...to here
liburing-2.13/test/min-timeout.c:90:20: branch_true: following ‘true’ branch...
liburing-2.13/test/min-timeout.c:91:25: branch_true: ...to here
liburing-2.13/test/min-timeout.c:83:24: danger: ‘fds[2][1]’ leaks here
# 81| ret = io_uring_queue_init_params(NPIPES, &ring, &p);
# 82| if (ret == -EINVAL)
# 83|-> return T_EXIT_SKIP;
# 84| if (!(p.features & IORING_FEAT_MIN_TIMEOUT)) {
# 85| no_min_timeout = 1;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/mock_file.c:148: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf_src
# 146|
# 147| for (i = 0; i < size; i++)
# 148|-> buf_src[i] = 'a' + (i % 26);
# 149|
# 150| buf_iovec[0].iov_base = buf_src;
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/mock_file.c:161: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf_dst
# 159| }
# 160|
# 161|-> memset(buf_dst, 0, size);
# 162| iov[0].iov_len = size;
# 163| iov[0].iov_base = buf_src;
Error: CPPCHECK_WARNING (CWE-401):
liburing-2.13/test/mock_file.c:309: error[memleak]: Memory leak: buffer
# 307| if (ret) {
# 308| fprintf(stderr, "ring setup failed: %d\n", ret);
# 309|-> return 1;
# 310| }
# 311|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/msg-ring-fd.c:93:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/msg-ring-fd.c:309:5: enter_function: entry to ‘main’
liburing-2.13/test/msg-ring-fd.c:313:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/msg-ring-fd.c:316:15: branch_false: ...to here
liburing-2.13/test/msg-ring-fd.c:316:15: call_function: calling ‘test’ from ‘main’
# 91|
# 92| if (no_fd_pass)
# 93|-> return 0;
# 94|
# 95| pthread_barrier_init(&d.barrier, NULL, 2);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/msg-ring-fd.c:168:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/msg-ring-fd.c:309:5: enter_function: entry to ‘main’
liburing-2.13/test/msg-ring-fd.c:313:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/msg-ring-fd.c:316:15: branch_false: ...to here
liburing-2.13/test/msg-ring-fd.c:316:15: call_function: calling ‘test’ from ‘main’
# 166|
# 167| if (no_fd_pass)
# 168|-> return 0;
# 169|
# 170| fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:198:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[0][0]’
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:197:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:198:32: danger: ‘pipes[0][0]’ leaks here
# 196| if (pipe(pipes[i]) != 0) {
# 197| perror("pipe");
# 198|-> return 1;
# 199| }
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:198:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[0][1]’
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:197:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:198:32: danger: ‘pipes[0][1]’ leaks here
# 196| if (pipe(pipes[i]) != 0) {
# 197| perror("pipe");
# 198|-> return 1;
# 199| }
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:198:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[1][0]’
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:197:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:198:32: danger: ‘pipes[1][0]’ leaks here
# 196| if (pipe(pipes[i]) != 0) {
# 197| perror("pipe");
# 198|-> return 1;
# 199| }
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:198:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[1][1]’
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:197:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:198:32: danger: ‘pipes[1][1]’ leaks here
# 196| if (pipe(pipes[i]) != 0) {
# 197| perror("pipe");
# 198|-> return 1;
# 199| }
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:198:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[2][0]’
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:197:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:198:32: danger: ‘pipes[2][0]’ leaks here
# 196| if (pipe(pipes[i]) != 0) {
# 197| perror("pipe");
# 198|-> return 1;
# 199| }
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:198:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[2][1]’
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:195:36: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:195:21: branch_true: following ‘true’ branch (when ‘i != 50’)...
liburing-2.13/test/multicqes_drain.c:196:26: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:196:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:197:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:198:32: danger: ‘pipes[2][1]’ leaks here
# 196| if (pipe(pipes[i]) != 0) {
# 197| perror("pipe");
# 198|-> return 1;
# 199| }
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:288:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/multicqes_drain.c:286:12: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:286:33: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:286:13: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:287:17: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:288:24: danger: ‘pipe1[0]’ leaks here
# 286| if (pipe(pipe1) != 0 || pipe(pipe2) != 0) {
# 287| perror("pipe");
# 288|-> return 1;
# 289| }
# 290|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:288:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/multicqes_drain.c:286:12: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:286:33: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:286:13: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:287:17: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:288:24: danger: ‘pipe1[1]’ leaks here
# 286| if (pipe(pipe1) != 0 || pipe(pipe2) != 0) {
# 287| perror("pipe");
# 288|-> return 1;
# 289| }
# 290|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:288:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[i]’
liburing-2.13/test/multicqes_drain.c:370:12: enter_function: entry to ‘test’
liburing-2.13/test/multicqes_drain.c:381:12: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:381:12: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:386:21: branch_true: following ‘true’ branch (when ‘i != 5’)...
liburing-2.13/test/multicqes_drain.c:387:23: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:387:23: call_function: calling ‘test_simple_drain’ from ‘test’
# 286| if (pipe(pipe1) != 0 || pipe(pipe2) != 0) {
# 287| perror("pipe");
# 288|-> return 1;
# 289| }
# 290|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:288:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe2[0]’
liburing-2.13/test/multicqes_drain.c:279:12: enter_function: entry to ‘test_simple_drain’
liburing-2.13/test/multicqes_drain.c:286:12: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:286:33: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:286:13: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:286:13: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:291:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/test/multicqes_drain.c:292:26: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_simple_drain’
liburing-2.13/test/multicqes_drain.c:293:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:294:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:288:24: danger: ‘pipe2[0]’ leaks here
# 286| if (pipe(pipe1) != 0 || pipe(pipe2) != 0) {
# 287| perror("pipe");
# 288|-> return 1;
# 289| }
# 290|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:288:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe2[1]’
liburing-2.13/test/multicqes_drain.c:279:12: enter_function: entry to ‘test_simple_drain’
liburing-2.13/test/multicqes_drain.c:286:12: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:286:33: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:286:13: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:286:13: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:291:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
liburing-2.13/test/multicqes_drain.c:292:26: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_simple_drain’
liburing-2.13/test/multicqes_drain.c:293:20: branch_true: following ‘true’ branch...
liburing-2.13/test/multicqes_drain.c:294:25: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:288:24: danger: ‘pipe2[1]’ leaks here
# 286| if (pipe(pipe1) != 0 || pipe(pipe2) != 0) {
# 287| perror("pipe");
# 288|-> return 1;
# 289| }
# 290|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/multicqes_drain.c:288:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe2[i]’
liburing-2.13/test/multicqes_drain.c:370:12: enter_function: entry to ‘test’
liburing-2.13/test/multicqes_drain.c:381:12: branch_false: following ‘false’ branch...
liburing-2.13/test/multicqes_drain.c:381:12: branch_false: ...to here
liburing-2.13/test/multicqes_drain.c:386:21: branch_true: following ‘true’ branch (when ‘i != 5’)...
liburing-2.13/test/multicqes_drain.c:387:23: branch_true: ...to here
liburing-2.13/test/multicqes_drain.c:387:23: call_function: calling ‘test_simple_drain’ from ‘test’
# 286| if (pipe(pipe1) != 0 || pipe(pipe2) != 0) {
# 287| perror("pipe");
# 288|-> return 1;
# 289| }
# 290|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/pipe-bug.c:40:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/pipe-bug.c:88:5: enter_function: entry to ‘main’
liburing-2.13/test/pipe-bug.c:92:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/pipe-bug.c:92:12: branch_false: ...to here
liburing-2.13/test/pipe-bug.c:95:21: branch_true: following ‘true’ branch (when ‘i != 10000’)...
liburing-2.13/test/pipe-bug.c:96:21: branch_true: ...to here
liburing-2.13/test/pipe-bug.c:96:20: branch_false: following ‘false’ branch...
liburing-2.13/test/pipe-bug.c:95:32: branch_false: ...to here
liburing-2.13/test/pipe-bug.c:95:21: branch_true: following ‘true’ branch (when ‘i != 10000’)...
liburing-2.13/test/pipe-bug.c:96:21: branch_true: ...to here
liburing-2.13/test/pipe-bug.c:96:21: call_function: calling ‘pipe_bug’ from ‘main’
# 38| if (ret == -ENOMEM) {
# 39| usleep(1000);
# 40|-> return 0;
# 41| } else if (ret) {
# 42| fprintf(stderr, "ring_init: %d\n", ret);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/pipe-bug.c:40:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/pipe-bug.c:88:5: enter_function: entry to ‘main’
liburing-2.13/test/pipe-bug.c:92:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/pipe-bug.c:92:12: branch_false: ...to here
liburing-2.13/test/pipe-bug.c:95:21: branch_true: following ‘true’ branch (when ‘i != 10000’)...
liburing-2.13/test/pipe-bug.c:96:21: branch_true: ...to here
liburing-2.13/test/pipe-bug.c:96:21: call_function: calling ‘pipe_bug’ from ‘main’
# 38| if (ret == -ENOMEM) {
# 39| usleep(1000);
# 40|-> return 0;
# 41| } else if (ret) {
# 42| fprintf(stderr, "ring_init: %d\n", ret);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/pipe-bug.c:40:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[i]’
liburing-2.13/test/pipe-bug.c:88:5: enter_function: entry to ‘main’
liburing-2.13/test/pipe-bug.c:92:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/pipe-bug.c:92:12: branch_false: ...to here
liburing-2.13/test/pipe-bug.c:95:21: branch_true: following ‘true’ branch (when ‘i != 10000’)...
liburing-2.13/test/pipe-bug.c:96:21: branch_true: ...to here
liburing-2.13/test/pipe-bug.c:96:21: call_function: calling ‘pipe_bug’ from ‘main’
# 38| if (ret == -ENOMEM) {
# 39| usleep(1000);
# 40|-> return 0;
# 41| } else if (ret) {
# 42| fprintf(stderr, "ring_init: %d\n", ret);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-cancel.c:41:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/poll-cancel.c:39:12: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-cancel.c:44:15: branch_false: ...to here
liburing-2.13/test/poll-cancel.c:41:24: danger: ‘pipe1[0]’ leaks here
# 39| if (pipe(pipe1) != 0) {
# 40| perror("pipe");
# 41|-> return 1;
# 42| }
# 43|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-cancel.c:41:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/poll-cancel.c:39:12: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-cancel.c:44:15: branch_false: ...to here
liburing-2.13/test/poll-cancel.c:41:24: danger: ‘pipe1[1]’ leaks here
# 39| if (pipe(pipe1) != 0) {
# 40| perror("pipe");
# 41|-> return 1;
# 42| }
# 43|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-mshot-overflow.c:151:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/poll-mshot-overflow.c:233:5: enter_function: entry to ‘main’
liburing-2.13/test/poll-mshot-overflow.c:238:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/poll-mshot-overflow.c:241:25: branch_false: ...to here
liburing-2.13/test/poll-mshot-overflow.c:242:15: call_function: calling ‘test_downgrade’ from ‘main’
# 149| if (pipe(fds) != 0) {
# 150| perror("pipe");
# 151|-> return -1;
# 152| }
# 153|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-mshot-overflow.c:151:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/poll-mshot-overflow.c:233:5: enter_function: entry to ‘main’
liburing-2.13/test/poll-mshot-overflow.c:238:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/poll-mshot-overflow.c:241:25: branch_false: ...to here
liburing-2.13/test/poll-mshot-overflow.c:242:15: call_function: calling ‘test_downgrade’ from ‘main’
# 149| if (pipe(fds) != 0) {
# 150| perror("pipe");
# 151|-> return -1;
# 152| }
# 153|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-v-poll.c:100:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/poll-v-poll.c:98:12: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-v-poll.c:103:9: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:100:24: danger: ‘pipe1[1]’ leaks here
# 98| if (pipe(pipe1) < 0) {
# 99| perror("pipe");
# 100|-> return 1;
# 101| }
# 102|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-v-poll.c:139:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/poll-v-poll.c:137:12: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-v-poll.c:142:9: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:139:24: danger: ‘pipe1[0]’ leaks here
# 137| if (pipe(pipe1) < 0) {
# 138| perror("pipe");
# 139|-> return 1;
# 140| }
# 141|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-v-poll.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/poll-v-poll.c:236:12: enter_function: entry to ‘do_test_epoll’
liburing-2.13/test/poll-v-poll.c:246:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
liburing-2.13/test/poll-v-poll.c:251:13: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:251:12: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-v-poll.c:256:9: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:259:12: branch_false: following ‘false’ branch (when ‘iou_epoll_add != 0’)...
liburing-2.13/test/poll-v-poll.c:265:23: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:265:23: call_function: calling ‘iou_epoll_ctl’ from ‘do_test_epoll’
liburing-2.13/test/poll-v-poll.c:265:23: return_function: returning to ‘do_test_epoll’ from ‘iou_epoll_ctl’
liburing-2.13/test/poll-v-poll.c:266:20: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-v-poll.c:269:27: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:269:27: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-v-poll.c:274:9: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:248:24: danger: ‘pipe1[0]’ leaks here
# 246| if (fd < 0) {
# 247| perror("epoll_create");
# 248|-> return 1;
# 249| }
# 250|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll-v-poll.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/poll-v-poll.c:246:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
liburing-2.13/test/poll-v-poll.c:251:13: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:251:12: branch_false: following ‘false’ branch...
liburing-2.13/test/poll-v-poll.c:256:9: branch_false: ...to here
liburing-2.13/test/poll-v-poll.c:259:12: branch_true: following ‘true’ branch (when ‘iou_epoll_add == 0’)...
liburing-2.13/test/poll-v-poll.c:260:21: branch_true: ...to here
liburing-2.13/test/poll-v-poll.c:248:24: danger: ‘pipe1[1]’ leaks here
# 246| if (fd < 0) {
# 247| perror("epoll_create");
# 248|-> return 1;
# 249| }
# 250|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll.c:45:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/poll.c:286:5: enter_function: entry to ‘main’
liburing-2.13/test/poll.c:290:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/poll.c:293:15: branch_false: ...to here
liburing-2.13/test/poll.c:293:15: call_function: calling ‘test_basic’ from ‘main’
# 43| if (pipe(pipe1) != 0) {
# 44| perror("pipe");
# 45|-> return 1;
# 46| }
# 47|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/poll.c:45:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/poll.c:286:5: enter_function: entry to ‘main’
liburing-2.13/test/poll.c:290:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/poll.c:293:15: branch_false: ...to here
liburing-2.13/test/poll.c:293:15: call_function: calling ‘test_basic’ from ‘main’
# 43| if (pipe(pipe1) != 0) {
# 44| perror("pipe");
# 45|-> return 1;
# 46| }
# 47|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/read-inc-file.c:86:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&fname, 0)’
liburing-2.13/test/read-inc-file.c:60:5: enter_function: entry to ‘main’
liburing-2.13/test/read-inc-file.c:72:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/read-inc-file.c:75:9: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:76:13: call_function: calling ‘create_test_file’ from ‘main’
liburing-2.13/test/read-inc-file.c:76:13: return_function: returning to ‘main’ from ‘create_test_file’
liburing-2.13/test/read-inc-file.c:76:12: branch_false: following ‘false’ branch...
liburing-2.13/test/read-inc-file.c:79:14: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:79:14: acquire_resource: opened here
liburing-2.13/test/read-inc-file.c:80:12: branch_false: following ‘false’ branch...
liburing-2.13/test/read-inc-file.c:85:15: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:86:12: danger: ‘open(&fname, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
# 84|
# 85| ret = io_uring_queue_init_params(64, &ring, &p);
# 86|-> if (ret) {
# 87| fprintf(stderr, "ring setup failed: %d\n", ret);
# 88| goto err;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/read-inc-file.c:91:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&fname, 0)’
liburing-2.13/test/read-inc-file.c:60:5: enter_function: entry to ‘main’
liburing-2.13/test/read-inc-file.c:72:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/read-inc-file.c:75:9: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:76:13: call_function: calling ‘create_test_file’ from ‘main’
liburing-2.13/test/read-inc-file.c:76:13: return_function: returning to ‘main’ from ‘create_test_file’
liburing-2.13/test/read-inc-file.c:76:12: branch_false: following ‘false’ branch...
liburing-2.13/test/read-inc-file.c:79:14: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:79:14: acquire_resource: opened here
liburing-2.13/test/read-inc-file.c:80:12: branch_false: following ‘false’ branch...
liburing-2.13/test/read-inc-file.c:85:15: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:86:12: branch_false: following ‘false’ branch...
liburing-2.13/test/read-inc-file.c:91:13: branch_false: ...to here
liburing-2.13/test/read-inc-file.c:91:13: danger: ‘open(&fname, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
# 89| }
# 90|
# 91|-> if (posix_memalign((void **) &buf, 4096, 65536))
# 92| goto err;
# 93|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/read-mshot.c:286:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/read-mshot.c:497:5: enter_function: entry to ‘main’
liburing-2.13/test/read-mshot.c:501:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/read-mshot.c:504:15: branch_false: ...to here
liburing-2.13/test/read-mshot.c:504:15: call_function: calling ‘test’ from ‘main’
# 284| if (ret) {
# 285| fprintf(stderr, "ring setup failed: %d\n", ret);
# 286|-> return 1;
# 287| }
# 288|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/read-mshot.c:286:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/read-mshot.c:497:5: enter_function: entry to ‘main’
liburing-2.13/test/read-mshot.c:501:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/read-mshot.c:504:15: branch_false: ...to here
liburing-2.13/test/read-mshot.c:504:15: call_function: calling ‘test’ from ‘main’
# 284| if (ret) {
# 285| fprintf(stderr, "ring setup failed: %d\n", ret);
# 286|-> return 1;
# 287| }
# 288|
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/read-mshot.c:326: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: inc_index
# 324| } else {
# 325| inc_index = ptr[0] = malloc(NR_BUFS * BUF_SIZE);
# 326|-> memset(inc_index, 0, NR_BUFS * BUF_SIZE);
# 327| io_uring_buf_ring_add(br, ptr[0], NR_BUFS * BUF_SIZE, 1, BR_MASK, 0);
# 328| io_uring_buf_ring_advance(br, 1);
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/recv-bundle-short-ooo.c:325: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test_data
# 323| uint8_t *test_data = malloc(ONE_MB);
# 324| for (int i = 0; i < ONE_MB; i++)
# 325|-> test_data[i] = i % 256; /* Create repeating pattern */
# 326|
# 327| /* Send test data through the socket */
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/recv-bundle-short-ooo.c:325:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘test_data’
liburing-2.13/test/recv-bundle-short-ooo.c:416:5: enter_function: entry to ‘main’
liburing-2.13/test/recv-bundle-short-ooo.c:420:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/recv-bundle-short-ooo.c:423:15: branch_false: ...to here
liburing-2.13/test/recv-bundle-short-ooo.c:423:15: call_function: calling ‘test_recv_multi_large_packet_isolate_ring’ from ‘main’
# 323| uint8_t *test_data = malloc(ONE_MB);
# 324| for (int i = 0; i < ONE_MB; i++)
# 325|-> test_data[i] = i % 256; /* Create repeating pattern */
# 326|
# 327| /* Send test data through the socket */
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/recv-inc-ooo.c:298: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test_data
# 296| uint8_t *test_data = malloc(total_bytes);
# 297| for (int i = 0; i < total_bytes; i++)
# 298|-> test_data[i] = i % 256; /* Create repeating pattern */
# 299|
# 300| /* Send data in chunks to test buffer boundary handling, intentionally misaligned with buffer size */
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/recv-inc-ooo.c:298:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘test_data’
liburing-2.13/test/recv-inc-ooo.c:377:5: enter_function: entry to ‘main’
liburing-2.13/test/recv-inc-ooo.c:381:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/recv-inc-ooo.c:384:15: branch_false: ...to here
liburing-2.13/test/recv-inc-ooo.c:384:15: call_function: calling ‘test_recv_incr’ from ‘main’
# 296| uint8_t *test_data = malloc(total_bytes);
# 297| for (int i = 0; i < total_bytes; i++)
# 298|-> test_data[i] = i % 256; /* Create repeating pattern */
# 299|
# 300| /* Send data in chunks to test buffer boundary handling, intentionally misaligned with buffer size */
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/recv-msgall-stream.c:278: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
# 276| buf = malloc(MAX_MSG * sizeof(int));
# 277| for (i = 0; i < MAX_MSG; i++)
# 278|-> buf[i] = i;
# 279|
# 280| sockfd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/recv-msgall-stream.c:278:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf’
liburing-2.13/test/recv-msgall-stream.c:369:5: enter_function: entry to ‘main’
liburing-2.13/test/recv-msgall-stream.c:373:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/recv-msgall-stream.c:376:15: branch_false: ...to here
liburing-2.13/test/recv-msgall-stream.c:376:15: call_function: calling ‘test’ from ‘main’
# 276| buf = malloc(MAX_MSG * sizeof(int));
# 277| for (i = 0; i < MAX_MSG; i++)
# 278|-> buf[i] = i;
# 279|
# 280| sockfd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
Error: GCC_ANALYZER_WARNING (CWE-401):
liburing-2.13/test/recv-msgall-stream.c:339:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
liburing-2.13/test/recv-msgall-stream.c:369:5: enter_function: entry to ‘main’
liburing-2.13/test/recv-msgall-stream.c:373:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/recv-msgall-stream.c:376:15: branch_false: ...to here
liburing-2.13/test/recv-msgall-stream.c:376:15: call_function: calling ‘test’ from ‘main’
# 337| free(buf);
# 338| return 1;
# 339|-> }
# 340|
# 341| static int test(int use_recvmsg, int use_sync)
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/recv-msgall.c:164: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
# 162| buf = malloc(MAX_MSG * sizeof(int));
# 163| for (i = 0; i < MAX_MSG; i++)
# 164|-> buf[i] = i;
# 165|
# 166| memset(&saddr, 0, sizeof(saddr));
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/recv-msgall.c:164:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf’
liburing-2.13/test/recv-msgall.c:225:12: enter_function: entry to ‘test’
liburing-2.13/test/recv-msgall.c:236:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
liburing-2.13/test/recv-msgall.c:241:9: branch_false: ...to here
liburing-2.13/test/recv-msgall.c:242:9: call_function: calling ‘do_send’ from ‘test’
# 162| buf = malloc(MAX_MSG * sizeof(int));
# 163| for (i = 0; i < MAX_MSG; i++)
# 164|-> buf[i] = i;
# 165|
# 166| memset(&saddr, 0, sizeof(saddr));
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/recv-mshot-fair.c:344: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
# 342|
# 343| buf = malloc(4096);
# 344|-> memset(buf, 0xa5, 4096);
# 345|
# 346| saddr.sin_family = AF_INET;
Error: GCC_ANALYZER_WARNING (CWE-688):
liburing-2.13/test/recv-mshot-fair.c:344:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
liburing-2.13/test/recv-mshot-fair.c:446:12: enter_function: entry to ‘run_tests’
liburing-2.13/test/recv-mshot-fair.c:451:15: call_function: calling ‘test’ from ‘run_tests’
# 342|
# 343| buf = malloc(4096);
# 344|-> memset(buf, 0xa5, 4096);
# 345|
# 346| saddr.sin_family = AF_INET;
Error: GCC_ANALYZER_WARNING (CWE-401):
liburing-2.13/test/recv-mshot-fair.c:386:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
liburing-2.13/test/recv-mshot-fair.c:446:12: enter_function: entry to ‘run_tests’
liburing-2.13/test/recv-mshot-fair.c:451:15: call_function: calling ‘test’ from ‘run_tests’
# 384| free(buf);
# 385| return 1;
# 386|-> }
# 387|
# 388| struct res {
Error: CPPCHECK_WARNING (CWE-401):
liburing-2.13/test/regbuf-clone.c:37: error[memleak]: Memory leak: buf
# 35| if (fd < 0) {
# 36| perror("open");
# 37|-> return;
# 38| }
# 39|
Error: GCC_ANALYZER_WARNING (CWE-401):
liburing-2.13/test/regbuf-clone.c:54:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
liburing-2.13/test/regbuf-clone.c:624:5: enter_function: entry to ‘main’
liburing-2.13/test/regbuf-clone.c:628:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/regbuf-clone.c:631:15: branch_false: ...to here
liburing-2.13/test/regbuf-clone.c:632:12: branch_false: following ‘false’ branch...
liburing-2.13/test/regbuf-clone.c:637:15: branch_false: ...to here
liburing-2.13/test/regbuf-clone.c:637:15: call_function: calling ‘test’ from ‘main’
# 52| close(fd);
# 53| free(buf);
# 54|-> }
# 55|
# 56| static int use_buf(struct io_uring *ring, void *addr, int index)
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/register-restrictions.c:34:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/register-restrictions.c:563:5: enter_function: entry to ‘main’
liburing-2.13/test/register-restrictions.c:567:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/register-restrictions.c:570:15: branch_false: ...to here
liburing-2.13/test/register-restrictions.c:570:15: call_function: calling ‘test_restrictions_sqe_op’ from ‘main’
# 32| if (pipe(pipe1) != 0) {
# 33| perror("pipe");
# 34|-> return T_EXIT_FAIL;
# 35| }
# 36|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/register-restrictions.c:34:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/register-restrictions.c:563:5: enter_function: entry to ‘main’
liburing-2.13/test/register-restrictions.c:567:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/register-restrictions.c:570:15: branch_false: ...to here
liburing-2.13/test/register-restrictions.c:570:15: call_function: calling ‘test_restrictions_sqe_op’ from ‘main’
# 32| if (pipe(pipe1) != 0) {
# 33| perror("pipe");
# 34|-> return T_EXIT_FAIL;
# 35| }
# 36|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/register-restrictions.c:450:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
liburing-2.13/test/register-restrictions.c:448:12: branch_false: following ‘false’ branch...
liburing-2.13/test/register-restrictions.c:453:15: branch_false: ...to here
liburing-2.13/test/register-restrictions.c:450:24: danger: ‘pipe1[0]’ leaks here
# 448| if (pipe(pipe1) != 0) {
# 449| perror("pipe");
# 450|-> return T_EXIT_FAIL;
# 451| }
# 452|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/register-restrictions.c:450:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
liburing-2.13/test/register-restrictions.c:448:12: branch_false: following ‘false’ branch...
liburing-2.13/test/register-restrictions.c:453:15: branch_false: ...to here
liburing-2.13/test/register-restrictions.c:450:24: danger: ‘pipe1[1]’ leaks here
# 448| if (pipe(pipe1) != 0) {
# 449| perror("pipe");
# 450|-> return T_EXIT_FAIL;
# 451| }
# 452|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/ring-leak.c:165:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/ring-leak.c:163:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak.c:167:15: branch_false: ...to here
liburing-2.13/test/ring-leak.c:168:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak.c:172:13: branch_false: ...to here
liburing-2.13/test/ring-leak.c:172:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak.c:176:15: branch_false: ...to here
liburing-2.13/test/ring-leak.c:165:24: danger: ‘fds[0]’ leaks here
# 163| if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sp) != 0) {
# 164| perror("Failed to create Unix-domain socket pair\n");
# 165|-> return 1;
# 166| }
# 167| ret = io_uring_queue_init(8, &ring, 0);
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/ring-leak.c:165:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/ring-leak.c:163:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak.c:167:15: branch_false: ...to here
liburing-2.13/test/ring-leak.c:168:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak.c:172:13: branch_false: ...to here
liburing-2.13/test/ring-leak.c:172:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak.c:176:15: branch_false: ...to here
liburing-2.13/test/ring-leak.c:165:24: danger: ‘fds[1]’ leaks here
# 163| if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sp) != 0) {
# 164| perror("Failed to create Unix-domain socket pair\n");
# 165|-> return 1;
# 166| }
# 167| ret = io_uring_queue_init(8, &ring, 0);
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/ring-leak2.c:115:13: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘sock_listen_fd’
liburing-2.13/test/ring-leak2.c:111:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ring-leak2.c:115:13: branch_false: ...to here
liburing-2.13/test/ring-leak2.c:115:13: danger: ‘sock_listen_fd’ could be invalid
# 113| exit(1);
# 114| }
# 115|-> if (listen(sock_listen_fd, 1) < 0) {
# 116| perror("Error listening on socket...\n");
# 117| exit(1);
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:42: error[uninitvar]: Uninitialized variable: &op
# 40| struct io_uring_query_hdr hdr = {
# 41| .query_op = IO_URING_QUERY_OPCODES,
# 42|-> .query_data = uring_ptr_to_u64(&op),
# 43| .size = sizeof(op),
# 44| };
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:82: error[uninitvar]: Uninitialized variable: &op
# 80| struct io_uring_query_hdr invalid_hdr = {
# 81| .query_op = -1U,
# 82|-> .query_data = uring_ptr_to_u64(&op),
# 83| .size = sizeof(struct io_uring_query_opcode),
# 84| };
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:125: error[uninitvar]: Uninitialized variable: &op3
# 123| struct io_uring_query_hdr hdr3 = {
# 124| .query_op = IO_URING_QUERY_OPCODES,
# 125|-> .query_data = uring_ptr_to_u64(&op3),
# 126| .size = sizeof(struct io_uring_query_opcode),
# 127| };
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:130: error[uninitvar]: Uninitialized variable: &op2
# 128| struct io_uring_query_hdr hdr2 = {
# 129| .query_op = IO_URING_QUERY_OPCODES,
# 130|-> .query_data = uring_ptr_to_u64(&op2),
# 131| .size = sizeof(struct io_uring_query_opcode),
# 132| .next_entry = uring_ptr_to_u64(&hdr3),
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:136: error[uninitvar]: Uninitialized variable: &op1
# 134| struct io_uring_query_hdr hdr1 = {
# 135| .query_op = IO_URING_QUERY_OPCODES,
# 136|-> .query_data = uring_ptr_to_u64(&op1),
# 137| .size = sizeof(struct io_uring_query_opcode),
# 138| .next_entry = uring_ptr_to_u64(&hdr2),
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:169: error[uninitvar]: Uninitialized variable: &op2
# 167| struct io_uring_query_hdr hdr2 = {
# 168| .query_op = IO_URING_QUERY_OPCODES,
# 169|-> .query_data = uring_ptr_to_u64(&op2),
# 170| .size = sizeof(struct io_uring_query_opcode),
# 171| };
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:174: error[uninitvar]: Uninitialized variable: &op1
# 172| struct io_uring_query_hdr hdr1 = {
# 173| .query_op = IO_URING_QUERY_OPCODES,
# 174|-> .query_data = uring_ptr_to_u64(&op1),
# 175| .size = sizeof(struct io_uring_query_opcode),
# 176| };
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:207: error[uninitvar]: Uninitialized variable: &op
# 205| struct io_uring_query_hdr hdr = {
# 206| .query_op = IO_URING_QUERY_OPCODES,
# 207|-> .query_data = uring_ptr_to_u64(&op),
# 208| .size = sizeof(op),
# 209| };
Error: CPPCHECK_WARNING (CWE-457):
liburing-2.13/test/ring-query.c:240: error[uninitvar]: Uninitialized variable: &op
# 238| struct io_uring_query_hdr hdr = {
# 239| .query_op = IO_URING_QUERY_OPCODES,
# 240|-> .query_data = uring_ptr_to_u64(&op),
# 241| .size = sizeof(op),
# 242| };
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/ringbuf-status.c:97:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/ringbuf-status.c:95:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ringbuf-status.c:100:13: branch_false: ...to here
liburing-2.13/test/ringbuf-status.c:100:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ringbuf-status.c:105:13: branch_false: ...to here
liburing-2.13/test/ringbuf-status.c:97:24: danger: ‘fds[0]’ leaks here
# 95| if (ret) {
# 96| fprintf(stderr, "ring setup failed: %d\n", ret);
# 97|-> return 1;
# 98| }
# 99|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/ringbuf-status.c:97:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/ringbuf-status.c:95:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ringbuf-status.c:100:13: branch_false: ...to here
liburing-2.13/test/ringbuf-status.c:100:12: branch_false: following ‘false’ branch...
liburing-2.13/test/ringbuf-status.c:105:13: branch_false: ...to here
liburing-2.13/test/ringbuf-status.c:97:24: danger: ‘fds[1]’ leaks here
# 95| if (ret) {
# 96| fprintf(stderr, "ring setup failed: %d\n", ret);
# 97|-> return 1;
# 98| }
# 99|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/short-read.c:44:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".short-read", 0)’
liburing-2.13/test/short-read.c:26:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/short-read.c:29:24: branch_false: ...to here
liburing-2.13/test/short-read.c:34:14: acquire_resource: opened here
liburing-2.13/test/short-read.c:38:12: branch_false: following ‘false’ branch...
liburing-2.13/test/short-read.c:43:15: branch_false: ...to here
liburing-2.13/test/short-read.c:44:12: danger: ‘open(".short-read", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 42|
# 43| ret = io_uring_queue_init(32, &ring, 0);
# 44|-> if (ret) {
# 45| fprintf(stderr, "queue init failed: %d\n", ret);
# 46| return ret;
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/shutdown.c:52:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘recv_s0’
liburing-2.13/test/shutdown.c:35:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/shutdown.c:38:15: branch_false: ...to here
liburing-2.13/test/shutdown.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/shutdown.c:44:15: branch_true: ...to here
liburing-2.13/test/shutdown.c:45:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/shutdown.c:47:9: branch_true: ...to here
liburing-2.13/test/shutdown.c:51:9: branch_true: following ‘true’ branch...
liburing-2.13/test/shutdown.c:52:15: branch_true: ...to here
liburing-2.13/test/shutdown.c:52:15: danger: ‘recv_s0’ could be invalid
# 50| ret = t_bind_ephemeral_port(recv_s0, &addr);
# 51| assert(!ret);
# 52|-> ret = listen(recv_s0, 128);
# 53| assert(ret != -1);
# 54|
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/socket-nb.c:45:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘recv_s0’
liburing-2.13/test/socket-nb.c:115:5: enter_function: entry to ‘main’
liburing-2.13/test/socket-nb.c:119:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/socket-nb.c:122:15: branch_false: ...to here
liburing-2.13/test/socket-nb.c:122:15: call_function: calling ‘test’ from ‘main’
# 43| ret = t_bind_ephemeral_port(recv_s0, &addr);
# 44| assert(!ret);
# 45|-> ret = listen(recv_s0, 128);
# 46| assert(ret != -1);
# 47|
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/socket-rw-eagain.c:47:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘recv_s0’
liburing-2.13/test/socket-rw-eagain.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/socket-rw-eagain.c:34:15: branch_false: ...to here
liburing-2.13/test/socket-rw-eagain.c:39:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/socket-rw-eagain.c:40:15: branch_true: ...to here
liburing-2.13/test/socket-rw-eagain.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/socket-rw-eagain.c:43:9: branch_true: ...to here
liburing-2.13/test/socket-rw-eagain.c:46:9: branch_true: following ‘true’ branch...
liburing-2.13/test/socket-rw-eagain.c:47:15: branch_true: ...to here
liburing-2.13/test/socket-rw-eagain.c:47:15: danger: ‘recv_s0’ could be invalid
# 45| ret = t_bind_ephemeral_port(recv_s0, &addr);
# 46| assert(!ret);
# 47|-> ret = listen(recv_s0, 128);
# 48| assert(ret != -1);
# 49|
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/socket-rw-offset.c:49:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘recv_s0’
liburing-2.13/test/socket-rw-offset.c:33:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/socket-rw-offset.c:36:15: branch_false: ...to here
liburing-2.13/test/socket-rw-offset.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/socket-rw-offset.c:42:15: branch_true: ...to here
liburing-2.13/test/socket-rw-offset.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/socket-rw-offset.c:45:9: branch_true: ...to here
liburing-2.13/test/socket-rw-offset.c:48:9: branch_true: following ‘true’ branch...
liburing-2.13/test/socket-rw-offset.c:49:15: branch_true: ...to here
liburing-2.13/test/socket-rw-offset.c:49:15: danger: ‘recv_s0’ could be invalid
# 47| ret = t_bind_ephemeral_port(recv_s0, &addr);
# 48| assert(!ret);
# 49|-> ret = listen(recv_s0, 128);
# 50| assert(ret != -1);
# 51|
Error: GCC_ANALYZER_WARNING:
liburing-2.13/test/socket-rw.c:49:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘recv_s0’
liburing-2.13/test/socket-rw.c:33:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/socket-rw.c:36:15: branch_false: ...to here
liburing-2.13/test/socket-rw.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/socket-rw.c:42:15: branch_true: ...to here
liburing-2.13/test/socket-rw.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)...
liburing-2.13/test/socket-rw.c:45:9: branch_true: ...to here
liburing-2.13/test/socket-rw.c:48:9: branch_true: following ‘true’ branch...
liburing-2.13/test/socket-rw.c:49:15: branch_true: ...to here
liburing-2.13/test/socket-rw.c:49:15: danger: ‘recv_s0’ could be invalid
# 47| ret = t_bind_ephemeral_port(recv_s0, &addr);
# 48| assert(!ret);
# 49|-> ret = listen(recv_s0, 128);
# 50| assert(ret != -1);
# 51|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/splice.c:111:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
liburing-2.13/test/splice.c:444:5: enter_function: entry to ‘main’
liburing-2.13/test/splice.c:452:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/splice.c:455:15: branch_false: ...to here
liburing-2.13/test/splice.c:456:12: branch_false: following ‘false’ branch...
liburing-2.13/test/splice.c:460:15: branch_false: ...to here
liburing-2.13/test/splice.c:460:12: branch_false: following ‘false’ branch...
liburing-2.13/test/splice.c:465:15: branch_false: ...to here
liburing-2.13/test/splice.c:465:15: call_function: calling ‘init_splice_ctx’ from ‘main’
# 109| return 1;
# 110|
# 111|-> ret = read_buf(rnd_fd, ctx->buf_in, BUF_SIZE);
# 112| if (ret != 0)
# 113| return 1;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/sq-poll-share.c:99:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 16384)’
liburing-2.13/test/sq-poll-share.c:91:14: acquire_resource: opened here
liburing-2.13/test/sq-poll-share.c:92:12: branch_false: following ‘false’ branch...
liburing-2.13/test/sq-poll-share.c:99:22: branch_false: ...to here
liburing-2.13/test/sq-poll-share.c:102:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
liburing-2.13/test/sq-poll-share.c:103:40: branch_true: ...to here
liburing-2.13/test/sq-poll-share.c:106:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
liburing-2.13/test/sq-poll-share.c:110:23: branch_false: ...to here
liburing-2.13/test/sq-poll-share.c:99:22: danger: ‘open(fname, 16384)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 97| }
# 98|
# 99|-> if (fname != argv[1])
# 100| unlink(fname);
# 101|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/submit-reuse.c:149:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname1, 0)’
liburing-2.13/test/submit-reuse.c:193:5: enter_function: entry to ‘main’
liburing-2.13/test/submit-reuse.c:197:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
liburing-2.13/test/submit-reuse.c:200:17: branch_true: ...to here
liburing-2.13/test/submit-reuse.c:203:23: call_function: calling ‘test_reuse’ from ‘main’
# 147| fd2 = open(".reuse.2", O_RDONLY);
# 148| unlink(".reuse.2");
# 149|-> if (fd2 < 0) {
# 150| perror("open .reuse.2");
# 151| goto err;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/tty-write-dpoll.c:39:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/ttyS0", 2050)’
liburing-2.13/test/tty-write-dpoll.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/tty-write-dpoll.c:34:14: branch_false: ...to here
liburing-2.13/test/tty-write-dpoll.c:34:14: acquire_resource: opened here
liburing-2.13/test/tty-write-dpoll.c:35:12: branch_false: following ‘false’ branch...
liburing-2.13/test/tty-write-dpoll.c:38:15: branch_false: ...to here
liburing-2.13/test/tty-write-dpoll.c:39:12: danger: ‘open("/dev/ttyS0", 2050)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 37|
# 38| ret = t_create_ring(SQES, &ring, 0);
# 39|-> if (ret == T_SETUP_SKIP)
# 40| return 0;
# 41| else if (ret < 0)
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/tty-write-dpoll.c:41:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/ttyS0", 2050)’
liburing-2.13/test/tty-write-dpoll.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/tty-write-dpoll.c:34:14: branch_false: ...to here
liburing-2.13/test/tty-write-dpoll.c:34:14: acquire_resource: opened here
liburing-2.13/test/tty-write-dpoll.c:35:12: branch_false: following ‘false’ branch...
liburing-2.13/test/tty-write-dpoll.c:38:15: branch_false: ...to here
liburing-2.13/test/tty-write-dpoll.c:39:12: branch_false: following ‘false’ branch (when ‘ret != 1’)...
liburing-2.13/test/tty-write-dpoll.c:41:17: branch_false: ...to here
liburing-2.13/test/tty-write-dpoll.c:41:17: danger: ‘open("/dev/ttyS0", 2050)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 39| if (ret == T_SETUP_SKIP)
# 40| return 0;
# 41|-> else if (ret < 0)
# 42| return 1;
# 43|
Error: CPPCHECK_WARNING (CWE-664):
liburing-2.13/test/uring_cmd_ublk.c:163: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end().
# 161| va_start(ap, fmt);
# 162| vfprintf(stderr, fmt, ap);
# 163|-> }
# 164|
# 165| static void ublk_dbg(int level, const char *fmt, ...)
Error: GCC_ANALYZER_WARNING (CWE-404):
liburing-2.13/test/uring_cmd_ublk.c:163:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
liburing-2.13/test/uring_cmd_ublk.c:1217:5: enter_function: entry to ‘main’
liburing-2.13/test/uring_cmd_ublk.c:1224:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/uring_cmd_ublk.c:1227:15: branch_false: ...to here
liburing-2.13/test/uring_cmd_ublk.c:1227:15: call_function: calling ‘ublk_ctrl_init’ from ‘main’
# 161| va_start(ap, fmt);
# 162| vfprintf(stderr, fmt, ap);
# 163|-> }
# 164|
# 165| static void ublk_dbg(int level, const char *fmt, ...)
Error: CPPCHECK_WARNING (CWE-664):
liburing-2.13/test/uring_cmd_ublk.c:171: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end().
# 169| va_start(ap, fmt);
# 170| vfprintf(stdout, fmt, ap);
# 171|-> }
# 172| }
# 173|
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/uring_cmd_ublk.c:356: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 354| int ret;
# 355|
# 356|-> dev->ctrl_fd = open(CTRL_DEV, O_RDWR);
# 357| if (dev->ctrl_fd < 0) {
# 358| free(dev);
Error: GCC_ANALYZER_WARNING (CWE-476):
liburing-2.13/test/uring_cmd_ublk.c:356:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dev’
liburing-2.13/test/uring_cmd_ublk.c:1217:5: enter_function: entry to ‘main’
liburing-2.13/test/uring_cmd_ublk.c:1224:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
liburing-2.13/test/uring_cmd_ublk.c:1227:15: branch_false: ...to here
liburing-2.13/test/uring_cmd_ublk.c:1227:15: call_function: calling ‘ublk_ctrl_init’ from ‘main’
# 354| int ret;
# 355|
# 356|-> dev->ctrl_fd = open(CTRL_DEV, O_RDWR);
# 357| if (dev->ctrl_fd < 0) {
# 358| free(dev);
Error: CPPCHECK_WARNING (CWE-476):
liburing-2.13/test/uring_cmd_ublk.c:357: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 355|
# 356| dev->ctrl_fd = open(CTRL_DEV, O_RDWR);
# 357|-> if (dev->ctrl_fd < 0) {
# 358| free(dev);
# 359| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/wakeup-hang.c:74:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
liburing-2.13/test/wakeup-hang.c:68:12: branch_false: following ‘false’ branch...
liburing-2.13/test/wakeup-hang.c:71:15: branch_false: ...to here
liburing-2.13/test/wakeup-hang.c:72:12: branch_true: following ‘true’ branch...
liburing-2.13/test/wakeup-hang.c:73:17: branch_true: ...to here
liburing-2.13/test/wakeup-hang.c:74:24: danger: ‘fds[0]’ leaks here
# 72| if (ret) {
# 73| fprintf(stderr, "Unable to setup io_uring: %s\n", strerror(-ret));
# 74|-> return 1;
# 75| }
# 76|
Error: GCC_ANALYZER_WARNING (CWE-775):
liburing-2.13/test/wakeup-hang.c:74:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
liburing-2.13/test/wakeup-hang.c:68:12: branch_false: following ‘false’ branch...
liburing-2.13/test/wakeup-hang.c:71:15: branch_false: ...to here
liburing-2.13/test/wakeup-hang.c:72:12: branch_true: following ‘true’ branch...
liburing-2.13/test/wakeup-hang.c:73:17: branch_true: ...to here
liburing-2.13/test/wakeup-hang.c:74:24: danger: ‘fds[1]’ leaks here
# 72| if (ret) {
# 73| fprintf(stderr, "Unable to setup io_uring: %s\n", strerror(-ret));
# 74|-> return 1;
# 75| }
# 76|