Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
liburing-2.8-build/liburing-2.8/examples/proxy.c: scope_hint: In function ‘show_buckets’
liburing-2.8-build/liburing-2.8/examples/proxy.c:515:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘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): [#def2]
liburing-2.8-build/liburing-2.8/examples/proxy.c:518:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘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-416): [#def3]
liburing-2.8-build/liburing-2.8/examples/proxy.c:534:30: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘rstat’
#  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): [#def4]
liburing-2.8-build/liburing-2.8/examples/proxy.c:546:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘sstat’
#  544|   	}
#  545|   
#  546|-> 	free(sstat);
#  547|   	free(rstat);
#  548|   }

Error: GCC_ANALYZER_WARNING (CWE-415): [#def5]
liburing-2.8-build/liburing-2.8/examples/proxy.c:547:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘rstat’
#  545|   
#  546|   	free(sstat);
#  547|-> 	free(rstat);
#  548|   }
#  549|   

Error: GCC_ANALYZER_WARNING: [#def6]
liburing-2.8-build/liburing-2.8/test/accept-non-empty.c: scope_hint: In function ‘start_accept_listen’
liburing-2.8-build/liburing-2.8/test/accept-non-empty.c:56:15: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘fd’
#   54|   	ret = bind(fd, (struct sockaddr *) &addr, sizeof(addr));
#   55|   	assert(ret != -1);
#   56|-> 	ret = listen(fd, 20000);
#   57|   	assert(ret != -1);
#   58|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def7]
liburing-2.8-build/liburing-2.8/test/accept-non-empty.c: scope_hint: In function ‘test_maccept’
liburing-2.8-build/liburing-2.8/test/accept-non-empty.c:127:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fds’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#  125|   
#  126|   	fds = malloc(MAX_ACCEPTS * sizeof(int));
#  127|-> 	memset(fds, -1, MAX_ACCEPTS * sizeof(int));
#  128|   
#  129|   	if (fixed) {

Error: CPPCHECK_WARNING (CWE-401): [#def8]
liburing-2.8-build/liburing-2.8/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-401): [#def9]
liburing-2.8-build/liburing-2.8/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): [#def10]
liburing-2.8-build/liburing-2.8/test/fdinfo.c: scope_hint: In function ‘fdinfo_read’
liburing-2.8-build/liburing-2.8/test/fdinfo.c:39:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
liburing-2.8-build/liburing-2.8/src/include/liburing.h: scope_hint: In function ‘fdinfo_read’
liburing-2.8-build/liburing-2.8/test/fdinfo.c: scope_hint: In function ‘fdinfo_read’
liburing-2.8-build/liburing-2.8/src/include/liburing.h: scope_hint: In function ‘fdinfo_read’
liburing-2.8-build/liburing-2.8/test/fdinfo.c: scope_hint: In function ‘fdinfo_read’
#   37|   	if (fd < 0) {
#   38|   		perror("open");
#   39|-> 		return;
#   40|   	}
#   41|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
liburing-2.8-build/liburing-2.8/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0][0]’
#   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): [#def12]
liburing-2.8-build/liburing-2.8/test/min-timeout.c: scope_hint: In function ‘test’
liburing-2.8-build/liburing-2.8/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0][1]’
#   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): [#def13]
liburing-2.8-build/liburing-2.8/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1][0]’
#   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): [#def14]
liburing-2.8-build/liburing-2.8/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1][1]’
#   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): [#def15]
liburing-2.8-build/liburing-2.8/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[2][0]’
#   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): [#def16]
liburing-2.8-build/liburing-2.8/test/min-timeout.c:83:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[2][1]’
#   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): [#def17]
liburing-2.8-build/liburing-2.8/test/register-restrictions.c:34:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[0]’
#   32|   	if (pipe(pipe1) != 0) {
#   33|   		perror("pipe");
#   34|-> 		return T_EXIT_FAIL;
#   35|   	}
#   36|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
liburing-2.8-build/liburing-2.8/test/register-restrictions.c: scope_hint: In function ‘test_restrictions_sqe_op’
liburing-2.8-build/liburing-2.8/test/register-restrictions.c:34:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe1[1]’
#   32|   	if (pipe(pipe1) != 0) {
#   33|   		perror("pipe");
#   34|-> 		return T_EXIT_FAIL;
#   35|   	}
#   36|   

Error: CPPCHECK_WARNING (CWE-664): [#def19]
liburing-2.8-build/liburing-2.8/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): [#def20]
liburing-2.8-build/liburing-2.8/test/uring_cmd_ublk.c: scope_hint: In function ‘ublk_err’
liburing-2.8-build/liburing-2.8/test/uring_cmd_ublk.c:163:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘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: CPPCHECK_WARNING (CWE-664): [#def21]
liburing-2.8-build/liburing-2.8/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: GCC_ANALYZER_WARNING (CWE-476): [#def22]
liburing-2.8-build/liburing-2.8/test/uring_cmd_ublk.c: scope_hint: In function ‘ublk_ctrl_init’
liburing-2.8-build/liburing-2.8/test/uring_cmd_ublk.c:356:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dev’
#  354|   	int ret;
#  355|   
#  356|-> 	dev->ctrl_fd = open(CTRL_DEV, O_RDWR);
#  357|   	if (dev->ctrl_fd < 0) {
#  358|   		free(dev);

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-85.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-nameliburing-2.6-2.fc41
diffbase-store-results-to/tmp/tmpgcsvdyci/liburing-2.6-2.fc41.tar.xz
diffbase-time-created2024-11-13 01:42:56
diffbase-time-finished2024-11-13 01:46:28
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpgcsvdyci/liburing-2.6-2.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpgcsvdyci/liburing-2.6-2.fc41.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-85.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameliburing-2.8-1.fc42
store-results-to/tmp/tmpcbb5rz77/liburing-2.8-1.fc42.tar.xz
time-created2024-11-13 01:46:42
time-finished2024-11-13 01:50:18
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpcbb5rz77/liburing-2.8-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpcbb5rz77/liburing-2.8-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9