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/fdutils-5.5-20060227/doc/texi-linearize.c Examining data/fdutils-5.5-20060227/src/measure.c Examining data/fdutils-5.5-20060227/src/skews.c Examining data/fdutils-5.5-20060227/src/getfdprm.c Examining data/fdutils-5.5-20060227/src/convert.c Examining data/fdutils-5.5-20060227/src/fdutils.h Examining data/fdutils-5.5-20060227/src/driveprmP.h Examining data/fdutils-5.5-20060227/src/misc.c Examining data/fdutils-5.5-20060227/src/mediaprm.c Examining data/fdutils-5.5-20060227/src/mediaprm.h Examining data/fdutils-5.5-20060227/src/mediaprmP.h Examining data/fdutils-5.5-20060227/src/oldfdprm.c Examining data/fdutils-5.5-20060227/src/oldfdprm.h Examining data/fdutils-5.5-20060227/src/calc-format.c Examining data/fdutils-5.5-20060227/src/msdos_fs.h Examining data/fdutils-5.5-20060227/src/parse.c Examining data/fdutils-5.5-20060227/src/parse.h Examining data/fdutils-5.5-20060227/src/driveprm.h Examining data/fdutils-5.5-20060227/src/fdrawcmd.c Examining data/fdutils-5.5-20060227/src/printfdprm.c Examining data/fdutils-5.5-20060227/src/printfdprm.h Examining data/fdutils-5.5-20060227/src/ext2-stuff.h Examining data/fdutils-5.5-20060227/src/enh_options.c Examining data/fdutils-5.5-20060227/src/setfdprm.c Examining data/fdutils-5.5-20060227/src/enh_options.h Examining data/fdutils-5.5-20060227/src/diskd.c Examining data/fdutils-5.5-20060227/src/floppycontrol.c Examining data/fdutils-5.5-20060227/src/fdmount.c Examining data/fdutils-5.5-20060227/src/driveprm.c Examining data/fdutils-5.5-20060227/src/superformat.c Examining data/fdutils-5.5-20060227/src/xdfcopy.c Examining data/fdutils-5.5-20060227/src/diskseekd.c Examining data/fdutils-5.5-20060227/src/floppymeter.c Examining data/fdutils-5.5-20060227/src/superformat.h FINAL RESULTS: data/fdutils-5.5-20060227/src/fdmount.c:787:4: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. e=chown(mountpoint,ruid,rgid); data/fdutils-5.5-20060227/src/fdmount.c:791:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. e=chmod(mountpoint,~_umask & 0777); data/fdutils-5.5-20060227/src/fdmount.c:869:5: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(mountpoint,0,0); /* back to root */ data/fdutils-5.5-20060227/src/fdmount.c:870:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(mountpoint,0700); /* no public permissions */ data/fdutils-5.5-20060227/doc/texi-linearize.c:11: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(path, directory); data/fdutils-5.5-20060227/doc/texi-linearize.c:13:2: [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(path, file); data/fdutils-5.5-20060227/src/convert.c:29: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(buffer, 49, fmt, param); data/fdutils-5.5-20060227/src/diskd.c:108:3: [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. system(command); data/fdutils-5.5-20060227/src/enh_options.c:400:3: [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. printf(format, eo[i].longo); data/fdutils-5.5-20060227/src/fdmount.c:109:5: [4] (format) vsnprintf: 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. vsnprintf(buff,139,text,p); data/fdutils-5.5-20060227/src/fdmount.c:122:5: [4] (format) vsnprintf: 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. vsnprintf(buff,139,text,p); data/fdutils-5.5-20060227/src/fdmount.c:136:5: [4] (format) vsnprintf: 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. vsnprintf(buff,139,text,p); data/fdutils-5.5-20060227/src/fdmount.c:583:24: [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. if (!is_default && access(dir,W_OK)!=0) { data/fdutils-5.5-20060227/src/fdmount.c:616:1: [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(options+strlen(options), MAX_OPT - strlen(options)-1, \ data/fdutils-5.5-20060227/src/fdmount.c:640: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. if (access(devname,R_OK)!=0) data/fdutils-5.5-20060227/src/fdmount.c:643:31: [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. if (!(flags&MS_RDONLY) && access(devname,W_OK)!=0) data/fdutils-5.5-20060227/src/fdmount.c:751:5: [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(options,(flags&MS_RDONLY) ? "ro" : "rw"); data/fdutils-5.5-20060227/src/fdmount.c:752:5: [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(options,(flags&MS_NOSUID) ? ",nosuid" : ""); data/fdutils-5.5-20060227/src/fdmount.c:753:5: [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(options,(flags&MS_NODEV) ? ",nodev" : ""); data/fdutils-5.5-20060227/src/fdmount.c:754:5: [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(options,(flags&MS_NOEXEC) ? ",noexec" : ""); data/fdutils-5.5-20060227/src/fdmount.c:755:5: [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(options,(flags&MS_SYNCHRONOUS) ? ",sync" : ""); data/fdutils-5.5-20060227/src/fdmount.c:762:2: [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(options, ext2_options); data/fdutils-5.5-20060227/src/fdmount.c:765:2: [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(options, dos_options); data/fdutils-5.5-20060227/src/fdmount.c:895:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(devname,DEVICE_PATTERN,i); data/fdutils-5.5-20060227/src/fdmount.c:1207:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(dr,NAME_PATTERN,i); data/fdutils-5.5-20060227/src/fdmount.c:1209:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(devname,DEVICE_PATTERN,i); data/fdutils-5.5-20060227/src/fdmount.c:1210:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(def_mountpoint,DEFAULT_DIR_PATTERN,i); data/fdutils-5.5-20060227/src/getfdprm.c:25:3: [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. printf(fmt, value); data/fdutils-5.5-20060227/src/oldfdprm.c:73:7: [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 (sscanf(start,"%s %s %s %s %s %s %s %s %s %s",this,param[0], data/fdutils-5.5-20060227/src/superformat.c:1140:6: [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. if(system(command_buffer)){ data/fdutils-5.5-20060227/src/superformat.c:1201:6: [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. if(system(command_buffer)){ data/fdutils-5.5-20060227/src/xdfcopy.c:764:6: [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. system(cmdbuffer); data/fdutils-5.5-20060227/src/xdfcopy.c:767:6: [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. system(cmdbuffer); data/fdutils-5.5-20060227/src/xdfcopy.c:769:11: [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. fp = popen(cmdbuffer, "w"); data/fdutils-5.5-20060227/src/diskseekd.c:99:19: [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. pidfilename = getenv("DISKSEEKDPIDFILE"); data/fdutils-5.5-20060227/src/enh_options.c:493:8: [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. ch = getopt_long (argc, argv, my_shortopts, my_longopts, data/fdutils-5.5-20060227/src/fdmount.c:1139:4: [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. c=getopt_long(argc,argv,"rsfldi:hp:o:v",longopt,&optidx); data/fdutils-5.5-20060227/src/fdrawcmd.c:167:10: [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("length") ) || (s = getenv("LENGTH")) ) { data/fdutils-5.5-20060227/src/fdrawcmd.c:167:37: [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("length") ) || (s = getenv("LENGTH")) ) { data/fdutils-5.5-20060227/src/fdrawcmd.c:181: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("rate") ) || (s = getenv("RATE")) ) data/fdutils-5.5-20060227/src/fdrawcmd.c:181:36: [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("rate") ) || (s = getenv("RATE")) ) data/fdutils-5.5-20060227/src/fdrawcmd.c:184: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("track")) || (s = getenv("TRACK")) || data/fdutils-5.5-20060227/src/fdrawcmd.c:184:36: [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("track")) || (s = getenv("TRACK")) || data/fdutils-5.5-20060227/src/fdrawcmd.c:185: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. (s = getenv("cylinder")) || (s = getenv("CYLINDER"))) { data/fdutils-5.5-20060227/src/fdrawcmd.c:185:36: [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. (s = getenv("cylinder")) || (s = getenv("CYLINDER"))) { data/fdutils-5.5-20060227/src/fdrawcmd.c:190: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("drive") ) || (s = getenv("DRIVE")) ) data/fdutils-5.5-20060227/src/fdrawcmd.c:190:37: [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("drive") ) || (s = getenv("DRIVE")) ) data/fdutils-5.5-20060227/src/xdfcopy.c:584:17: [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, argv, "T:t:h:dnD:01234")) != EOF) { data/fdutils-5.5-20060227/doc/texi-linearize.c:8: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[8192]; data/fdutils-5.5-20060227/doc/texi-linearize.c:15:5: [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). r= fopen(path, "r"); data/fdutils-5.5-20060227/doc/texi-linearize.c:28: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 line[4096]; data/fdutils-5.5-20060227/src/convert.c:26: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 buffer[50]; data/fdutils-5.5-20060227/src/diskd.c:28: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 procFd[80]; data/fdutils-5.5-20060227/src/diskd.c:40: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). fd2=open(procFd, 3 | O_NDELAY); data/fdutils-5.5-20060227/src/diskd.c:90: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/fd0", 3 | O_NDELAY); data/fdutils-5.5-20060227/src/diskd.c:97:2: [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(procFd, "/proc/self/fd/%d", fd); data/fdutils-5.5-20060227/src/diskseekd.c:101:15: [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). pidfile = fopen(pidfilename, "w"); data/fdutils-5.5-20060227/src/diskseekd.c:112:6: [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(drive_name, O_ACCMODE | O_EXCL); data/fdutils-5.5-20060227/src/driveprm.c:173:15: [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). driveprmin = fopen(DRIVEPRMFILE, "r"); data/fdutils-5.5-20060227/src/enh_options.c:225: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). number = open(name, flags, 0644 ); data/fdutils-5.5-20060227/src/enh_options.c:390: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 format[20]; data/fdutils-5.5-20060227/src/ext2-stuff.h:69: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 s_volume_name[16]; /* volume name */ data/fdutils-5.5-20060227/src/ext2-stuff.h: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 s_last_mounted[64]; /* directory where last mounted */ data/fdutils-5.5-20060227/src/fdmount.c:93:1: [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 curdev[100] = ""; data/fdutils-5.5-20060227/src/fdmount.c:103:1: [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 *fsnames[7] = {"???","minix", "msdos", "vfat", "ext2","ext","xia"}; data/fdutils-5.5-20060227/src/fdmount.c:106:5: [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[140]; data/fdutils-5.5-20060227/src/fdmount.c:119:5: [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[140]; data/fdutils-5.5-20060227/src/fdmount.c:133:5: [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[140]; data/fdutils-5.5-20060227/src/fdmount.c:296: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(&mm->ms,ent,sizeof(struct mntent)); data/fdutils-5.5-20060227/src/fdmount.c:358:14: [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(lock_filename, O_WRONLY | O_CREAT | O_EXCL, 0744)) < 0) { data/fdutils-5.5-20060227/src/fdmount.c:384:5: [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 drive_name[17]; data/fdutils-5.5-20060227/src/fdmount.c:388: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(devname,O_RDONLY | O_NDELAY); data/fdutils-5.5-20060227/src/fdmount.c:401:7: [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). type=atoi(drive_name+1); data/fdutils-5.5-20060227/src/fdmount.c:620:1: [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 dos_options[MAX_OPT]; data/fdutils-5.5-20060227/src/fdmount.c:621:1: [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 ext2_options[MAX_OPT]; data/fdutils-5.5-20060227/src/fdmount.c:633:5: [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 options[80+MAX_OPT]; data/fdutils-5.5-20060227/src/fdmount.c:634:5: [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 super[2048]; data/fdutils-5.5-20060227/src/fdmount.c:666: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(devname,O_RDONLY); data/fdutils-5.5-20060227/src/fdmount.c:846:13: [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). fuid = atoi(uidstr+5); data/fdutils-5.5-20060227/src/fdmount.c:850:10: [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). fuid = atoi(uidstr+8); data/fdutils-5.5-20060227/src/fdmount.c:886:5: [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 devname[10]; data/fdutils-5.5-20060227/src/fdmount.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(devname,O_RDONLY|O_NDELAY); data/fdutils-5.5-20060227/src/fdmount.c:1005: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). fp=fopen(name, "w"); data/fdutils-5.5-20060227/src/fdmount.c:1162:19: [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). opt_interval=atoi(optarg); data/fdutils-5.5-20060227/src/fdmount.c:1206: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 dr[8]; data/fdutils-5.5-20060227/src/fdrawcmd.c:153: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 buffer[ 512 * 2 * 24 ]; data/fdutils-5.5-20060227/src/fdrawcmd.c:350: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). fd = open( drive, O_ACCMODE | O_NDELAY); data/fdutils-5.5-20060227/src/floppycontrol.c:267: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 drivtyp[17]; data/fdutils-5.5-20060227/src/floppycontrol.c:287: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). fd = open(argv[optind], 3 | O_NDELAY); data/fdutils-5.5-20060227/src/floppycontrol.c:289: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). fd = open("/dev/fd0", 3 | O_NDELAY); data/fdutils-5.5-20060227/src/floppymeter.c:149: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, 3 | O_NDELAY); data/fdutils-5.5-20060227/src/getfdprm.c:63:5: [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,3); data/fdutils-5.5-20060227/src/getfdprm.c:65:6: [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_RDONLY); data/fdutils-5.5-20060227/src/measure.c:45: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 buffer[32*1024]; data/fdutils-5.5-20060227/src/mediaprm.c:263:15: [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). mediaprmin = fopen(MEDIAPRMFILE, "r"); data/fdutils-5.5-20060227/src/msdos_fs.h:9: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 jump[3] p; /* 0 - Boot strap short or near jump */ data/fdutils-5.5-20060227/src/msdos_fs.h:10: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 banner[8] p; /* 3 - Name - can be used to special case data/fdutils-5.5-20060227/src/msdos_fs.h:28: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 label[11] p; /* 43 disk label */ data/fdutils-5.5-20060227/src/msdos_fs.h:29: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 fat_type[8] p; /* 54 FAT type */ data/fdutils-5.5-20060227/src/msdos_fs.h:41: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 junk[126 - 76] p; /* 76 remaining data */ data/fdutils-5.5-20060227/src/msdos_fs.h:43: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 junk[126 - 62] p; /* 76 remaining data */ data/fdutils-5.5-20060227/src/oldfdprm.c:52: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 line[MAXLINE+2],this[MAXLINE+2],param[9][MAXLINE+2]; data/fdutils-5.5-20060227/src/oldfdprm.c:53: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 *params[9],*start; data/fdutils-5.5-20060227/src/oldfdprm.c:101:13: [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 ((f = fopen(FDPRMFILE,"r")) == NULL) data/fdutils-5.5-20060227/src/setfdprm.c:60: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(argv[0],3)) < 0) { /* 3 == no access at all */ data/fdutils-5.5-20060227/src/superformat.c:78:1: [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 floppy_buffer[24 * 512]; data/fdutils-5.5-20060227/src/superformat.c:93:1: [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 *error_msg[22]={ data/fdutils-5.5-20060227/src/superformat.c:508: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 env_buffer[10]; data/fdutils-5.5-20060227/src/superformat.c:513: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 drivename[15]; data/fdutils-5.5-20060227/src/superformat.c:529: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 command_buffer[80]; data/fdutils-5.5-20060227/src/superformat.c:530: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 twom_buffer[6]; data/fdutils-5.5-20060227/src/superformat.c:743:14: [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[0].fd = open(fd[0].name, O_RDWR | O_NDELAY | O_EXCL); data/fdutils-5.5-20060227/src/superformat.c:1157:14: [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[0].fd = open ( fd[0].name, O_RDONLY); data/fdutils-5.5-20060227/src/xdfcopy.c:28:1: [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 *error_msg[22]={ data/fdutils-5.5-20060227/src/xdfcopy.c:574:5: [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 buffer[TRACKSIZE]; data/fdutils-5.5-20060227/src/xdfcopy.c:575:5: [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 cmdbuffer[80]; data/fdutils-5.5-20060227/src/xdfcopy.c:634: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). sfd = open( sourcename, O_RDONLY | O_NDELAY); data/fdutils-5.5-20060227/src/xdfcopy.c:643: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). tfd = open(targetname, O_WRONLY | O_CREAT | O_TRUNC | O_NDELAY, 0666); data/fdutils-5.5-20060227/doc/texi-linearize.c:12:2: [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(path,"/"); data/fdutils-5.5-20060227/doc/texi-linearize.c:43:10: [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[strlen(line)-1]='\0'; data/fdutils-5.5-20060227/src/convert.c:30: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(buffer); data/fdutils-5.5-20060227/src/enh_options.c:268:10: [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). wl = strlen(eo[i].longo); data/fdutils-5.5-20060227/src/enh_options.c:287: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). for(i=strlen(eo->longo); i<wordlength; i++) data/fdutils-5.5-20060227/src/fdmount.c:190:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (canonical, path, sizeof(canonical)-1); data/fdutils-5.5-20060227/src/fdmount.c:196:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(canonical, path, sizeof(canonical)-1); data/fdutils-5.5-20060227/src/fdmount.c:211: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). p = canonical + strlen (canonical) - 1; data/fdutils-5.5-20060227/src/fdmount.c:616: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). snprintf(options+strlen(options), MAX_OPT - strlen(options)-1, \ data/fdutils-5.5-20060227/src/fdmount.c:616: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). snprintf(options+strlen(options), MAX_OPT - strlen(options)-1, \ data/fdutils-5.5-20060227/src/fdmount.c:637:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(curdev,devname, sizeof(curdev)); data/fdutils-5.5-20060227/src/fdmount.c:674:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd,super,sizeof(super)); data/fdutils-5.5-20060227/src/fdmount.c:825:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(curdev,devname, sizeof(curdev)); data/fdutils-5.5-20060227/src/fdmount.c:921:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(curdev,devname, sizeof(curdev)); data/fdutils-5.5-20060227/src/fdmount.c:942: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(interval*100000); data/fdutils-5.5-20060227/src/fdmount.c:1027: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(!strncmp(*allopts, new, strlen(*allopts))) { data/fdutils-5.5-20060227/src/fdmount.c:1031:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(optlist + *offset, new, l); data/fdutils-5.5-20060227/src/fdmount.c:1046: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). dos_off = strlen(dos_options); data/fdutils-5.5-20060227/src/fdmount.c:1047: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). ext2_off = strlen(ext2_options); data/fdutils-5.5-20060227/src/fdmount.c:1055:10: [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(opts); data/fdutils-5.5-20060227/src/fdmount.c:1132:14: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). _umask = umask(0); data/fdutils-5.5-20060227/src/fdmount.c:1133:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(_umask); data/fdutils-5.5-20060227/src/fdrawcmd.c:327:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tmp=read(0, buffer+size, raw_cmd.length - size ); data/fdutils-5.5-20060227/src/floppymeter.c:158:5: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c=getchar(); data/fdutils-5.5-20060227/src/superformat.c:215:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n=read(fd->fd, data, m); data/fdutils-5.5-20060227/src/superformat.c:1179:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd[0].fd,verify_buffer,rsize); data/fdutils-5.5-20060227/src/xdfcopy.c:658:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(sfd, buffer, 512); data/fdutils-5.5-20060227/src/xdfcopy.c:698:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(sfd, buffer, fmt->sect_per_track_any*1024); data/fdutils-5.5-20060227/src/xdfcopy.c:771: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). fwrite(readme, strlen(readme), 1, fp); ANALYSIS SUMMARY: Hits = 147 Lines analyzed = 7736 in approximately 0.26 seconds (30153 lines/second) Physical Source Lines of Code (SLOC) = 6296 Hits@level = [0] 299 [1] 29 [2] 70 [3] 14 [4] 30 [5] 4 Hits@level+ = [0+] 446 [1+] 147 [2+] 118 [3+] 48 [4+] 34 [5+] 4 Hits/KSLOC@level+ = [0+] 70.8386 [1+] 23.3482 [2+] 18.7421 [3+] 7.62389 [4+] 5.40025 [5+] 0.635324 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.