Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/udisks2-2.9.1/modules/vdo/udisksvdotypes.h Examining data/udisks2-2.9.1/modules/vdo/udiskslinuxmanagervdo.c Examining data/udisks2-2.9.1/modules/vdo/udiskslinuxmanagervdo.h Examining data/udisks2-2.9.1/modules/vdo/udiskslinuxblockvdo.c Examining data/udisks2-2.9.1/modules/vdo/udiskslinuxblockvdo.h Examining data/udisks2-2.9.1/modules/vdo/udiskslinuxmodulevdo.c Examining data/udisks2-2.9.1/modules/vdo/udiskslinuxmodulevdo.h Examining data/udisks2-2.9.1/modules/bcache/udisksbcachetypes.h Examining data/udisks2-2.9.1/modules/bcache/udiskslinuxmanagerbcache.c Examining data/udisks2-2.9.1/modules/bcache/udiskslinuxmanagerbcache.h Examining data/udisks2-2.9.1/modules/bcache/udiskslinuxblockbcache.h Examining data/udisks2-2.9.1/modules/bcache/udiskslinuxblockbcache.c Examining data/udisks2-2.9.1/modules/bcache/udiskslinuxmodulebcache.c Examining data/udisks2-2.9.1/modules/bcache/udiskslinuxmodulebcache.h Examining data/udisks2-2.9.1/modules/lsm/lsm_data.c Examining data/udisks2-2.9.1/modules/lsm/lsm_data.h Examining data/udisks2-2.9.1/modules/lsm/lsm_linux_drive_local.c Examining data/udisks2-2.9.1/modules/lsm/lsm_linux_drive_local.h Examining data/udisks2-2.9.1/modules/lsm/lsm_linux_drive.c Examining data/udisks2-2.9.1/modules/lsm/lsm_linux_drive.h Examining data/udisks2-2.9.1/modules/lsm/lsm_types.h Examining data/udisks2-2.9.1/modules/lsm/udiskslinuxmodulelsm.c Examining data/udisks2-2.9.1/modules/lsm/udiskslinuxmodulelsm.h Examining data/udisks2-2.9.1/modules/zram/udiskszramutil.h Examining data/udisks2-2.9.1/modules/zram/udiskszramutil.c Examining data/udisks2-2.9.1/modules/zram/udiskszramtypes.h Examining data/udisks2-2.9.1/modules/zram/udiskslinuxmanagerzram.c Examining data/udisks2-2.9.1/modules/zram/udiskslinuxmanagerzram.h Examining data/udisks2-2.9.1/modules/zram/udiskslinuxblockzram.h Examining data/udisks2-2.9.1/modules/zram/udiskslinuxblockzram.c Examining data/udisks2-2.9.1/modules/zram/udiskslinuxmodulezram.c Examining data/udisks2-2.9.1/modules/zram/udiskslinuxmodulezram.h Examining data/udisks2-2.9.1/modules/lvm2/jobhelpers.c Examining data/udisks2-2.9.1/modules/lvm2/jobhelpers.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxmanagerlvm2.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxmanagerlvm2.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslvm2daemonutil.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslvm2daemonutil.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxblocklvm2.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxblocklvm2.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxvdovolume.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxvdovolume.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxvolumegroupobject.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxvolumegroupobject.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxvolumegroup.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxvolumegroup.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxphysicalvolume.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxphysicalvolume.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxlogicalvolumeobject.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxlogicalvolumeobject.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxlogicalvolume.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxlogicalvolume.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxmodulelvm2.c Examining data/udisks2-2.9.1/modules/lvm2/udiskslinuxmodulelvm2.h Examining data/udisks2-2.9.1/modules/lvm2/udiskslvm2types.h Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxiscsisessionobject.c Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxiscsisessionobject.h Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxiscsisession.c Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxiscsisession.h Examining data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c Examining data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.h Examining data/udisks2-2.9.1/modules/iscsi/udisksiscsitypes.h Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxmanageriscsiinitiator.c Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxmanageriscsiinitiator.h Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxmoduleiscsi.c Examining data/udisks2-2.9.1/modules/iscsi/udiskslinuxmoduleiscsi.h Examining data/udisks2-2.9.1/modules/btrfs/udisksbtrfsutil.c Examining data/udisks2-2.9.1/modules/btrfs/udisksbtrfsutil.h Examining data/udisks2-2.9.1/modules/btrfs/udisksbtrfstypes.h Examining data/udisks2-2.9.1/modules/btrfs/udiskslinuxmanagerbtrfs.c Examining data/udisks2-2.9.1/modules/btrfs/udiskslinuxmanagerbtrfs.h Examining data/udisks2-2.9.1/modules/btrfs/udiskslinuxfilesystembtrfs.c Examining data/udisks2-2.9.1/modules/btrfs/udiskslinuxfilesystembtrfs.h Examining data/udisks2-2.9.1/modules/btrfs/udiskslinuxmodulebtrfs.c Examining data/udisks2-2.9.1/modules/btrfs/udiskslinuxmodulebtrfs.h Examining data/udisks2-2.9.1/tools/umount-udisks.c Examining data/udisks2-2.9.1/tools/udisksctl.c Examining data/udisks2-2.9.1/src/tests/helper.c Examining data/udisks2-2.9.1/src/tests/testutil.c Examining data/udisks2-2.9.1/src/tests/testutil.h Examining data/udisks2-2.9.1/src/tests/test.c Examining data/udisks2-2.9.1/src/main.c Examining data/udisks2-2.9.1/src/udisksutabmonitor.c Examining data/udisks2-2.9.1/src/udisksutabmonitor.h Examining data/udisks2-2.9.1/src/udisksutabentry.c Examining data/udisks2-2.9.1/src/udisksutabentry.h Examining data/udisks2-2.9.1/src/udisks-daemon-resources.c Examining data/udisks2-2.9.1/src/udisks-daemon-resources.h Examining data/udisks2-2.9.1/src/udisks-daemon-marshal.c Examining data/udisks2-2.9.1/src/udisks-daemon-marshal.h Examining data/udisks2-2.9.1/src/udisksconfigmanager.c Examining data/udisks2-2.9.1/src/udisksconfigmanager.h Examining data/udisks2-2.9.1/src/udisksmodule.c Examining data/udisks2-2.9.1/src/udisksmodule.h Examining data/udisks2-2.9.1/src/udisksmoduleobject.c Examining data/udisks2-2.9.1/src/udisksmoduleobject.h Examining data/udisks2-2.9.1/src/udisksmodulemanager.c Examining data/udisks2-2.9.1/src/udisksmodulemanager.h Examining data/udisks2-2.9.1/src/udisksata.c Examining data/udisks2-2.9.1/src/udisksata.h Examining data/udisks2-2.9.1/src/udiskslinuxdevice.c Examining data/udisks2-2.9.1/src/udiskslinuxdevice.h Examining data/udisks2-2.9.1/src/udiskscrypttabmonitor.c Examining data/udisks2-2.9.1/src/udiskscrypttabmonitor.h Examining data/udisks2-2.9.1/src/udiskscrypttabentry.c Examining data/udisks2-2.9.1/src/udiskscrypttabentry.h Examining data/udisks2-2.9.1/src/udisksfstabentry.c Examining data/udisks2-2.9.1/src/udisksfstabentry.h Examining data/udisks2-2.9.1/src/udisksprivate.h Examining data/udisks2-2.9.1/src/udisksstate.c Examining data/udisks2-2.9.1/src/udisksstate.h Examining data/udisks2-2.9.1/src/udiskslogging.c Examining data/udisks2-2.9.1/src/udiskslogging.h Examining data/udisks2-2.9.1/src/udisksdaemonutil.c Examining data/udisks2-2.9.1/src/udisksdaemonutil.h Examining data/udisks2-2.9.1/src/udisksmountmonitor.c Examining data/udisks2-2.9.1/src/udisksmountmonitor.h Examining data/udisks2-2.9.1/src/udisksmount.c Examining data/udisks2-2.9.1/src/udisksmount.h Examining data/udisks2-2.9.1/src/udiskssimplejob.c Examining data/udisks2-2.9.1/src/udiskssimplejob.h Examining data/udisks2-2.9.1/src/udisksthreadedjob.c Examining data/udisks2-2.9.1/src/udisksthreadedjob.h Examining data/udisks2-2.9.1/src/udisksspawnedjob.c Examining data/udisks2-2.9.1/src/udisksspawnedjob.h Examining data/udisks2-2.9.1/src/udisksbasejob.c Examining data/udisks2-2.9.1/src/udisksbasejob.h Examining data/udisks2-2.9.1/src/udiskslinuxfsinfo.c Examining data/udisks2-2.9.1/src/udiskslinuxfsinfo.h Examining data/udisks2-2.9.1/src/udiskslinuxmountoptions.c Examining data/udisks2-2.9.1/src/udiskslinuxmountoptions.h Examining data/udisks2-2.9.1/src/udiskslinuxmanager.c Examining data/udisks2-2.9.1/src/udiskslinuxmanager.h Examining data/udisks2-2.9.1/src/udiskslinuxmdraid.c Examining data/udisks2-2.9.1/src/udiskslinuxmdraid.h Examining data/udisks2-2.9.1/src/udiskslinuxmdraidhelpers.c Examining data/udisks2-2.9.1/src/udiskslinuxmdraidhelpers.h Examining data/udisks2-2.9.1/src/udiskslinuxmdraidobject.c Examining data/udisks2-2.9.1/src/udiskslinuxmdraidobject.h Examining data/udisks2-2.9.1/src/udiskslinuxdriveata.c Examining data/udisks2-2.9.1/src/udiskslinuxdriveata.h Examining data/udisks2-2.9.1/src/udiskslinuxdrive.c Examining data/udisks2-2.9.1/src/udiskslinuxdrive.h Examining data/udisks2-2.9.1/src/udiskslinuxdriveobject.c Examining data/udisks2-2.9.1/src/udiskslinuxdriveobject.h Examining data/udisks2-2.9.1/src/udiskslinuxloop.c Examining data/udisks2-2.9.1/src/udiskslinuxloop.h Examining data/udisks2-2.9.1/src/udiskslinuxswapspace.c Examining data/udisks2-2.9.1/src/udiskslinuxswapspace.h Examining data/udisks2-2.9.1/src/udiskslinuxencryptedhelpers.c Examining data/udisks2-2.9.1/src/udiskslinuxencryptedhelpers.h Examining data/udisks2-2.9.1/src/udiskslinuxencrypted.c Examining data/udisks2-2.9.1/src/udiskslinuxencrypted.h Examining data/udisks2-2.9.1/src/udiskslinuxfilesystemhelpers.c Examining data/udisks2-2.9.1/src/udiskslinuxfilesystemhelpers.h Examining data/udisks2-2.9.1/src/udiskslinuxfilesystem.c Examining data/udisks2-2.9.1/src/udiskslinuxfilesystem.h Examining data/udisks2-2.9.1/src/udiskslinuxpartitiontable.c Examining data/udisks2-2.9.1/src/udiskslinuxpartitiontable.h Examining data/udisks2-2.9.1/src/udiskslinuxpartition.c Examining data/udisks2-2.9.1/src/udiskslinuxpartition.h Examining data/udisks2-2.9.1/src/udiskslinuxblock.c Examining data/udisks2-2.9.1/src/udiskslinuxblock.h Examining data/udisks2-2.9.1/src/udiskslinuxblockobject.c Examining data/udisks2-2.9.1/src/udiskslinuxblockobject.h Examining data/udisks2-2.9.1/src/udiskslinuxprovider.c Examining data/udisks2-2.9.1/src/udiskslinuxprovider.h Examining data/udisks2-2.9.1/src/udisksprovider.c Examining data/udisks2-2.9.1/src/udisksprovider.h Examining data/udisks2-2.9.1/src/udisksdaemon.c Examining data/udisks2-2.9.1/src/udisksdaemon.h Examining data/udisks2-2.9.1/src/udisksdaemontypes.h Examining data/udisks2-2.9.1/udisks/udiskserror.c Examining data/udisks2-2.9.1/udisks/udisksobjectinfo.c Examining data/udisks2-2.9.1/udisks/udisksclient.c Examining data/udisks2-2.9.1/udisks/udiskstypes.h Examining data/udisks2-2.9.1/udisks/udiskserror.h Examining data/udisks2-2.9.1/udisks/udisksenums.h Examining data/udisks2-2.9.1/udisks/udisksobjectinfo.h Examining data/udisks2-2.9.1/udisks/udisksclient.h Examining data/udisks2-2.9.1/udisks/udisks.h FINAL RESULTS: data/udisks2-2.9.1/modules/zram/udiskszramutil.c:61:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod (tmpfname, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) != 0) data/udisks2-2.9.1/src/udisksdaemonutil.c:450:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. num = readlink (full_path, link_path, sizeof(link_path) - 1); data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:514:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(path, uid, -1); data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:622:15: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown (mount_dir, -1, gid) == -1) data/udisks2-2.9.1/src/udiskslinuxfilesystemhelpers.c:47:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown (directory, caller_uid, caller_gid) != 0) data/udisks2-2.9.1/src/udiskslinuxfilesystemhelpers.c:66:15: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown (path, caller_uid, caller_gid) != 0) data/udisks2-2.9.1/src/udiskslinuxfilesystemhelpers.c:147:11: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown (mountpoint, caller_uid, caller_gid) != 0) data/udisks2-2.9.1/src/udiskslinuxfilesystemhelpers.c:157:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod (mountpoint, 0700) != 0) data/udisks2-2.9.1/src/udiskslinuxmanager.c:382:14: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. path_len = readlink (proc_path, path, sizeof (path) - 1); data/udisks2-2.9.1/src/udisksdaemonutil.c:56:29: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. #define LOGIND_AVAILABLE() (access("/run/systemd/seats/", F_OK) >= 0) data/udisks2-2.9.1/src/udiskslinuxblock.c:1398:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (start, end+1); data/udisks2-2.9.1/src/udiskslinuxencryptedhelpers.c:103:70: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. data->keyfiles, data->hidden, data->system, veracrypt, data->pim, data/udisks2-2.9.1/src/udiskslinuxencryptedhelpers.h:42:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. gboolean system; data/udisks2-2.9.1/src/udiskslinuxmdraid.c:336:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (sync_completed, "%" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT, data/udisks2-2.9.1/src/udisksmountmonitor.c:481:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (lines[n], data/udisks2-2.9.1/src/udisksmountmonitor.c:513:19: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (sep + 3, PATH_MAX_FMT " " PATH_MAX_FMT, fstype, mount_source) != 2) data/udisks2-2.9.1/src/udisksmountmonitor.c:617:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (lines[n], PATH_MAX_FMT, filename) != 1) data/udisks2-2.9.1/tools/udisksctl.c:224:22: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. _color_pager_out = popen (pager_program, "w"); data/udisks2-2.9.1/src/udisksdaemonutil.c:461:11: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath (absolute_path, resolved_path) != NULL) data/udisks2-2.9.1/src/udisksstate.c:739:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath (mount_point_str, mount_point) == NULL) data/udisks2-2.9.1/modules/lsm/lsm_data.c:410:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. lsm_sys_id = (char *) lsm_system_id_get (lsm_syss[i]); data/udisks2-2.9.1/modules/lsm/lsm_data.h:48:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char raid_type[_MAX_RAID_TYPE_LEN]; data/udisks2-2.9.1/modules/lsm/lsm_data.h:49:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char status_info[_MAX_STATUS_INFO_LEN]; data/udisks2-2.9.1/modules/lvm2/udiskslvm2daemonutil.c:69:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_RDONLY | O_EXCL); data/udisks2-2.9.1/modules/lvm2/udiskslvm2daemonutil.c:182:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_RDWR | O_EXCL); data/udisks2-2.9.1/modules/lvm2/udiskslvm2daemonutil.c:270:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open (device_file, O_RDWR); data/udisks2-2.9.1/modules/zram/udiskszramutil.c:39:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[BUFLEN]; data/udisks2-2.9.1/modules/zram/udiskszramutil.c:44:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen (filename, "r+"); data/udisks2-2.9.1/src/udisksdaemonutil.c:399:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (g_udev_device_get_device_file (device), O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxblock.c:2394:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_WRONLY | O_SYNC | O_EXCL); data/udisks2-2.9.1/src/udiskslinuxblock.c:2823:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device, O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxblock.c:3527:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device, flags); data/udisks2-2.9.1/src/udiskslinuxblockobject.c:969:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (path, O_WRONLY); data/udisks2-2.9.1/src/udiskslinuxblockobject.c:1186:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxdevice.c:188:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_RDONLY|O_NONBLOCK); data/udisks2-2.9.1/src/udiskslinuxdrive.c:1454:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). device_fd = open (device_file, O_RDONLY|O_NONBLOCK|O_EXCL); data/udisks2-2.9.1/src/udiskslinuxdrive.c:1491:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (udisks_block_get_device (block), O_RDONLY|O_NONBLOCK|O_EXCL); data/udisks2-2.9.1/src/udiskslinuxdrive.c:1560:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen (remove_path, "w"); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:449:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (g_udev_device_get_device_file (device->udev_device), O_RDONLY|O_NONBLOCK); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:485:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). statf = fopen (statpath, "r"); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:1484:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (g_udev_device_get_device_file (device->udev_device), open_flags); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:1644:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_RDWR|O_NONBLOCK); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:1989:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (g_udev_device_get_device_file (device->udev_device), O_RDONLY | O_EXCL); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2100:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf + 2, pass, strlen (pass)); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2147:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf + 2, pass, strlen (pass)); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2177:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf + 2, pass, strlen (pass)); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2417:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (g_udev_device_get_device_file (device->udev_device), O_RDONLY|O_NONBLOCK); data/udisks2-2.9.1/src/udiskslinuxmanager.c:672:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (device_file, O_RDWR | O_EXCL); data/udisks2-2.9.1/src/udiskslinuxmdraid.c:473:42: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). member_slot_as_int = atoi (member_slot); data/udisks2-2.9.1/src/udiskslinuxmdraidhelpers.c:85:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). ret = atoi (str); data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:101:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (*dest + dest_len, l, l_len * sizeof (gpointer)); data/udisks2-2.9.1/src/udiskslinuxpartition.c:371:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (partition_name, O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxpartition.c:521:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (partition_name, O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxpartition.c:679:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (partition_name, O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxpartition.c:924:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (part, O_RDONLY); data/udisks2-2.9.1/src/udiskslinuxpartitiontable.c:572:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = block? open (udisks_block_get_device (block), O_RDONLY) : -1; data/udisks2-2.9.1/src/udisksstate.c:639:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (path, O_WRONLY); data/udisks2-2.9.1/tools/udisksctl.c:897:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). tty = fopen (tty_name, "r+"); data/udisks2-2.9.1/tools/udisksctl.c:1670:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (opt_loop_file, opt_loop_read_only ? O_RDONLY : O_RDWR); data/udisks2-2.9.1/tools/udisksctl.c:3503:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen ("/tmp/udisksctl-completion-debug.txt", "a+"); data/udisks2-2.9.1/udisks/udisksclient.c:2680:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (ret, info, sizeof (UDisksPartitionTypeInfo)); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:124:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (auth_info->chap.username, username, LIBISCSI_VALUE_MAXLEN - 1); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:126:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (auth_info->chap.password, password, LIBISCSI_VALUE_MAXLEN - 1); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:133:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (auth_info->chap.reverse_username, reverse_username, LIBISCSI_VALUE_MAXLEN - 1); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:135:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (auth_info->chap.reverse_password, reverse_password, LIBISCSI_VALUE_MAXLEN - 1); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:152:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (node->name, name, LIBISCSI_VALUE_MAXLEN - 1); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:153:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (node->address, address, NI_MAXHOST - 1); data/udisks2-2.9.1/modules/iscsi/udisksiscsiutil.c:154:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (node->iface, iface, LIBISCSI_VALUE_MAXLEN - 1); data/udisks2-2.9.1/modules/iscsi/udiskslinuxmanageriscsiinitiator.c:362:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!arg_name || strlen (arg_name) == 0) data/udisks2-2.9.1/modules/iscsi/udiskslinuxmanageriscsiinitiator.c:391:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (arg_name[strlen (arg_name) - 1] != ' ') data/udisks2-2.9.1/modules/iscsi/udiskslinuxmanageriscsiinitiator.c:402:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). contents += strlen ("[" FAKE_GROUP_NAME "]\n"); data/udisks2-2.9.1/modules/lsm/lsm_data.c:307:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (uri) <= 0) data/udisks2-2.9.1/modules/lsm/lsm_data.c:411:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (lsm_sys_id == NULL || strlen (lsm_sys_id) == 0) data/udisks2-2.9.1/modules/lsm/lsm_data.c:485:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (lsm_vpd83) == 0) data/udisks2-2.9.1/modules/lsm/lsm_data.c:591:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (pl_id == NULL || strlen (pl_id) == 0) data/udisks2-2.9.1/modules/lsm/lsm_data.c:631:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (vpd83 == NULL || strlen (vpd83) == 0) data/udisks2-2.9.1/modules/lsm/lsm_data.c:636:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (pl_id == NULL || strlen (pl_id) == 0) data/udisks2-2.9.1/modules/lsm/lsm_data.c:1053:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (std_lsm_vol_data->raid_type, lsm_vri_data->raid_type_str, _MAX_RAID_TYPE_LEN); data/udisks2-2.9.1/modules/lsm/lsm_data.c:1056:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (std_lsm_vol_data->status_info, lsm_pl_data->status_info, _MAX_STATUS_INFO_LEN); data/udisks2-2.9.1/modules/lsm/lsm_linux_drive.c:323:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (! wwn || strlen (wwn) < 2) data/udisks2-2.9.1/modules/lsm/udiskslinuxmodulelsm.c:173:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (! wwn || strlen (wwn) < 2) data/udisks2-2.9.1/modules/zram/udiskszramutil.c:81:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (! strncmp(key, buff, strlen(key))) data/udisks2-2.9.1/modules/zram/udiskszramutil.c:83:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buff+strlen (key)+1, value, BUFLEN-strlen (key)-1); data/udisks2-2.9.1/modules/zram/udiskszramutil.c:83:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncpy (buff+strlen (key)+1, value, BUFLEN-strlen (key)-1); data/udisks2-2.9.1/modules/zram/udiskszramutil.c:83:55: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncpy (buff+strlen (key)+1, value, BUFLEN-strlen (key)-1); data/udisks2-2.9.1/modules/zram/udiskszramutil.c:84:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buff[strlen (buff)] = '\n'; data/udisks2-2.9.1/src/tests/helper.c:98:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc (stdin)) != EOF) data/udisks2-2.9.1/src/tests/helper.c:112:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc (stdin)) != EOF) { data/udisks2-2.9.1/src/udisks-daemon-resources.c:303:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/udisks2-2.9.1/src/udisks-daemon-resources.c:311:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/udisks2-2.9.1/src/udisks-daemon-resources.c:323:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/udisks2-2.9.1/src/udisks-daemon-resources.c:330:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/udisks2-2.9.1/src/udiskscrypttabmonitor.c:405:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (line) == 0) data/udisks2-2.9.1/src/udisksdaemonutil.c:623:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (value != NULL && strlen (value) > 0) data/udisks2-2.9.1/src/udisksdaemonutil.c:831:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (vendor) > 0 && strlen (model) > 0) data/udisks2-2.9.1/src/udisksdaemonutil.c:831:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (vendor) > 0 && strlen (model) > 0) data/udisks2-2.9.1/src/udisksdaemonutil.c:833:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strlen (vendor) > 0) data/udisks2-2.9.1/src/udisksdaemonutil.c:869:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (i = 0; media_compat[i] && strlen(media_compat[i]); i++) data/udisks2-2.9.1/src/udisksdaemonutil.c:1398:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). contents_len = strlen (contents); data/udisks2-2.9.1/src/udiskslinuxblock.c:328:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (uuid != NULL && strlen (uuid) > 0) data/udisks2-2.9.1/src/udiskslinuxblock.c:339:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (uuid != NULL && strlen (uuid) > 0) data/udisks2-2.9.1/src/udiskslinuxblock.c:478:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (device_path == NULL || strlen (device_path) < 1) data/udisks2-2.9.1/src/udiskslinuxblock.c:1179:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). gchar *id = g_strdup (id_device_file + strlen ("/dev/disk/")); data/udisks2-2.9.1/src/udiskslinuxblock.c:1329:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). gchar *dest = g_malloc (strlen (source) + 1); data/udisks2-2.9.1/src/udiskslinuxblock.c:1492:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (mntent_add.mnt_opts) == 0) data/udisks2-2.9.1/src/udiskslinuxblock.c:1522:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (line) == 0 && lines[n+1] == NULL) data/udisks2-2.9.1/src/udiskslinuxblock.c:1532:15: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf (line, "%511s %511s %511s %511s %d %d", data/udisks2-2.9.1/src/udiskslinuxblock.c:1775:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (line) == 0 && lines[n+1] == NULL) data/udisks2-2.9.1/src/udiskslinuxblock.c:1785:24: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. num_parsed = sscanf (line, "%511s %511s %511s %511s", data/udisks2-2.9.1/src/udiskslinuxblock.c:1790:17: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy (parsed_passphrase_path, ""); data/udisks2-2.9.1/src/udiskslinuxblock.c:1792:17: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy (parsed_options, ""); data/udisks2-2.9.1/src/udiskslinuxblock.c:1799:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (remove_passphrase_path) > 0 && !g_str_has_prefix (remove_passphrase_path, "/dev")) data/udisks2-2.9.1/src/udiskslinuxblock.c:1846:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (add_passphrase_path) > 0) data/udisks2-2.9.1/src/udiskslinuxblock.c:1902:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (add_passphrase_path) > 0 ? add_passphrase_path : "none", data/udisks2-2.9.1/src/udiskslinuxblockobject.c:976:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write (fd, str, strlen (str)) != (ssize_t) strlen (str)) data/udisks2-2.9.1/src/udiskslinuxblockobject.c:976:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write (fd, str, strlen (str)) != (ssize_t) strlen (str)) data/udisks2-2.9.1/src/udiskslinuxdrive.c:155:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (vendor != NULL && strlen (vendor) > 0) data/udisks2-2.9.1/src/udiskslinuxdrive.c:159:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (model != NULL && strlen (model) > 0) data/udisks2-2.9.1/src/udiskslinuxdrive.c:166:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (serial != NULL && strlen (serial) > 0) data/udisks2-2.9.1/src/udiskslinuxdrive.c:172:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (wwn != NULL && strlen (wwn) > 0) data/udisks2-2.9.1/src/udiskslinuxdrive.c:243:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (id == NULL || strlen (id) == 0) data/udisks2-2.9.1/src/udiskslinuxdrive.c:899:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (seat == NULL || strlen (seat) == 0) data/udisks2-2.9.1/src/udiskslinuxdriveata.c:1495:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, buf, sizeof (buf)) != sizeof (buf)) data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2100:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy (buf + 2, pass, strlen (pass)); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2147:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy (buf + 2, pass, strlen (pass)); data/udisks2-2.9.1/src/udiskslinuxdriveata.c:2177:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy (buf + 2, pass, strlen (pass)); data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:263:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (vendor != NULL && strlen (vendor) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:267:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (model != NULL && strlen (model) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:273:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (serial != NULL && strlen (serial) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:827:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (wwn != NULL && strlen (wwn) > 0 && !is_wwn_black_listed (wwn)) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:829:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (serial != NULL && strlen (serial) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:834:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (serial != NULL && strlen (serial) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:836:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (model != NULL && strlen (model) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:841:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (path != NULL && strlen (path) > 0) data/udisks2-2.9.1/src/udiskslinuxdriveobject.c:1177:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (sibling_id == NULL || strlen (sibling_id) == 0) data/udisks2-2.9.1/src/udiskslinuxencrypted.c:272:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (passphrase_path) > 0 && data/udisks2-2.9.1/src/udiskslinuxencrypted.c:471:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (passphrase && (strlen (passphrase) > 0)) data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:411:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (requested_fs_type) > 0) data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:450:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (probed_fs_type != NULL && strlen (probed_fs_type) > 0) data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:647:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (label != NULL && strlen (label) > 0) data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:663:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (uuid != NULL && strlen (uuid) > 0) data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:1029:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (probed_fs_usage != NULL && strlen (probed_fs_usage) > 0 && data/udisks2-2.9.1/src/udiskslinuxfilesystem.c:1652:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fs_info->command_clear_label != NULL && strlen (label) == 0) data/udisks2-2.9.1/src/udiskslinuxmanager.c:614:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (arg_name) > 32) data/udisks2-2.9.1/src/udiskslinuxmanager.c:716:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (arg_name) > 0) data/udisks2-2.9.1/src/udiskslinuxmanager.c:750:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (arg_name) > 0) data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:391:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return g_strndup (key, strlen (key) - strlen (MOUNT_OPTIONS_KEY_DEFAULTS) - 1); data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:391:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return g_strndup (key, strlen (key) - strlen (MOUNT_OPTIONS_KEY_DEFAULTS) - 1); data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:396:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return g_strndup (key, strlen (key) - strlen (MOUNT_OPTIONS_KEY_ALLOW) - 1); data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:396:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return g_strndup (key, strlen (key) - strlen (MOUNT_OPTIONS_KEY_ALLOW) - 1); data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:577:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). key = g_ascii_strdown (*keys + strlen (UDEV_MOUNT_OPTIONS_PREFIX), -1); data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:741:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fsmo && fsmo->allow && value && strlen (value) > 0) data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:759:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (value == NULL || strlen (value) == 0) data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:776:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (value == NULL || strlen (value) == 0) data/udisks2-2.9.1/src/udiskslinuxmountoptions.c:838:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (value && strlen (value) > 0 && fsmo->allow && data/udisks2-2.9.1/src/udiskslinuxpartition.c:538:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (name) > 36) data/udisks2-2.9.1/src/udiskslinuxpartition.c:607:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (str) != 36) data/udisks2-2.9.1/src/udiskslinuxpartition.c:724:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (type) == 0 || *endp != '\0') data/udisks2-2.9.1/src/udiskslinuxpartitiontable.c:345:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (name) > 0) data/udisks2-2.9.1/src/udiskslinuxpartitiontable.c:462:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (g_strcmp0 (table_type, "gpt") == 0 && strlen (name) > 0) data/udisks2-2.9.1/src/udiskslinuxpartitiontable.c:474:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (part_spec->type != BD_PART_TYPE_EXTENDED && strlen (type) > 0) data/udisks2-2.9.1/src/udiskslinuxprovider.c:416:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). id = g_strndup (conf_filename, strlen (conf_filename) - 5); data/udisks2-2.9.1/src/udisksmountmonitor.c:478:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (lines[n]) == 0) data/udisks2-2.9.1/src/udisksmountmonitor.c:614:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (lines[n]) == 0) data/udisks2-2.9.1/tools/udisksctl.c:310:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). property_name_len = strlen (property_name); data/udisks2-2.9.1/tools/udisksctl.c:329:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rightmost = indent + strlen (property_name) + 2; data/udisks2-2.9.1/tools/udisksctl.c:336:66: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). value_str = variant_to_string_with_indent (value, indent + strlen (property_name) + 2 + value_indent); data/udisks2-2.9.1/tools/udisksctl.c:918:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (tty); data/udisks2-2.9.1/tools/udisksctl.c:1371:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memset (passphrase, '\0', strlen (passphrase)); data/udisks2-2.9.1/tools/udisksctl.c:2760:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). property_name_len = strlen (property_name); data/udisks2-2.9.1/tools/udisksctl.c:2778:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rightmost = 2 + strlen (property_name) + 2; data/udisks2-2.9.1/tools/udisksctl.c:2783:61: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). value_str = variant_to_string_with_indent (value, 2 + strlen (property_name) + 2 + value_indent); data/udisks2-2.9.1/tools/udisksctl.c:2958:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = str != NULL ? strlen (str) : 0; data/udisks2-2.9.1/tools/udisksctl.c:3086:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (vendor) == 0) data/udisks2-2.9.1/tools/udisksctl.c:3088:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (model) == 0) data/udisks2-2.9.1/tools/udisksctl.c:3205:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(s); data/udisks2-2.9.1/tools/umount-udisks.c:83:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (argc < 2 || strlen (argv[1]) == 0) data/udisks2-2.9.1/udisks/udisksclient.c:1237:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (ret == NULL || strlen (ret) == 0) data/udisks2-2.9.1/udisks/udisksclient.c:1326:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (sibling_id == NULL || strlen (sibling_id) == 0) data/udisks2-2.9.1/udisks/udisksclient.c:2093:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((id_type[n].version == NULL && strlen (version) == 0)) data/udisks2-2.9.1/udisks/udisksclient.c:2101:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if ((g_strcmp0 (id_type[n].version, version) == 0 && strlen (version) > 0) || data/udisks2-2.9.1/udisks/udisksclient.c:2102:65: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (g_strcmp0 (id_type[n].version, "*") == 0 && strlen (version) > 0)) data/udisks2-2.9.1/udisks/udisksclient.c:2127:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (version) > 0) data/udisks2-2.9.1/udisks/udisksclient.c:2136:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (type) > 0) data/udisks2-2.9.1/udisks/udisksclient.c:2153:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (type) > 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:211:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (str); data/udisks2-2.9.1/udisks/udisksobjectinfo.c:390:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (s != NULL && strlen (s) > 1) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:425:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (info->name) > 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:548:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (connection_bus) > 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:554:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (vendor) == 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:556:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (model) == 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:795:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (cs != NULL && strlen (cs) > 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:804:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (cs != NULL && strlen (cs) > 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:813:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (cs != NULL && strlen (cs) > 0) data/udisks2-2.9.1/udisks/udisksobjectinfo.c:848:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (drive_revision) > 0) ANALYSIS SUMMARY: Hits = 195 Lines analyzed = 67612 in approximately 1.48 seconds (45757 lines/second) Physical Source Lines of Code (SLOC) = 47204 Hits@level = [0] 16 [1] 134 [2] 41 [3] 2 [4] 9 [5] 9 Hits@level+ = [0+] 211 [1+] 195 [2+] 61 [3+] 20 [4+] 18 [5+] 9 Hits/KSLOC@level+ = [0+] 4.46996 [1+] 4.13101 [2+] 1.29226 [3+] 0.423693 [4+] 0.381324 [5+] 0.190662 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.