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/libpam-mount-2.16/src/autoloop.c Examining data/libpam-mount-2.16/src/bdev.c Examining data/libpam-mount-2.16/src/cmt-internal.h Examining data/libpam-mount-2.16/src/crypto-cgd.c Examining data/libpam-mount-2.16/src/crypto.c Examining data/libpam-mount-2.16/src/libcryptmount.h Examining data/libpam-mount-2.16/src/log.c Examining data/libpam-mount-2.16/src/loop-linux.c Examining data/libpam-mount-2.16/src/loop-mdvn.c Examining data/libpam-mount-2.16/src/loop-vnd.c Examining data/libpam-mount-2.16/src/loop.c Examining data/libpam-mount-2.16/src/misc.c Examining data/libpam-mount-2.16/src/mtab.c Examining data/libpam-mount-2.16/src/pam_mount.c Examining data/libpam-mount-2.16/src/rdconf2.c Examining data/libpam-mount-2.16/src/spawn.c Examining data/libpam-mount-2.16/src/mtcrypt.c Examining data/libpam-mount-2.16/src/pmvarrun.c Examining data/libpam-mount-2.16/src/pam_mount.h Examining data/libpam-mount-2.16/src/mount.c Examining data/libpam-mount-2.16/src/crypto-dmc.c Examining data/libpam-mount-2.16/src/ehd.c Examining data/libpam-mount-2.16/src/rdconf1.c FINAL RESULTS: data/libpam-mount-2.16/src/mount.c:345: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(dtmp, pe->pw_uid, pe->pw_gid) < 0) { data/libpam-mount-2.16/src/mount.c:366: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(d, pe->pw_uid, pe->pw_gid) < 0) { data/libpam-mount-2.16/src/pmvarrun.c:313:6: [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(VAR_RUN_PMT, 0, 0) < 0) { data/libpam-mount-2.16/src/pmvarrun.c:323:6: [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(VAR_RUN_PMT, mode) < 0) { data/libpam-mount-2.16/src/log.c:57:8: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ret = vfprintf(stderr, format, args); data/libpam-mount-2.16/src/log.c:87:8: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ret = vfprintf(stderr, format, args); data/libpam-mount-2.16/src/pmvarrun.c:247:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(filename, sizeof(filename), VAR_RUN_PMT "/%s", user); data/libpam-mount-2.16/src/crypto.c:55:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("LIBCRYPTMOUNT_IDENTIFY") != NULL) data/libpam-mount-2.16/src/mtcrypt.c:789:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. getenv("PMT_DEBUG_UMOUNT") != NULL) { data/libpam-mount-2.16/src/pam_mount.c:385:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. envpath_saved = getenv("PATH"); data/libpam-mount-2.16/src/pmvarrun.c:89:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((s = getenv("_PMT_DEBUG_LEVEL")) != NULL && data/libpam-mount-2.16/src/pmvarrun.c:177:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, const_cast2(char * const *, argv), data/libpam-mount-2.16/src/bdev.c:29: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). if ((fd = open(path, O_RDONLY | O_WRONLY)) < 0) { data/libpam-mount-2.16/src/crypto-cgd.c:31:2: [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 dev[64]; data/libpam-mount-2.16/src/crypto-cgd.c:36: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(dev, O_RDWR | O_EXCL); data/libpam-mount-2.16/src/crypto-cgd.c:70: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). if ((fd = open(mt->crypto_device, O_RDWR)) < 0) data/libpam-mount-2.16/src/crypto.c:416:11: [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. unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; data/libpam-mount-2.16/src/crypto.c:467: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). if ((fd = open(par->keyfile, O_RDONLY)) < 0) data/libpam-mount-2.16/src/ehd.c:187:7: [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(name, O_WRONLY); data/libpam-mount-2.16/src/ehd.c:203:7: [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(cont->path, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); data/libpam-mount-2.16/src/ehd.c:292:2: [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 cipher[32], cipher_mode[32]; data/libpam-mount-2.16/src/loop-linux.c:41:2: [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 dev[64]; data/libpam-mount-2.16/src/loop-linux.c:52: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). if ((filefd = open(filename, O_RDWR)) < 0) data/libpam-mount-2.16/src/loop-linux.c:57: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). loopfd = open(dev, (ro ? O_RDONLY : O_RDWR) | O_EXCL); data/libpam-mount-2.16/src/loop-linux.c:102: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). if ((loopfd = open(device, O_RDONLY)) < 0) data/libpam-mount-2.16/src/loop-mdvn.c:41: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). if ((fd = open("/dev/" MDCTL_NAME, O_RDWR)) < 0) data/libpam-mount-2.16/src/loop-mdvn.c:44: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 buf[64]; data/libpam-mount-2.16/src/loop-mdvn.c:69: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). if ((fd = open("/dev/" MDCTL_NAME, O_RDWR)) < 0) data/libpam-mount-2.16/src/loop-vnd.c:35:2: [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 dev[64]; data/libpam-mount-2.16/src/loop-vnd.c:39: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). loopfd = open(dev, O_RDWR | O_EXCL); data/libpam-mount-2.16/src/loop-vnd.c:72: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). if ((loopfd = open(device, O_RDWR)) < 0) data/libpam-mount-2.16/src/mount.c:359: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(d, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); data/libpam-mount-2.16/src/mount.c:545:12: [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). if ((fp = fopen(file, "r")) == NULL) { data/libpam-mount-2.16/src/mount.c:832:2: [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 buf[80]; data/libpam-mount-2.16/src/mount.c:837:12: [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). if ((fp = fopen("/proc/filesystems", "r")) == NULL) data/libpam-mount-2.16/src/mtab.c:71:2: [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 esc[5] = "\\000"; data/libpam-mount-2.16/src/mtab.c:151: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). if ((fd = open(file, O_RDWR | O_CREAT | O_APPEND, data/libpam-mount-2.16/src/mtab.c:278:12: [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). if ((fp = fopen(pmt_cmtab_file, "r")) == NULL) data/libpam-mount-2.16/src/mtab.c:285: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 *field[4]; data/libpam-mount-2.16/src/mtab.c:390:12: [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). if ((fp = fopen(file, "r+")) == NULL) data/libpam-mount-2.16/src/mtab.c:402: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 *field[4]; data/libpam-mount-2.16/src/mtab.c:418: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 buf[1024]; data/libpam-mount-2.16/src/mtab.c:475:12: [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). if ((fp = fopen(file, "r")) == NULL) data/libpam-mount-2.16/src/mtab.c:482: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 *field[4]; data/libpam-mount-2.16/src/mtcrypt.c:366:2: [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 tmp[4096]; data/libpam-mount-2.16/src/mtcrypt.c:370: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). if ((fd = open(file, O_RDONLY | O_BINARY)) < 0) { data/libpam-mount-2.16/src/mtcrypt.c:422:8: [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. const char *const fsck_args[4] = data/libpam-mount-2.16/src/mtcrypt.c:446:8: [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. const char *mount_args[8]; data/libpam-mount-2.16/src/mtcrypt.c:661:8: [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. const char *rmt_args[5]; data/libpam-mount-2.16/src/mtcrypt.c:707:12: [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). if ((fp = fopen(file, "r")) == NULL) { data/libpam-mount-2.16/src/mtcrypt.c:726:8: [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. const char *umount_args[4]; data/libpam-mount-2.16/src/pam_mount.c:244:2: [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 buf[8]; data/libpam-mount-2.16/src/pmvarrun.c:222:2: [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 filename[PATH_MAX + 1]; data/libpam-mount-2.16/src/pmvarrun.c:351: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). if ((fd = open(filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0) { data/libpam-mount-2.16/src/pmvarrun.c:417:2: [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 buf[ASCIIZ_LLX] = {}; data/libpam-mount-2.16/src/pmvarrun.c:452:2: [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 buf[ASCIIZ_LLX]; data/libpam-mount-2.16/src/rdconf1.c:64:8: [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. const char *fs, *def[11]; data/libpam-mount-2.16/src/crypto.c:424:36: [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). (par->password == NULL) ? 0 : strlen(par->password), data/libpam-mount-2.16/src/crypto.c:480:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((i_ret = read(fd, buf, sb.st_size)) != sb.st_size) { data/libpam-mount-2.16/src/crypto.c:487: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). par->d_salt = &buf[strlen("Salted__")]; data/libpam-mount-2.16/src/crypto.c:674: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). HXmc_setlen(&ret, strlen(ret)); data/libpam-mount-2.16/src/ehd.c:273: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). p = s + strlen(s); data/libpam-mount-2.16/src/ehd.c:319: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). pg->password, strlen(pg->password)); data/libpam-mount-2.16/src/ehd.c:348: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). strlen(pg->password)); data/libpam-mount-2.16/src/loop-linux.c:76:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(signed_cast(char *, info.lo_file_name), data/libpam-mount-2.16/src/misc.c:314: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). __func__, strlen(src)); data/libpam-mount-2.16/src/mount.c:646:6: [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(vpt->fs_key_cipher) > 0) { data/libpam-mount-2.16/src/mount.c:874:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(config->sig_wait); data/libpam-mount-2.16/src/mount.c:879:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(config->sig_wait); data/libpam-mount-2.16/src/mtab.c:122:18: [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). ptr = input + strlen(input); data/libpam-mount-2.16/src/mtab.c:165: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 ((ret = write(fd, line, strlen(line))) < 0) data/libpam-mount-2.16/src/mtab.c:167: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). else if (ret < strlen(line)) data/libpam-mount-2.16/src/mtab.c:177:36: [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). hxmc_t *line = HXmc_meminit(NULL, strlen(device) + data/libpam-mount-2.16/src/mtab.c:178:3: [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(mountpoint) + strlen(fstype) + strlen(options) + 8); data/libpam-mount-2.16/src/mtab.c:178: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). strlen(mountpoint) + strlen(fstype) + strlen(options) + 8); data/libpam-mount-2.16/src/mtab.c:178:41: [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(mountpoint) + strlen(fstype) + strlen(options) + 8); data/libpam-mount-2.16/src/mtab.c:207: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). line = HXmc_meminit(NULL, strlen(mt->mountpoint) + data/libpam-mount-2.16/src/mtab.c:208: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). strlen(mt->container) + strlen(loop_device) + data/libpam-mount-2.16/src/mtab.c:208: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). strlen(mt->container) + strlen(loop_device) + data/libpam-mount-2.16/src/mtab.c:209: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). strlen(crypto_device) + 5); data/libpam-mount-2.16/src/mtab.c:234: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). const char *eol = line + strlen(line); data/libpam-mount-2.16/src/mtcrypt.c:91: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 ((passthru = HXmc_meminit(NULL, strlen(copt))) == NULL) data/libpam-mount-2.16/src/mtcrypt.c:385:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ret = read(fd, tmp, sizeof(tmp))) > 0) data/libpam-mount-2.16/src/pam_mount.c:136: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). unsigned int len = strlen(data) + 1; data/libpam-mount-2.16/src/pam_mount.c:337: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 (mlock(authtok, strlen(authtok) + 1) < 0) data/libpam-mount-2.16/src/pam_mount.c:483: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 (mlock(authtok, strlen(authtok) + 1) < 0) data/libpam-mount-2.16/src/pmvarrun.c:420:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((ret = read(fd, buf, sizeof(buf))) < 0) { data/libpam-mount-2.16/src/rdconf1.c:102: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). size = strlen(pe->pw_dir) + strlen(path) + 1; data/libpam-mount-2.16/src/rdconf1.c:102: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). size = strlen(pe->pw_dir) + strlen(path) + 1; data/libpam-mount-2.16/src/rdconf1.c:609: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). ret = pcre2_match(rd, s, strlen(s), 0, 0, match_data, 0); data/libpam-mount-2.16/src/rdconf1.c:768:5: [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(s) < 1 || s[0] != '/') { data/libpam-mount-2.16/src/rdconf2.c:202: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 ((vpt->fs_key_cipher != NULL && strlen(vpt->fs_key_cipher) > 0) && data/libpam-mount-2.16/src/rdconf2.c:203:35: [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). (vpt->fs_key_path == NULL || strlen(vpt->fs_key_path) == 0)) { data/libpam-mount-2.16/src/rdconf2.c:207: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 ((vpt->fs_key_cipher == NULL || strlen(vpt->fs_key_cipher) == 0) && data/libpam-mount-2.16/src/rdconf2.c:208:35: [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). (vpt->fs_key_path != NULL && strlen(vpt->fs_key_path) > 0)) { ANALYSIS SUMMARY: Hits = 95 Lines analyzed = 8398 in approximately 0.25 seconds (33204 lines/second) Physical Source Lines of Code (SLOC) = 6032 Hits@level = [0] 137 [1] 38 [2] 45 [3] 5 [4] 3 [5] 4 Hits@level+ = [0+] 232 [1+] 95 [2+] 57 [3+] 12 [4+] 7 [5+] 4 Hits/KSLOC@level+ = [0+] 38.4615 [1+] 15.7493 [2+] 9.4496 [3+] 1.98939 [4+] 1.16048 [5+] 0.66313 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.