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/cconv-0.6.2/cconv.c Examining data/cconv-0.6.2/unicode.h Examining data/cconv-0.6.2/cconv_table.h Examining data/cconv-0.6.2/cconv_table.cc Examining data/cconv-0.6.2/main.c Examining data/cconv-0.6.2/unicode.c Examining data/cconv-0.6.2/cconv.h FINAL RESULTS: data/cconv-0.6.2/main.c:173:34: [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(fp_in == NULL && argc > 1 && access(argv[argc - 1], R_OK) == 0) data/cconv-0.6.2/main.c:134:15: [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 ((ch = getopt(argc, argv, "f:t:i:o:l?hv")) != -1) { data/cconv-0.6.2/cconv.c:37: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 options[16]; data/cconv-0.6.2/cconv.c:91: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 code[8] = {0, }; data/cconv-0.6.2/cconv.c:369:4: [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(ps_outbuf, map_val(m, index), o_proc); data/cconv-0.6.2/cconv.c:384: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(ps_outbuf, ps_inbuf, i_proc); data/cconv-0.6.2/cconv.c:515: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, mc, size); data/cconv-0.6.2/main.c:143:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((fp_in = fopen(optarg, "r")) == NULL) data/cconv-0.6.2/main.c:150:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((fp_out = fopen(optarg, "w")) == NULL) data/cconv-0.6.2/main.c:175: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). if((fp_in = fopen(argv[argc - 1], "r")) == NULL) data/cconv-0.6.2/cconv.c:105:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cd->options, ptr , 16); data/cconv-0.6.2/cconv.c:106:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(code , fromcode, ptr - fromcode); data/cconv-0.6.2/cconv.c:204:13: [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). o_proc = strlen(ps_midbuf); \ data/cconv-0.6.2/cconv.c:368:13: [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). o_proc = strlen(map_val(m, index)); data/cconv-0.6.2/cconv.c:418:49: [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(!match_cond(cond_ptr(m, location), inbytes, strlen(map_key(m, location)), whence)) data/cconv-0.6.2/cconv.c:442:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(width == strlen(m[middle].key)) data/cconv-0.6.2/cconv.c:455:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(wwidth == strlen(m[offset].key)) data/cconv-0.6.2/cconv.c:513:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = strlen(mc); data/cconv-0.6.2/cconv.c:521:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if((head == 1 && whence >= strlen(m_one) && data/cconv-0.6.2/cconv.c:522: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). memcmp(str - strlen(m_one), m_one, strlen(m_one)) == 0) data/cconv-0.6.2/cconv.c:522:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcmp(str - strlen(m_one), m_one, strlen(m_one)) == 0) data/cconv-0.6.2/cconv.c:523: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). ||(head == 0 && strlen(str) >= strlen(m_one) && data/cconv-0.6.2/cconv.c:523: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). ||(head == 0 && strlen(str) >= strlen(m_one) && data/cconv-0.6.2/cconv.c:524: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). memcmp(str, m_one, strlen(m_one)) == 0) data/cconv-0.6.2/main.c:202:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). inlen = strlen(ps_inbuf); data/cconv-0.6.2/main.c:210: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). ps_inbuf = inbuf + strlen(inbuf); data/cconv-0.6.2/main.c:212:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i_left = inbuf_size - strlen(inbuf); data/cconv-0.6.2/main.c:218: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). inlen = strlen(inbuf); ANALYSIS SUMMARY: Hits = 28 Lines analyzed = 14780 in approximately 1.02 seconds (14440 lines/second) Physical Source Lines of Code (SLOC) = 14449 Hits@level = [0] 36 [1] 18 [2] 8 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 64 [1+] 28 [2+] 10 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 4.42937 [1+] 1.93785 [2+] 0.692089 [3+] 0.138418 [4+] 0.0692089 [5+] 0 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.