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/conv-tools-20160905/lib/conv-tools.h Examining data/conv-tools-20160905/bin/dirconv/dirconv.c Examining data/conv-tools-20160905/bin/mixconv/mixconv.c FINAL RESULTS: data/conv-tools-20160905/bin/dirconv/dirconv.c:71:25: [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. do { if (opt_d >= lvl) fprintf(stderr, __VA_ARGS__); } while (0) data/conv-tools-20160905/bin/dirconv/dirconv.c:289: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 + pathlen + 1, name); data/conv-tools-20160905/bin/dirconv/dirconv.c:347:6: [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, utfpath); data/conv-tools-20160905/bin/dirconv/dirconv.c:384: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. if ((realpath(path, pathbuf)) == NULL) { data/conv-tools-20160905/bin/dirconv/dirconv.c:470: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, "078dFf:hnprtuvwx:")) != -1) data/conv-tools-20160905/bin/mixconv/mixconv.c:223: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, "df:o:tv")) != -1) data/conv-tools-20160905/bin/dirconv/dirconv.c:439:26: [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. if (classify((unsigned char *)tests[i].str) == tests[i].nc) data/conv-tools-20160905/bin/mixconv/mixconv.c:81: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 convbuf[80]; /* conversion output buffer */ data/conv-tools-20160905/bin/mixconv/mixconv.c:179: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 outbuf[1024]; data/conv-tools-20160905/bin/mixconv/mixconv.c:261:18: [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 ((outfile = fopen(outname, "w")) == NULL) data/conv-tools-20160905/bin/mixconv/mixconv.c:272:18: [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 ((infile = fopen(inname, "r")) == NULL) data/conv-tools-20160905/bin/dirconv/dirconv.c:199: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). cilen = strlen(cip); data/conv-tools-20160905/bin/dirconv/dirconv.c:283:12: [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). entlen = strlen(name); data/conv-tools-20160905/bin/dirconv/dirconv.c:324: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). utflen = pathlen + 1 + strlen(utfname); data/conv-tools-20160905/bin/dirconv/dirconv.c:389:12: [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). pathlen = strlen(pathbuf); ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 855 in approximately 0.11 seconds (7854 lines/second) Physical Source Lines of Code (SLOC) = 585 Hits@level = [0] 21 [1] 4 [2] 5 [3] 3 [4] 3 [5] 0 Hits@level+ = [0+] 36 [1+] 15 [2+] 11 [3+] 6 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 61.5385 [1+] 25.641 [2+] 18.8034 [3+] 10.2564 [4+] 5.12821 [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.