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/fatresize-1.1.0/fatresize.c FINAL RESULTS: data/fatresize-1.1.0/fatresize.c:98:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/fatresize-1.1.0/fatresize.c:203:5: [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(devname, dev); data/fatresize-1.1.0/fatresize.c:490:17: [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 ((opt = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) { data/fatresize-1.1.0/fatresize.c:159: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). pnum = atoi(p + 1); data/fatresize-1.1.0/fatresize.c:501:21: [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). opts.pnum = atoi(optarg); data/fatresize-1.1.0/fatresize.c:588: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(&part_geom, &part->geom, sizeof(PedGeometry)); data/fatresize-1.1.0/fatresize.c:119: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). if (strlen(suffix) == 2 && suffix[1] == 'i') { data/fatresize-1.1.0/fatresize.c:121: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). } else if (strlen(suffix) > 1) { data/fatresize-1.1.0/fatresize.c:154: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). p = dev + strlen(dev) - 1; data/fatresize-1.1.0/fatresize.c:186: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). len = strlen(dev); data/fatresize-1.1.0/fatresize.c:193:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(devname, dev, p - dev + 1); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 721 in approximately 0.41 seconds (1777 lines/second) Physical Source Lines of Code (SLOC) = 564 Hits@level = [0] 18 [1] 5 [2] 3 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 29 [1+] 11 [2+] 6 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 51.4184 [1+] 19.5035 [2+] 10.6383 [3+] 5.31915 [4+] 3.5461 [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.