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/sloccount-2.26/c_count.c Examining data/sloccount-2.26/driver.c Examining data/sloccount-2.26/driver.h Examining data/sloccount-2.26/lexcount1.c Examining data/sloccount-2.26/ml_count.c Examining data/sloccount-2.26/php_count.c Examining data/sloccount-2.26/stripccomments.c Examining data/sloccount-2.26/testcode/temp.c Examining data/sloccount-2.26/jsp_count.c Examining data/sloccount-2.26/pascal_count.c FINAL RESULTS: data/sloccount-2.26/c_count.c:164:12: [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). stream = fopen(filename, "r"); data/sloccount-2.26/c_count.c:178: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 buffer[10000]; data/sloccount-2.26/c_count.c:210: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). file_list = fopen(argv[2], "r"); data/sloccount-2.26/driver.c:50:12: [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). stream = fopen(current_filename, "r"); data/sloccount-2.26/driver.c:67: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 buffer[10000]; data/sloccount-2.26/driver.c:96: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). file_list = fopen(argv[2], "r"); data/sloccount-2.26/ml_count.c:148:12: [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). stream = fopen(filename, "r"); data/sloccount-2.26/ml_count.c:162: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 buffer[10000]; data/sloccount-2.26/ml_count.c:194: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). file_list = fopen(argv[2], "r"); data/sloccount-2.26/php_count.c:67:8: [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. static char current_line[LONGEST_LINE]; data/sloccount-2.26/php_count.c:272:12: [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). stream = fopen(filename, "r"); data/sloccount-2.26/php_count.c:287: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 buffer[10000]; data/sloccount-2.26/php_count.c:320: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). file_list = fopen(argv[2], "r"); data/sloccount-2.26/c_count.c:60:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(stream); data/sloccount-2.26/c_count.c:77:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(stream); data/sloccount-2.26/c_count.c:184: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). newlinepos = buffer + strlen(buffer) - 1; data/sloccount-2.26/driver.c:73: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). newlinepos = buffer + strlen(buffer) - 1; data/sloccount-2.26/jsp_count.c:733:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/sloccount-2.26/jsp_count.c:1718: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). return yy_scan_bytes(yy_str,strlen(yy_str) ); data/sloccount-2.26/lexcount1.c:33:10: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getchar(); data/sloccount-2.26/lexcount1.c:44:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (c = getchar()) != EOF) { data/sloccount-2.26/lexcount1.c:50:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c= getchar(); c=getchar(); incomment=0; data/sloccount-2.26/lexcount1.c:50:28: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c= getchar(); c=getchar(); incomment=0; data/sloccount-2.26/ml_count.c:48:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(stream); data/sloccount-2.26/ml_count.c:65:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(stream); data/sloccount-2.26/ml_count.c:168: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). newlinepos = buffer + strlen(buffer) - 1; data/sloccount-2.26/pascal_count.c:681:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/sloccount-2.26/pascal_count.c:1653: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). return yy_scan_bytes(yy_str,strlen(yy_str) ); data/sloccount-2.26/php_count.c:109:32: [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 (strncasecmp(m, clocation, strlen(m)) == 0) { data/sloccount-2.26/php_count.c:111: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). clocation += strlen(m); data/sloccount-2.26/php_count.c:140: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). for (p= s + strlen(s) - 1; p >= s && isspace(*p); p--) { data/sloccount-2.26/php_count.c:293: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). newlinepos = buffer + strlen(buffer) - 1; data/sloccount-2.26/stripccomments.c:30:10: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getchar(); data/sloccount-2.26/stripccomments.c:39:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (c = getchar()) != EOF) { data/sloccount-2.26/stripccomments.c:44:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c= getchar(); c=getchar(); incomment=0; data/sloccount-2.26/stripccomments.c:44:28: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c= getchar(); c=getchar(); incomment=0; ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 4884 in approximately 0.13 seconds (38247 lines/second) Physical Source Lines of Code (SLOC) = 2981 Hits@level = [0] 31 [1] 23 [2] 13 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 67 [1+] 36 [2+] 13 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 22.4757 [1+] 12.0765 [2+] 4.36095 [3+] 0 [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.