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/array-info-0.16/array_plugin.c Examining data/array-info-0.16/array_utils.c Examining data/array-info-0.16/include/array_plugin.h Examining data/array-info-0.16/include/array_info.h Examining data/array-info-0.16/lib/array_plugin_api.c Examining data/array-info-0.16/linuxheaders/linux/cciss_ioctl.h Examining data/array-info-0.16/linuxheaders/cpqarray.h Examining data/array-info-0.16/linuxheaders/ida_cmd.h Examining data/array-info-0.16/linuxheaders/ida_ioctl.h Examining data/array-info-0.16/main.c Examining data/array-info-0.16/plugins/cciss_cmd.c Examining data/array-info-0.16/plugins/cciss_info.c Examining data/array-info-0.16/plugins/cciss_info.h Examining data/array-info-0.16/plugins/compaq_data.h Examining data/array-info-0.16/plugins/compaq_info.h Examining data/array-info-0.16/plugins/ida_cmd.c Examining data/array-info-0.16/plugins/ida_info.c Examining data/array-info-0.16/plugins/ida_info.h Examining data/array-info-0.16/plugins/md_cmd.c Examining data/array-info-0.16/plugins/md_data.h Examining data/array-info-0.16/plugins/md_info.c Examining data/array-info-0.16/plugins/md_info.h Examining data/array-info-0.16/plugins/compaq_info.c FINAL RESULTS: data/array-info-0.16/array_plugin.c:110: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(path, so_path); data/array-info-0.16/array_plugin.c:112: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(path, dir_ent->d_name); data/array-info-0.16/lib/array_plugin_api.c:69:12: [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. if ((nb = vsnprintf(final_str, 80, string, ap)) > 80) { data/array-info-0.16/lib/array_plugin_api.c:72:3: [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(final_str, nb, string, ap); data/array-info-0.16/linuxheaders/cpqarray.h:74: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. struct access_method *access; data/array-info-0.16/linuxheaders/cpqarray.h:106:23: [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. struct access_method access; data/array-info-0.16/main.c:123: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. getopt_long(argc, argv, "d:alAscL0:1Vh", long_options, data/array-info-0.16/array_utils.c:49: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(device_path, O_RDONLY)) < 0) data/array-info-0.16/linuxheaders/cpqarray.h:79: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 devname[8]; data/array-info-0.16/linuxheaders/cpqarray.h:85: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 firm_rev[4]; data/array-info-0.16/linuxheaders/ida_ioctl.h:78:12: [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 buf[1024]; data/array-info-0.16/linuxheaders/linux/cciss_ioctl.h:24:9: [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. typedef char NodeName_type[16]; data/array-info-0.16/linuxheaders/linux/cciss_ioctl.h:34:9: [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. typedef char FirmwareVer_type[4]; data/array-info-0.16/plugins/cciss_info.c:100: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(ctrl_data->ctrl.firm_rev, ctrl_info.firm_rev, 4); data/array-info-0.16/plugins/cciss_info.c:101: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(ctrl_data->ctrl.rom_rev, ctrl_info.rom_rev, 4); data/array-info-0.16/plugins/cciss_info.c:153:9: [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 description[35]; data/array-info-0.16/plugins/compaq_info.c:134:9: [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 unknownstr[512]; data/array-info-0.16/plugins/ida_info.c:98: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(ctrl_data->ctrl.firm_rev, ctrl_info->firm_rev, 4); data/array-info-0.16/plugins/ida_info.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(ctrl_data->ctrl.rom_rev, ctrl_info->rom_rev, 4); data/array-info-0.16/plugins/ida_info.c:139:9: [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 description[35]; data/array-info-0.16/plugins/md_info.c:108:9: [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 description[35]; data/array-info-0.16/array_plugin.c:107: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). (dir_ent->d_name + strlen(dir_ent->d_name) - 3, ".so")) data/array-info-0.16/array_plugin.c:109: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). path = malloc(strlen(so_path) + strlen(dir_ent->d_name) + 2); data/array-info-0.16/array_plugin.c:109: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). path = malloc(strlen(so_path) + strlen(dir_ent->d_name) + 2); data/array-info-0.16/array_plugin.c:111:3: [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, "/"); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 3234 in approximately 0.12 seconds (27624 lines/second) Physical Source Lines of Code (SLOC) = 2056 Hits@level = [0] 24 [1] 4 [2] 14 [3] 1 [4] 6 [5] 0 Hits@level+ = [0+] 49 [1+] 25 [2+] 21 [3+] 7 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 23.8327 [1+] 12.1595 [2+] 10.214 [3+] 3.40467 [4+] 2.91829 [5+] 0 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.