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/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c FINAL RESULTS: data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:90: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 (argc, argv, "M:N:G:b")) != -1) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:80:3: [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 querySeq [MAX_SEQ_LENGTH]; data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:82:3: [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 queryAcc [MAX_ACC_LENGTH]; data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:84:3: [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 alignedTemplateSeq [2 * MAX_SEQ_LENGTH]; data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:85:3: [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 alignedQuerySeq [2 * MAX_SEQ_LENGTH]; data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:93:12: [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). MATCH = atoi(optarg); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:96:15: [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). MISMATCH = atoi(optarg); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:99: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). GAP = atoi(optarg); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:175:3: [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 currSeq [MAX_SEQ_LENGTH]; data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:179:14: [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 = fopen(filename, "r")) == NULL) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:215:14: [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 = fopen(filename, "r")) == NULL) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:184:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (letter = getc(fp)) != EOF) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:192:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (letter = getc(fp)) != '\n') { ; } data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:221:18: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ( (letter = getc(fp)) != '>') { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:225:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( ((letter = getc(fp)) != EOF) && (letter != ' ' && letter != '\n')) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:233:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). letter = getc(fp); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:236:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (letter = getc(fp)) != EOF) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:249:24: [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). int querySeqLength = strlen(querySeq); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:476:33: [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). int templateAlignmentLength = strlen(templateAlignment); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:477: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). int queryAlignmentLength = strlen(queryAlignment); data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:500:19: [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). for (i = 0, j = strlen(str) - 1; i < j; i++, j--) { data/microbiomeutil-20101212+dfsg1/NAST-iEr/NAST-iEr.c:515:19: [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). for (i = 0; i < strlen(sequence); i++) { ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 628 in approximately 0.10 seconds (6096 lines/second) Physical Source Lines of Code (SLOC) = 419 Hits@level = [0] 36 [1] 11 [2] 10 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 58 [1+] 22 [2+] 11 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 138.425 [1+] 52.506 [2+] 26.253 [3+] 2.38663 [4+] 0 [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.