wayland-1.22.0-3.fc40

List of Defects

Error: CPPCHECK_WARNING: [#def1]
wayland-1.22.0-build/wayland-1.22.0/cursor/wayland-cursor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
wayland-1.22.0-build/wayland-1.22.0/cursor/wayland-cursor.c: scope_hint: In function ‘wl_cursor_create_from_data’
wayland-1.22.0-build/wayland-1.22.0/cursor/wayland-cursor.c:239:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cursor’
#  237|   	       cursor_data + metadata->offset, size);
#  238|   
#  239|-> 	return &cursor->cursor;
#  240|   
#  241|   err_free_image:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
wayland-1.22.0-build/wayland-1.22.0/cursor/wayland-cursor.c: scope_hint: In function ‘wl_cursor_create_from_xcursor_images’
wayland-1.22.0-build/wayland-1.22.0/cursor/wayland-cursor.c:334:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cursor’
#  332|   	}
#  333|   
#  334|-> 	return &cursor->cursor;
#  335|   }
#  336|   

Error: CPPCHECK_WARNING: [#def4]
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def5]
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c: scope_hint: In function ‘xcursor_file_best_size’
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c:343:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.type’
/usr/include/string.h:33: included_from: Included from here.
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c:31: included_from: Included from here.
#  341|   
#  342|   	for (n = 0; n < file_header->ntoc; n++) {
#  343|-> 		if (file_header->tocs[n].type != XCURSOR_IMAGE_TYPE)
#  344|   			continue;
#  345|   		this_size = file_header->tocs[n].subtype;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def6]
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c: scope_hint: In function ‘load_all_cursors_from_dir’
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c:684:20: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
wayland-1.22.0-build/wayland-1.22.0/cursor/xcursor.c:32: included_from: Included from here.
/usr/include/dirent.h:141:13: note: argument 1 of ‘opendir’ must be non-null
#  682|   {
#  683|   	FILE *f;
#  684|-> 	DIR *dir = opendir(path);
#  685|   	struct dirent *ent;
#  686|   	char *full;

Error: CPPCHECK_WARNING: [#def7]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c: scope_hint: In function ‘ring_buffer_put’
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:88:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data’
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:62:19: note: in definition of macro ‘MASK’
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:62:19: note: in definition of macro ‘MASK’
#   86|   	head = MASK(b->head);
#   87|   	if (head + count <= sizeof b->data) {
#   88|-> 		memcpy(b->data + head, data, count);
#   89|   	} else {
#   90|   		size = sizeof b->data - head;

Error: CLANG_WARNING: [#def9]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:624:35: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  622|   			break;
#  623|   		case 's':
#  624|-> 			if (!arg.nullable && args[i].s == NULL)
#  625|   				goto err_null;
#  626|   			break;

Error: CLANG_WARNING: [#def10]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:628:35: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  626|   			break;
#  627|   		case 'o':
#  628|-> 			if (!arg.nullable && args[i].o == NULL)
#  629|   				goto err_null;
#  630|   			break;

Error: CLANG_WARNING: [#def11]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:632:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  630|   			break;
#  631|   		case 'n':
#  632|-> 			object = args[i].o;
#  633|   			if (object == NULL)
#  634|   				goto err_null;

Error: CLANG_WARNING: [#def12]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:639:18: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  637|   			break;
#  638|   		case 'a':
#  639|-> 			if (args[i].a == NULL)
#  640|   				goto err_null;
#  641|   			break;

Error: CLANG_WARNING: [#def13]
wayland-1.22.0-build/wayland-1.22.0/src/connection.c:643:7: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  641|   			break;
#  642|   		case 'h':
#  643|-> 			fd = args[i].h;
#  644|   			dup_fd = wl_os_dupfd_cloexec(fd, 0);
#  645|   			if (dup_fd < 0) {

Error: CPPCHECK_WARNING: [#def14]
wayland-1.22.0-build/wayland-1.22.0/src/event-loop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
wayland-1.22.0-build/wayland-1.22.0/src/event-loop.c: scope_hint: In function ‘wl_timer_heap_unreserve’
wayland-1.22.0-build/wayland-1.22.0/src/event-loop.c:368:31: warning[-Wanalyzer-malloc-leak]: leak of ‘*loop.timers.data’
#  366|   		}
#  367|   		timers->data = n;
#  368|-> 		timers->space = timers->space / 2;
#  369|   	}
#  370|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
wayland-1.22.0-build/wayland-1.22.0/src/event-loop.c: scope_hint: In function ‘wl_event_loop_add_signal’
wayland-1.22.0-build/wayland-1.22.0/src/event-loop.c:735:16: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 64)’
wayland-1.22.0-build/wayland-1.22.0/src/event-loop.c: scope_hint: In function ‘wl_event_loop_add_signal’
#  733|   	source->func = func;
#  734|   
#  735|-> 	return add_source(loop, &source->base, WL_EVENT_READABLE, data);
#  736|   }
#  737|   

Error: CPPCHECK_WARNING: [#def17]
wayland-1.22.0-build/wayland-1.22.0/src/scanner.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def18]
wayland-1.22.0-build/wayland-1.22.0/src/scanner.c:286:22: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  284|   xstrdup(const char *s)
#  285|   {
#  286|-> 	return fail_on_null(strdup(s));
#  287|   }
#  288|   

Error: CLANG_WARNING: [#def19]
wayland-1.22.0-build/wayland-1.22.0/src/scanner.c:461:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  459|   set_arg_type(struct arg *arg, const char *type)
#  460|   {
#  461|-> 	if (strcmp(type, "int") == 0)
#  462|   		arg->type = INT;
#  463|   	else if (strcmp(type, "uint") == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
wayland-1.22.0-build/wayland-1.22.0/src/scanner.c: scope_hint: In function ‘end_element.part.0’
wayland-1.22.0-build/wayland-1.22.0/src/scanner.c:1005:34: warning[-Wanalyzer-malloc-leak]: leak of ‘strndup(&*(struct parse_context *)data.character_data, (long unsigned int)*(struct parse_context *)data.character_data_length)’
# 1003|   			strndup(ctx->character_data,
# 1004|   				ctx->character_data_length);
# 1005|-> 		ctx->description = NULL;
# 1006|   	} else if (strcmp(name, "request") == 0 ||
# 1007|   		   strcmp(name, "event") == 0) {

Error: CPPCHECK_WARNING: [#def21]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def22]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-client.c:1577:17: warning[core.NullDereference]: Dereference of null pointer
# 1575|   		wl_abort("Tried to add event to destroyed queue\n");
# 1576|   
# 1577|-> 	wl_list_insert(queue->event_list.prev, &closure->link);
# 1578|   
# 1579|   	return size;

Error: CPPCHECK_WARNING: [#def23]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def24]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:475:22: warning[unix.Malloc]: Use of memory after it is freed
#  473|   wl_client_flush(struct wl_client *client)
#  474|   {
#  475|-> 	wl_connection_flush(client->connection);
#  476|   }
#  477|   

Error: CLANG_WARNING: [#def25]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:1503:2: warning[unix.Malloc]: Use of memory after it is freed
# 1501|   	int ret;
# 1502|   
# 1503|-> 	wl_list_for_each_safe(client, next, &display->client_list, link) {
# 1504|   		ret = wl_connection_flush(client->connection);
# 1505|   		if (ret < 0 && errno == EAGAIN) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c: scope_hint: In function ‘_wl_display_add_socket’
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:1679:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*s.fd’
# 1677|   	}
# 1678|   
# 1679|-> 	if (listen(s->fd, 128) < 0) {
# 1680|   		wl_log("listen() failed with error: %s\n", strerror(errno));
# 1681|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:1680:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:40: included_from: Included from here.
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:34: included_from: Included from here.
# 1678|   
# 1679|   	if (listen(s->fd, 128) < 0) {
# 1680|-> 		wl_log("listen() failed with error: %s\n", strerror(errno));
# 1681|   		return -1;
# 1682|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c: scope_hint: In function ‘wl_display_add_socket_fd’
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:1773:9: warning[-Wanalyzer-malloc-leak]: leak of ‘wl_socket_alloc()’
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c: scope_hint: In function ‘wl_display_add_socket_fd’
# 1771|   	s->fd = sock_fd;
# 1772|   
# 1773|-> 	wl_list_insert(display->socket_list.prev, &s->link);
# 1774|   
# 1775|   	return 0;

Error: CLANG_WARNING: [#def29]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-server.c:2371:9: warning[unix.Malloc]: Use of memory after it is freed
# 2369|   	 * ones that don't. */
# 2370|   	while (!wl_list_empty(&signal->listener_list)) {
# 2371|-> 		pos = signal->listener_list.next;
# 2372|   		l = wl_container_of(pos, l, link);
# 2373|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-shm.c: scope_hint: In function ‘wl_shm_buffer_begin_access’
wayland-1.22.0-build/wayland-1.22.0/src/wayland-shm.c:655:34: warning[-Wanalyzer-malloc-leak]: leak of ‘sigbus_data’
wayland-1.22.0-build/wayland-1.22.0/src/wayland-shm.c: scope_hint: In function ‘wl_shm_buffer_begin_access’
wayland-1.22.0-build/wayland-1.22.0/src/wayland-shm.c:43: included_from: Included from here.
#  653|   
#  654|   	sigbus_data->current_pool = pool;
#  655|-> 	sigbus_data->access_count++;
#  656|   }
#  657|   

Error: CPPCHECK_WARNING: [#def31]
wayland-1.22.0-build/wayland-1.22.0/src/wayland-util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
wayland-1.22.0-build/wayland-1.22.0/tests/os-wrappers-test.c: scope_hint: In function ‘socket’
wayland-1.22.0-build/wayland-1.22.0/tests/os-wrappers-test.c:100:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘base_fd’
wayland-1.22.0-build/wayland-1.22.0/tests/os-wrappers-test.c:34: included_from: Included from here.
#   98|   	}
#   99|   
#  100|-> 	return real_socket(domain, type, protocol);
#  101|   }
#  102|   

Error: CPPCHECK_WARNING (CWE-476): [#def33]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:78: warning[nullPointer]: Possible null pointer dereference: null
#   76|   
#   77|   	test_disable_coredumps();
#   78|-> 	*null = "Goodbye, world";
#   79|   }
#   80|   

Error: CLANG_WARNING: [#def34]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:78:8: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'null')
#   76|   
#   77|   	test_disable_coredumps();
#   78|-> 	*null = "Goodbye, world";
#   79|   }
#   80|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def35]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c: scope_hint: In function ‘fail_segv’
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:78:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#   76|   
#   77|   	test_disable_coredumps();
#   78|-> 	*null = "Goodbye, world";
#   79|   }
#   80|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:99:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#   97|   
#   98|   	test_disable_coredumps();
#   99|-> }
#  100|   
#  101|   FAIL_TEST(sanity_fd_leak_exec)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c: scope_hint: In function ‘sanity_fd_leak’
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:99:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
#   97|   
#   98|   	test_disable_coredumps();
#   99|-> }
#  100|   
#  101|   FAIL_TEST(sanity_fd_leak_exec)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c: scope_hint: In function ‘sanity_fd_leak_exec’
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:112:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#  110|   	test_disable_coredumps();
#  111|   	exec_fd_leak_check(nr_fds);
#  112|-> }
#  113|   
#  114|   TEST(sanity_fd_exec)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def39]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:112:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
#  110|   	test_disable_coredumps();
#  111|   	exec_fd_leak_check(nr_fds);
#  112|-> }
#  113|   
#  114|   TEST(sanity_fd_exec)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:123:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#  121|   
#  122|   	exec_fd_leak_check(nr_fds + 2);
#  123|-> }
#  124|   
#  125|   static void

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c: scope_hint: In function ‘sanity_fd_exec’
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:123:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:27: included_from: Included from here.
#  121|   
#  122|   	exec_fd_leak_check(nr_fds + 2);
#  123|-> }
#  124|   
#  125|   static void

Error: CLANG_WARNING: [#def42]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:203:25: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  201|   	char *log;
#  202|   	size_t log_len;
#  203|-> 	char *wayland_socket = strdup(getenv("WAYLAND_SOCKET"));
#  204|   	char *xdg_runtime_dir = strdup(getenv("XDG_RUNTIME_DIR"));
#  205|   

Error: CLANG_WARNING: [#def43]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:204:26: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  202|   	size_t log_len;
#  203|   	char *wayland_socket = strdup(getenv("WAYLAND_SOCKET"));
#  204|-> 	char *xdg_runtime_dir = strdup(getenv("XDG_RUNTIME_DIR"));
#  205|   
#  206|   	unsetenv("WAYLAND_SOCKET");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def44]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c: scope_hint: In function ‘sanity_client_log’
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:221:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xdg_runtime_dir’ where non-null expected
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:26: included_from: Included from here.
/usr/include/stdlib.h:792:12: note: argument 2 of ‘setenv’ must be non-null
#  219|   	 * leak checker cares about the value of WAYLAND_SOCKET during teardown for
#  220|   	 * correct fd accounting. */
#  221|-> 	setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 0);
#  222|   	setenv("WAYLAND_SOCKET", wayland_socket, 0);
#  223|   	free(xdg_runtime_dir);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def45]
wayland-1.22.0-build/wayland-1.22.0/tests/sanity-test.c:222:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘wayland_socket’ where non-null expected
/usr/include/stdlib.h:792:12: note: argument 2 of ‘setenv’ must be non-null
#  220|   	 * correct fd accounting. */
#  221|   	setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 0);
#  222|-> 	setenv("WAYLAND_SOCKET", wayland_socket, 0);
#  223|   	free(xdg_runtime_dir);
#  224|   	free(wayland_socket);

Error: CLANG_WARNING: [#def46]
wayland-1.22.0-build/wayland-1.22.0/tests/socket-test.c:170:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  168|   
#  169|   		/* is the name sequential? */
#  170|-> 		len = snprintf(path, sizeof example_sockaddr_un.sun_path,
#  171|   			       "wayland-%d", i);
#  172|   		assert(strcmp(name, path) == 0);

Error: CPPCHECK_WARNING (CWE-401): [#def47]
wayland-1.22.0-build/wayland-1.22.0/tests/socket-test.c:216: error[memleak]: Memory leak: destroy_listener
#  214|   	destroy_listener->listener.notify = client_destroy_notify;
#  215|   	wl_client_add_destroy_listener(client, &destroy_listener->listener);
#  216|-> }
#  217|   
#  218|   TEST(absolute_socket_path)

Error: CPPCHECK_WARNING (CWE-401): [#def48]
wayland-1.22.0-build/wayland-1.22.0/tests/test-compositor.c:335: error[memleak]: Memory leak: wfr
#  333|   	if (d->wfr_num == num)
#  334|   		wl_display_terminate(d->wl_display);
#  335|-> }
#  336|   
#  337|   static void

Error: CPPCHECK_WARNING: [#def49]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-570): [#def50]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:73: error[comparePointers]: Comparing pointers that point to different objects
#   71|   	const struct test *t;
#   72|   
#   73|-> 	for (t = &__start_test_section; t < &__stop_test_section; t++)
#   74|   		if (strcmp(t->name, name) == 0)
#   75|   			return t;

Error: CPPCHECK_WARNING (CWE-570): [#def51]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:90: error[comparePointers]: Comparing pointers that point to different objects
#   88|   		name);
#   89|   
#   90|-> 	for (t = &__start_test_section; t < &__stop_test_section; t++)
#   91|   		fprintf(stderr, "  %s\n", t->name);
#   92|   

Error: CLANG_WARNING: [#def52]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:159:2: warning[core.NullDereference]: Access to field 'run' results in a dereference of a null pointer (loaded from variable 't')
#  157|   	cur_fds = count_open_fds();
#  158|   
#  159|-> 	t->run();
#  160|   
#  161|   	/* turn off timeout (if any) after test completion */

Error: GCC_ANALYZER_WARNING (CWE-126): [#def53]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c: scope_hint: In function ‘run_test’
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:159:10: warning[-Wanalyzer-out-of-bounds]: buffer over-read
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:36: included_from: Included from here.
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:159:10: note: read of 8 bytes from after the end of ‘__start_test_section’
#                                                        └─────────────────────────────────────────┘
#                                                                             ^
#  157|   	cur_fds = count_open_fds();
#  158|   
#  159|-> 	t->run();
#  160|   
#  161|   	/* turn off timeout (if any) after test completion */

Error: COMPILER_WARNING (CWE-252): [#def54]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c: scope_hint: In function ‘is_debugger_attached’
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:275:17: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
#  275 |                 read(pipefd[0], &buf, 1);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
#  273|   		/* Wait until parent is ready */
#  274|   		close(pipefd[1]);  /* Close unused write end */
#  275|-> 		read(pipefd[0], &buf, 1);
#  276|   		close(pipefd[0]);
#  277|   		if (buf == '-')

Error: COMPILER_WARNING (CWE-252): [#def55]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:298:25: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  298 |                         write(pipefd[1], "-", 1);
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
#  296|   			 */
#  297|   			perror("prctl");
#  298|-> 			write(pipefd[1], "-", 1);
#  299|   		} else {
#  300|   			/* Signal to client that parent is ready by passing '+' */

Error: COMPILER_WARNING (CWE-252): [#def56]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:301:25: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  301 |                         write(pipefd[1], "+", 1);
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
#  299|   		} else {
#  300|   			/* Signal to client that parent is ready by passing '+' */
#  301|-> 			write(pipefd[1], "+", 1);
#  302|   		}
#  303|   		close(pipefd[1]);

Error: CPPCHECK_WARNING (CWE-570): [#def57]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:352: error[comparePointers]: Comparing pointers that point to different objects
#  350|   
#  351|   	pass = 0;
#  352|-> 	for (t = &__start_test_section; t < &__stop_test_section; t++) {
#  353|   		int success = 0;
#  354|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def58]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c: scope_hint: In function ‘main’
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:373:45: warning[-Wanalyzer-out-of-bounds]: buffer over-read
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:373:45: note: read of 4 bytes from after the end of ‘__start_test_section’
#                                                        └───────────────────────┘
#                                                                    ^
#  371|   		case CLD_EXITED:
#  372|   			if (info.si_status == EXIT_SUCCESS)
#  373|-> 				success = !t->must_fail;
#  374|   			else
#  375|   				success = t->must_fail;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def59]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:375:41: warning[-Wanalyzer-out-of-bounds]: buffer over-read
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:375:41: note: read of 4 bytes from after the end of ‘__start_test_section’
#                                                        └───────────────────────┘
#                                                                    ^
#  373|   				success = !t->must_fail;
#  374|   			else
#  375|-> 				success = t->must_fail;
#  376|   
#  377|   			stderr_set_color(success ? GREEN : RED);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def60]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:379:34: warning[-Wanalyzer-out-of-bounds]: buffer over-read
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:379:34: note: read of 8 bytes from after the end of ‘__start_test_section’
#                                                      └────────────────────────────────┘
#                                                                      ^
#  377|   			stderr_set_color(success ? GREEN : RED);
#  378|   			fprintf(stderr, "test \"%s\":\texit status %d",
#  379|-> 				t->name, info.si_status);
#  380|   
#  381|   			break;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def61]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:384:30: warning[-Wanalyzer-out-of-bounds]: buffer over-read
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:384:30: note: read of 4 bytes from after the end of ‘__start_test_section’
#                                                        └───────────────────────┘
#                                                                    ^
#  382|   		case CLD_KILLED:
#  383|   		case CLD_DUMPED:
#  384|-> 			if (t->must_fail)
#  385|   				success = 1;
#  386|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def62]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:389:34: warning[-Wanalyzer-out-of-bounds]: buffer over-read
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:389:34: note: read of 8 bytes from after the end of ‘__start_test_section’
#                                                      └────────────────────────────────┘
#                                                                      ^
#  387|   			stderr_set_color(success ? GREEN : RED);
#  388|   			fprintf(stderr, "test \"%s\":\tsignal %d",
#  389|-> 				t->name, info.si_status);
#  390|   
#  391|   			break;

Error: CPPCHECK_WARNING (CWE-570): [#def63]
wayland-1.22.0-build/wayland-1.22.0/tests/test-runner.c:406: error[subtractPointers]: Subtracting pointers that point to different objects
#  404|   	}
#  405|   
#  406|-> 	total = &__stop_test_section - &__start_test_section;
#  407|   	fprintf(stderr, "%d tests, %d pass, %d fail\n",
#  408|   		total, pass, total - pass);

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-5.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namewayland-1.22.0-3.fc40
store-results-to/tmp/tmpiy56inc1/wayland-1.22.0-3.fc40.tar.xz
time-created2024-07-03 18:17:07
time-finished2024-07-03 18:18:58
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpiy56inc1/wayland-1.22.0-3.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpiy56inc1/wayland-1.22.0-3.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9