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/aufs-tools-4.14+20190211/au_util.h Examining data/aufs-tools-4.14+20190211/auibusy.c Examining data/aufs-tools-4.14+20190211/aumvdown.c Examining data/aufs-tools-4.14+20190211/auplink.c Examining data/aufs-tools-4.14+20190211/br.c Examining data/aufs-tools-4.14+20190211/c2sh.c Examining data/aufs-tools-4.14+20190211/c2tmac.c Examining data/aufs-tools-4.14+20190211/extlib/glibc/au_nftw.c Examining data/aufs-tools-4.14+20190211/extlib/non-glibc/au_decode_mntpnt.c Examining data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c Examining data/aufs-tools-4.14+20190211/extlib/non-glibc/error_at_line.c Examining data/aufs-tools-4.14+20190211/extlib/non-glibc/error_at_line.h Examining data/aufs-tools-4.14+20190211/fhsm/aufhsm.c Examining data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c Examining data/aufs-tools-4.14+20190211/fhsm/comm.h Examining data/aufs-tools-4.14+20190211/fhsm/daemon.h Examining data/aufs-tools-4.14+20190211/fhsm/event.c Examining data/aufs-tools-4.14+20190211/fhsm/fhsm.c Examining data/aufs-tools-4.14+20190211/fhsm/linux-list.h Examining data/aufs-tools-4.14+20190211/fhsm/list.c Examining data/aufs-tools-4.14+20190211/fhsm/log.c Examining data/aufs-tools-4.14+20190211/fhsm/log.h Examining data/aufs-tools-4.14+20190211/fhsm/msg.c Examining data/aufs-tools-4.14+20190211/fhsm/mvdown.c Examining data/aufs-tools-4.14+20190211/fhsm/shm.c Examining data/aufs-tools-4.14+20190211/libau/libau.c Examining data/aufs-tools-4.14+20190211/libau/libau.h Examining data/aufs-tools-4.14+20190211/libau/pathconf.c Examining data/aufs-tools-4.14+20190211/libau/rdu.c Examining data/aufs-tools-4.14+20190211/libau/rdu.h Examining data/aufs-tools-4.14+20190211/libau/rdu_lib.c Examining data/aufs-tools-4.14+20190211/mng_fhsm.c Examining data/aufs-tools-4.14+20190211/mount.aufs.c Examining data/aufs-tools-4.14+20190211/mtab.c Examining data/aufs-tools-4.14+20190211/perror.c Examining data/aufs-tools-4.14+20190211/plink.c Examining data/aufs-tools-4.14+20190211/proc_mnt.c Examining data/aufs-tools-4.14+20190211/sample/logrow/logrow.c Examining data/aufs-tools-4.14+20190211/sample/uloop/drivers/block/uloop.c Examining data/aufs-tools-4.14+20190211/sample/uloop/include/linux/uloop.h Examining data/aufs-tools-4.14+20190211/sample/uloop/libuloop.c Examining data/aufs-tools-4.14+20190211/sample/uloop/ulobdev.c Examining data/aufs-tools-4.14+20190211/sample/uloop/ulohttp.c Examining data/aufs-tools-4.14+20190211/umount.aufs.c Examining data/aufs-tools-4.14+20190211/ver.c FINAL RESULTS: data/aufs-tools-4.14+20190211/extlib/glibc/au_nftw.c:72:10: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. err = chown(fname, -1, -1); data/aufs-tools-4.14+20190211/fhsm/shm.c:94:8: [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. ssz = readlink(fdpath, dir, st.st_size); data/aufs-tools-4.14+20190211/au_util.h:154:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define _Dpri(fmt, ...) printf("%s:%d:" fmt, \ data/aufs-tools-4.14+20190211/aumvdown.c:169:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, AuVersion "\n"); data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c:80:6: [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. i = snprintf(ftw, sizeof(ftw), AUPLINK_FTW_CMD " %s %s %s", data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c:84:8: [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. err = system(ftw); data/aufs-tools-4.14+20190211/extlib/non-glibc/error_at_line.c:36:2: [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. vfprintf(stderr, format, ap); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:137:2: [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(fhsmd.name[AuName_LCOPY].a, fhsmd.name[AuName_FHSMD].a); data/aufs-tools-4.14+20190211/fhsm/list.c:57:8: [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. err = access(dir, R_OK | W_OK | X_OK); data/aufs-tools-4.14+20190211/fhsm/log.h:60:4: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. syslog(level, "%s:%d: " fmt, \ data/aufs-tools-4.14+20190211/libau/libau.h:51:24: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DPri(fmt, ...) fprintf(stderr, "%s:%d: " fmt, \ data/aufs-tools-4.14+20190211/libau/rdu.c:38:3: [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(de->d_name, ent->name); data/aufs-tools-4.14+20190211/mount.aufs.c:208:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(o, str); data/aufs-tools-4.14+20190211/mount.aufs.c:215:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(o, p); data/aufs-tools-4.14+20190211/mount.aufs.c:260:2: [4] (shell) execv: 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. execv(MOUNT_CMD, av); data/aufs-tools-4.14+20190211/mount.aufs.c:334:9: [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. err = access(MTab, R_OK | W_OK); data/aufs-tools-4.14+20190211/mtab.c:165: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(pid_file, sizeof(pid_file), MTab "~.%d", getpid()); data/aufs-tools-4.14+20190211/plink.c:63:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. na.cur += sprintf(na.cur, "%s/%s", plink_dir, name) + 1; data/aufs-tools-4.14+20190211/plink.c:97:8: [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. err = access(plink_dir, F_OK); data/aufs-tools-4.14+20190211/plink.c:216:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(p, "%s/%s", brinfo[i].path, AUFS_WH_PLINKDIR); data/aufs-tools-4.14+20190211/sample/uloop/libuloop.c:41:27: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define Dbg(fmt, args...) fprintf(stderr, "%s:%d:" fmt, \ data/aufs-tools-4.14+20190211/sample/uloop/ulobdev.c:38:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define Dbg(fmt, args...) printf("%s:%d:" fmt, __func__, __LINE__, ##args) data/aufs-tools-4.14+20190211/sample/uloop/ulohttp.c:45:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define Dbg(fmt, args...) printf("%s:%d:" fmt, __func__, __LINE__, ##args) data/aufs-tools-4.14+20190211/umount.aufs.c:66:2: [4] (shell) execv: 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. execv(UMOUNT_CMD, av); data/aufs-tools-4.14+20190211/aumvdown.c:130:14: [3] (buffer) getopt_long: 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_long(argc, argv, OPTS_FORM, opts, &i)) != -1) { data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:87:8: [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. dir = getenv("AUFHSM_LIST_DIR"); data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:89:9: [3] (buffer) getopt_long: 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. opt = getopt_long(argc, argv, short_opts, opts, NULL); data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:127: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. p = realpath(dir, NULL); data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:279: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. mntpnt = realpath(argv[optind], NULL); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:68:8: [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. dir = getenv("AUFHSM_LIST_DIR"); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:70:9: [3] (buffer) getopt_long: 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. opt = getopt_long(argc, argv, short_opts, opts, NULL); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:101: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. p = realpath(dir, NULL); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:168: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. mntpnt = realpath(argv[optind], NULL); data/aufs-tools-4.14+20190211/libau/libau.c:48: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. e = getenv(LibAuEnv); data/aufs-tools-4.14+20190211/libau/rdu_lib.c:370: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. t = getenv("AUFS_RDU_BLK"); data/aufs-tools-4.14+20190211/mount.aufs.c:291: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 - 2, argv + 2, "fnvo:")) != -1) { data/aufs-tools-4.14+20190211/sample/logrow/logrow.c:147:14: [3] (buffer) getopt_long: 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_long(argc, argv, "s:h", opts, &i)) != -1) { data/aufs-tools-4.14+20190211/sample/uloop/ulobdev.c:136:16: [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 ((opt = getopt(argc, argv, "b:c:")) != -1) { data/aufs-tools-4.14+20190211/sample/uloop/ulohttp.c:266:16: [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 ((opt = getopt(argc, argv, "b:c:t:")) != -1) { data/aufs-tools-4.14+20190211/auibusy.c:61: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 a[16], *eprefix; data/aufs-tools-4.14+20190211/aumvdown.c:108:10: [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. static char a[1024]; \ data/aufs-tools-4.14+20190211/aumvdown.c:202: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(argv[i], O_RDONLY); data/aufs-tools-4.14+20190211/br.c:36: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(root, O_RDONLY /* | O_PATH */); data/aufs-tools-4.14+20190211/extlib/non-glibc/au_decode_mntpnt.c:33:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(p, "\\%03o", *src); data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c:50: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 *action, ftw[1024], tmp[] = "/tmp/auplink_ftw.XXXXXX"; data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c:53:7: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(tmp); data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:200: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(wm[i].block, wm[i - 1].block, data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:204: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(wm[i].inode, wm[i - 1].inode, data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:214: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 *av[6]; data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:260: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 name[32]; data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:283:11: [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). rootfd = open(mntpnt, O_RDONLY | O_CLOEXEC /* | O_PATH */); data/aufs-tools-4.14+20190211/fhsm/aufhsm.c:329:2: [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(sorted, brinfo, nbr * sizeof(*brinfo)); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:128:9: [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). err = open(path, O_RDONLY); data/aufs-tools-4.14+20190211/fhsm/comm.h:80: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 magic[8]; data/aufs-tools-4.14+20190211/fhsm/daemon.h:39: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 a[32]; data/aufs-tools-4.14+20190211/fhsm/fhsm.c:337:2: [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(p, fhsm, len); data/aufs-tools-4.14+20190211/fhsm/list.c:157: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(tgt, src, l); data/aufs-tools-4.14+20190211/fhsm/list.c:258: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 name[64], *dir; data/aufs-tools-4.14+20190211/fhsm/list.c:271:10: [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). dirfd = open(dir, O_RDONLY | O_PATH); data/aufs-tools-4.14+20190211/fhsm/list.c:286:2: [2] (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 string. strcpy(name + l, "-failed"); data/aufs-tools-4.14+20190211/fhsm/msg.c:61: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 a[64], *dir; data/aufs-tools-4.14+20190211/fhsm/msg.c:80: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(a, O_RDWR | O_CLOEXEC | O_NONBLOCK); data/aufs-tools-4.14+20190211/fhsm/mvdown.c:120:10: [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. s = (char *)au_errlist[mvdown.au_errno]; data/aufs-tools-4.14+20190211/fhsm/shm.c:70: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 *dir, *p, fdpath[32]; data/aufs-tools-4.14+20190211/libau/pathconf.c:63: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). err = open(path, O_RDONLY); data/aufs-tools-4.14+20190211/libau/pathconf.c:99:2: [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(parent, path, l); data/aufs-tools-4.14+20190211/libau/pathconf.c:102:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(parent, "/.."); data/aufs-tools-4.14+20190211/mount.aufs.c:149: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 a[128]; data/aufs-tools-4.14+20190211/mount.aufs.c:189:2: [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(o, src, t); data/aufs-tools-4.14+20190211/mount.aufs.c:227: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 *av[ac], **a; data/aufs-tools-4.14+20190211/mount.aufs.c:270: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 flags[LastOpt]; data/aufs-tools-4.14+20190211/mtab.c:151: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 pid_file[sizeof(MTab "~.") + 20]; data/aufs-tools-4.14+20190211/mtab.c:166: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(pid_file, O_RDWR | O_CREAT | O_EXCL, data/aufs-tools-4.14+20190211/perror.c:31:7: [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 *au_errlist[EAU_Last] = { data/aufs-tools-4.14+20190211/plink.c:156:13: [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). proc_fd = open("/proc/" AUFS_PLINK_MAINT_PATH, oflags); data/aufs-tools-4.14+20190211/plink.c:271: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 *p, si[3 + sizeof(unsigned long long) * 2 + 1]; data/aufs-tools-4.14+20190211/proc_mnt.c:75: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 a[4096 + 1024], path[PATH_MAX], *decoded; data/aufs-tools-4.14+20190211/sample/logrow/logrow.c:77: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(fname, O_WRONLY | O_APPEND); data/aufs-tools-4.14+20190211/sample/logrow/logrow.c:175: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(dev, O_RDONLY); data/aufs-tools-4.14+20190211/sample/uloop/drivers/block/uloop.c:366: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(loop_buf, raw_buf, size); data/aufs-tools-4.14+20190211/sample/uloop/include/linux/uloop.h:100: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 *path[ULO_Last]; data/aufs-tools-4.14+20190211/sample/uloop/libuloop.c:94: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(path, O_RDWR | O_CREAT, 0644); data/aufs-tools-4.14+20190211/sample/uloop/libuloop.c:118: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). err = open(dev_path, dev_flags); data/aufs-tools-4.14+20190211/sample/uloop/ulobdev.c:65:2: [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(dst, src, size); data/aufs-tools-4.14+20190211/sample/uloop/ulobdev.c:87: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). real_fd = open(real_bdev, O_RDONLY); data/aufs-tools-4.14+20190211/sample/uloop/ulohttp.c:37: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. static char range[32]; data/aufs-tools-4.14+20190211/sample/uloop/ulohttp.c:77:2: [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(arg_for_curl.p, got, real_bytes); data/aufs-tools-4.14+20190211/umount.aufs.c:33: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 *mntpnt, *av[argc + 1]; data/aufs-tools-4.14+20190211/aumvdown.c:197:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(stdin); data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c:52:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXG | S_IRWXO); data/aufs-tools-4.14+20190211/extlib/non-glibc/au_nftw.c:56:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/aufs-tools-4.14+20190211/fhsm/aufhsmd.c:139: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). memmove(p, p + 1, strlen(p)); /* including the terminator */ data/aufs-tools-4.14+20190211/fhsm/comm.h:126:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fhsm->magic, AUFHSM_MAGIC, sizeof(fhsm->magic)); data/aufs-tools-4.14+20190211/fhsm/event.c:130:1: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: data/aufs-tools-4.14+20190211/fhsm/event.c:134:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssz = read(fhsmd.fd[AuFd_FHSM], stbr, len); data/aufs-tools-4.14+20190211/fhsm/event.c:169:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; /* again */ data/aufs-tools-4.14+20190211/fhsm/event.c:194:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssz = read(fhsmd.fd[AuFd_MSG], &msg, sizeof(msg)); data/aufs-tools-4.14+20190211/fhsm/event.c:237:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssz = read(fhsmd.fd[AuFd_SIGNAL], &ssi, sizeof(ssi)); data/aufs-tools-4.14+20190211/fhsm/list.c:156: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). l = strlen(src) + 1; /* including the terminator */ data/aufs-tools-4.14+20190211/fhsm/list.c:285: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). l = strlen(name); data/aufs-tools-4.14+20190211/fhsm/list.c:373: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). l = strlen(fname->atime) + 1; /* including the terminator */ data/aufs-tools-4.14+20190211/fhsm/mvdown.c:282:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssz = read(fhsmd.fd[AuFd_SIGNAL], &ssi, sizeof(ssi)); data/aufs-tools-4.14+20190211/libau/libau.c:57: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). l = strlen(sym); data/aufs-tools-4.14+20190211/libau/pathconf.c:93: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). parent = malloc(strlen(path) + sizeof("/..")); data/aufs-tools-4.14+20190211/libau/pathconf.c:96: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). l = strlen(path); data/aufs-tools-4.14+20190211/libau/pathconf.c:118: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). p = realloc(parent, strlen(parent) + sizeof("/..")); data/aufs-tools-4.14+20190211/mount.aufs.c:161: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). p += strlen(p) + 1; data/aufs-tools-4.14+20190211/mount.aufs.c:176: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). l = strlen(src) + 1; data/aufs-tools-4.14+20190211/mount.aufs.c:203:8: [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). l += strlen(str) + 1; data/aufs-tools-4.14+20190211/mount.aufs.c:210:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(o, ","); data/aufs-tools-4.14+20190211/plink.c:54: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). l = strlen(plink_dir) + strlen(name) + 2; data/aufs-tools-4.14+20190211/plink.c:54:26: [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). l = strlen(plink_dir) + strlen(name) + 2; data/aufs-tools-4.14+20190211/plink.c:159: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). ssz = write(proc_fd, si, strlen(si)); data/aufs-tools-4.14+20190211/plink.c:160:14: [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 (ssz != strlen(si)) data/aufs-tools-4.14+20190211/plink.c:212: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). l = strlen(brinfo[i].path); data/aufs-tools-4.14+20190211/plink.c:256:14: [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). na.cur += strlen(na.cur) + 1; data/aufs-tools-4.14+20190211/plink.c:286:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(si, p, sizeof(si)); data/aufs-tools-4.14+20190211/sample/uloop/libuloop.c:128:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((void *)(loinfo64.lo_file_name), cache_path, LO_NAME_SIZE); ANALYSIS SUMMARY: Hits = 118 Lines analyzed = 8082 in approximately 0.86 seconds (9355 lines/second) Physical Source Lines of Code (SLOC) = 5867 Hits@level = [0] 44 [1] 30 [2] 49 [3] 15 [4] 22 [5] 2 Hits@level+ = [0+] 162 [1+] 118 [2+] 88 [3+] 39 [4+] 24 [5+] 2 Hits/KSLOC@level+ = [0+] 27.6121 [1+] 20.1125 [2+] 14.9991 [3+] 6.64735 [4+] 4.09068 [5+] 0.34089 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.