Error: GCC_ANALYZER_WARNING (CWE-775): [#def1] upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-hid.c: scope_hint: In function ‘up_device_hid_coldplug’ upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-hid.c:301:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_udev_device_get_device_file(up_device_get_native(device)), 2048)’ /usr/include/glib-2.0/glib.h:64: included_from: Included from here. upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-hid.c:29: included_from: Included from here. upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-hid.c:299:17: note: in expansion of macro ‘g_debug’ # 299| g_debug ("using device: %s", device_file); # 300| hid->priv->fd = open (device_file, O_RDONLY | O_NONBLOCK); # 301|-> if (hid->priv->fd < 0) { # 302| g_debug ("cannot open device file %s", device_file); # 303| goto out; Error: GCC_ANALYZER_WARNING (CWE-775): [#def2] upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-wup.c: scope_hint: In function ‘up_device_wup_coldplug’ upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-wup.c:299:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_udev_device_get_device_file(up_device_get_native(device)), 2050)’ # 297| # 298| /* connect to the device */ # 299|-> wup->priv->fd = open (device_file, O_RDWR | O_NONBLOCK); # 300| if (wup->priv->fd < 0) { # 301| g_debug ("cannot open device file %s", device_file); Error: GCC_ANALYZER_WARNING (CWE-775): [#def3] upower-1.90.6-build/upower-v1.90.6/src/linux/up-device-wup.c:300:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_udev_device_get_device_file(up_device_get_native(device)), 2050)’ # 298| /* connect to the device */ # 299| wup->priv->fd = open (device_file, O_RDWR | O_NONBLOCK); # 300|-> if (wup->priv->fd < 0) { # 301| g_debug ("cannot open device file %s", device_file); # 302| goto out; Error: GCC_ANALYZER_WARNING (CWE-121): [#def4] upower-1.90.6-build/upower-v1.90.6/src/linux/up-input.c: scope_hint: In function ‘up_input_str_to_bitmask’ upower-1.90.6-build/upower-v1.90.6/src/linux/up-input.c:103:28: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow upower-1.90.6-build/upower-v1.90.6/src/linux/up-input.c:103:28: note: write of 8 bytes to beyond the end of ‘bitmask’ upower-1.90.6-build/upower-v1.90.6/src/linux/up-input.c:103:28: note: valid subscripts for ‘bitmask’ are ‘[0]’ to ‘[0]’ # 101| # 102| val = strtoul (v[i], NULL, 16); # 103|-> bitmask[j] = val; # 104| # 105| while (val != 0) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def5] upower-1.90.6-build/upower-v1.90.6/src/up-device-battery.c: scope_hint: In function ‘up_device_battery_set_charge_threshold’ upower-1.90.6-build/upower-v1.90.6/src/up-device-battery.c:690:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘error’ upower-1.90.6-build/upower-v1.90.6/src/up-device-battery.c: scope_hint: In function ‘up_device_battery_set_charge_threshold’ upower-1.90.6-build/upower-v1.90.6/src/up-device-battery.c: scope_hint: In function ‘up_device_battery_set_charge_threshold’ # 688| # 689| if (!ret) { # 690|-> g_dbus_method_invocation_return_error (invocation, # 691| UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, # 692| "failed on setting charging threshold: %s", error->message); Error: GCC_ANALYZER_WARNING (CWE-775): [#def6] upower-1.90.6-build/upower-v1.90.6/src/up-kbd-backlight.c: scope_hint: In function ‘up_kbd_backlight_find’ upower-1.90.6-build/upower-v1.90.6/src/up-kbd-backlight.c:295:75: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(dir_path, "brightness", 0), 2)’ # 293| # 294| /* read brightness and check if it has an acceptable value */ # 295|-> if (up_kbd_backlight_brightness_read (kbd_backlight, kbd_backlight->priv->fd) < 0) # 296| goto out; # 297| Error: GCC_ANALYZER_WARNING (CWE-775): [#def7] upower-1.90.6-build/upower-v1.90.6/src/up-kbd-backlight.c:300:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(dir_path, "brightness_hw_changed", 0), 0)’ # 298| path_hw_changed = g_build_filename (dir_path, "brightness_hw_changed", NULL); # 299| kbd_backlight->priv->fd_hw_changed = open (path_hw_changed, O_RDONLY); # 300|-> if (kbd_backlight->priv->fd_hw_changed >= 0) { # 301| kbd_backlight->priv->channel_hw_changed = g_io_channel_unix_new (kbd_backlight->priv->fd_hw_changed); # 302| g_io_add_watch (kbd_backlight->priv->channel_hw_changed,
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-175.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | upower-1.90.6-3.fc42 |
store-results-to | /tmp/tmplb2rljo1/upower-1.90.6-3.fc42.tar.xz |
time-created | 2024-11-13 03:31:06 |
time-finished | 2024-11-13 03:32:39 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmplb2rljo1/upower-1.90.6-3.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmplb2rljo1/upower-1.90.6-3.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |