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/lrcalc-1.2/src/vectarg.c Examining data/lrcalc-1.2/src/list.c Examining data/lrcalc-1.2/src/hashtab.c Examining data/lrcalc-1.2/src/alloc.h Examining data/lrcalc-1.2/src/lincomb.h Examining data/lrcalc-1.2/src/schublib.c Examining data/lrcalc-1.2/src/vectarg.h Examining data/lrcalc-1.2/src/claim.h Examining data/lrcalc-1.2/src/vector.c Examining data/lrcalc-1.2/src/vector.h Examining data/lrcalc-1.2/src/salloc.c Examining data/lrcalc-1.2/src/alloc.c Examining data/lrcalc-1.2/src/maple.h Examining data/lrcalc-1.2/src/list.h Examining data/lrcalc-1.2/src/hashtab.h Examining data/lrcalc-1.2/src/set.c Examining data/lrcalc-1.2/src/lincomb.c Examining data/lrcalc-1.2/src/set.h Examining data/lrcalc-1.2/src/schubmult.c Examining data/lrcalc-1.2/src/lrcalc.c Examining data/lrcalc-1.2/src/maple.c Examining data/lrcalc-1.2/src/schublib.h Examining data/lrcalc-1.2/src/symfcn.c Examining data/lrcalc-1.2/src/symfcn.h FINAL RESULTS: data/lrcalc-1.2/src/lrcalc.c:31:3: [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. fprintf(stderr, MULT_USAGE); data/lrcalc-1.2/src/lrcalc.c:32:3: [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. fprintf(stderr, SKEW_USAGE); data/lrcalc-1.2/src/lrcalc.c:33:3: [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. fprintf(stderr, COPROD_USAGE); data/lrcalc-1.2/src/lrcalc.c:34:3: [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. fprintf(stderr, LRCOEF_USAGE); data/lrcalc-1.2/src/lrcalc.c:35:3: [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. fprintf(stderr, LRTAB_USAGE); data/lrcalc-1.2/src/lrcalc.c:42:3: [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. fprintf(stderr, "Usage: " MULT_USAGE); data/lrcalc-1.2/src/lrcalc.c:161:3: [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. fprintf(stderr, "Usage: " SKEW_USAGE); data/lrcalc-1.2/src/lrcalc.c:210:3: [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. fprintf(stderr, "Usage: " COPROD_USAGE); data/lrcalc-1.2/src/lrcalc.c:254:3: [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. fprintf(stderr, "Usage: " LRCOEF_USAGE); data/lrcalc-1.2/src/lrcalc.c:283:3: [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. fprintf(stderr, "Usage: " LRTAB_USAGE); data/lrcalc-1.2/src/vector.c:165:5: [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(i == 0 ? "%d" : ", %d", v_elem(v, i)); data/lrcalc-1.2/src/lrcalc.c:59: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 ((c = getopt(ac, av, "mzr:q:f:")) != EOF) data/lrcalc-1.2/src/lrcalc.c:173: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 ((c = getopt(ac, av, "mr:")) != EOF) data/lrcalc-1.2/src/lrcalc.c:226: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 ((c = getopt(ac, av, "a")) != EOF) data/lrcalc-1.2/src/lrcalc.c:330: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 ((c = getopt(ac, av, "mr:")) != EOF) data/lrcalc-1.2/src/schubmult.c:39: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 ((c = getopt(ac, av, "mr:")) != EOF) data/lrcalc-1.2/src/lrcalc.c:69: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). opt_rows = atoi(optarg); data/lrcalc-1.2/src/lrcalc.c:82: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). opt_cols = atoi(p + 1); data/lrcalc-1.2/src/lrcalc.c:113:4: [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 symbol[15]; data/lrcalc-1.2/src/lrcalc.c:114:4: [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(symbol, "q^%d*s", i); data/lrcalc-1.2/src/lrcalc.c:180: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). opt_rows = atoi(optarg); data/lrcalc-1.2/src/lrcalc.c:334: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). opt_rows = atoi(optarg); data/lrcalc-1.2/src/schubmult.c:46:9: [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). rank = atoi(optarg); data/lrcalc-1.2/src/vector.h:23:9: [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((d)->array, (v)->array, (d)->length * sizeof(int)) ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 4005 in approximately 0.15 seconds (27237 lines/second) Physical Source Lines of Code (SLOC) = 3092 Hits@level = [0] 25 [1] 0 [2] 8 [3] 5 [4] 11 [5] 0 Hits@level+ = [0+] 49 [1+] 24 [2+] 24 [3+] 16 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 15.8473 [1+] 7.76197 [2+] 7.76197 [3+] 5.17464 [4+] 3.55757 [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.