Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libinput-1.31.0/src/evdev-totem.c:840:44: warning[-Wanalyzer-malloc-leak]: leak of ‘zalloc(104)’
libinput-1.31.0/src/evdev-totem.c:826:1: enter_function: entry to ‘evdev_totem_create’
libinput-1.31.0/src/evdev-totem.c:832:12: branch_false: following ‘false’ branch...
libinput-1.31.0/src/evdev-totem.c:835:17: branch_false: ...to here
libinput-1.31.0/src/evdev-totem.c:835:17: call_function: calling ‘zalloc’ from ‘evdev_totem_create’
libinput-1.31.0/src/evdev-totem.c:835:17: return_function: returning to ‘evdev_totem_create’ from ‘zalloc’
libinput-1.31.0/src/evdev-totem.c:841:12: branch_true: following ‘true’ branch...
libinput-1.31.0/src/evdev-totem.c:842:17: branch_true: ...to here
libinput-1.31.0/src/evdev-totem.c:840:44: danger: ‘zalloc(104)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  838|   	totem->base.interface = &totem_interface;
#  839|   
#  840|-> 	num_slots = libevdev_get_num_slots(device->evdev);
#  841|   	if (num_slots <= 0)
#  842|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libinput-1.31.0/src/libinput-plugin-lua.c:186:33: warning[-Wanalyzer-malloc-leak]: leak of ‘udev_property_new(udev_list_entry_get_name(e), udev_list_entry_get_value(e))’
libinput-1.31.0/src/libinput-plugin-lua.c:343:1: enter_function: entry to ‘libinput_lua_plugin_device_new’
libinput-1.31.0/src/libinput-plugin-lua.c:352:9: call_function: calling ‘lua_push_evdev_device’ from ‘libinput_lua_plugin_device_new’
#  184|   				struct udev_property *prop =
#  185|   					udev_property_new(key, value);
#  186|-> 				list_insert(&lua_device->udev_properties_list,
#  187|   					    &prop->link);
#  188|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
libinput-1.31.0/test/test-plugins-lua.c:576:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libinput-1.31.0/test/test-plugins-lua.c:529:1: enter_function: entry to ‘lua_frame_handler’
libinput-1.31.0/test/test-plugins-lua.c:531:37: call_function: calling ‘tmpdir_create’ from ‘lua_frame_handler’
libinput-1.31.0/test/test-plugins-lua.c:531:37: return_function: returning to ‘lua_frame_handler’ from ‘tmpdir_create’
libinput-1.31.0/test/test-plugins-lua.c:542:33: call_function: calling ‘_litest_write_plugin’ from ‘lua_frame_handler’
libinput-1.31.0/test/test-plugins-lua.c:542:33: return_function: returning to ‘lua_frame_handler’ from ‘_litest_write_plugin’
libinput-1.31.0/test/test-plugins-lua.c:548:9: branch_true: following ‘true’ branch (when ‘capture’ is non-NULL)...
libinput-1.31.0/test/test-plugins-lua.c:549:17: branch_true: ...to here
libinput-1.31.0/test/test-plugins-lua.c:557:17: call_function: calling ‘now_in_us’ from ‘lua_frame_handler’
libinput-1.31.0/test/test-plugins-lua.c:557:17: return_function: returning to ‘lua_frame_handler’ from ‘now_in_us’
libinput-1.31.0/test/test-plugins-lua.c:563:17: call_function: calling ‘now_in_us’ from ‘lua_frame_handler’
libinput-1.31.0/test/test-plugins-lua.c:563:17: return_function: returning to ‘lua_frame_handler’ from ‘now_in_us’
libinput-1.31.0/test/test-plugins-lua.c:575:40: call_function: calling ‘safe_strdup’ from ‘lua_frame_handler’
libinput-1.31.0/test/test-plugins-lua.c:575:40: return_function: returning to ‘lua_frame_handler’ from ‘safe_strdup’
libinput-1.31.0/test/test-plugins-lua.c:576:39: release_memory: using NULL here
libinput-1.31.0/test/test-plugins-lua.c:576:36: danger: dereference of NULL ‘safe_strdup(*<unknown>) + i’
#  574|   
#  575|   		_autofree_ char *str = safe_strdup(capture->infos[idx]);
#  576|-> 		for (size_t i = 0; str[i]; i++) {
#  577|   			if (str[i] == '\n') {
#  578|   				str[i] = '\0';

Error: COMPILER_WARNING (CWE-252): [#def4]
libinput-1.31.0/tools/libinput-record.c: scope_hint: In function ‘timefd_dispatch’
libinput-1.31.0/tools/libinput-record.c:2138:15: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
# 2138 |         (void)read(fd, discard, sizeof(discard));
#      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2136|   	char discard[64];
# 2137|   
# 2138|-> 	(void)read(fd, discard, sizeof(discard));
# 2139|   
# 2140|   	if (ctx->timestamps.had_events_since_last_time) {

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-169.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibinput-1.31.3-2.fc45
diffbase-store-results-to/tmp/tmpcdztkk7n/libinput-1.31.3-2.fc45.tar.xz
diffbase-time-created2026-08-03 17:28:55
diffbase-time-finished2026-08-03 17:30:50
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpcdztkk7n/libinput-1.31.3-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpcdztkk7n/libinput-1.31.3-2.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-169.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibinput-1.31.0-1.fc44
store-results-to/tmp/tmpc6wirrp6/libinput-1.31.0-1.fc44.tar.xz
time-created2026-08-03 17:25:51
time-finished2026-08-03 17:28:36
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpc6wirrp6/libinput-1.31.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpc6wirrp6/libinput-1.31.0-1.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9