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/bls-standalone-0.20151231/scan/compile.c Examining data/bls-standalone-0.20151231/scan/config.h Examining data/bls-standalone-0.20151231/scan/eff.h Examining data/bls-standalone-0.20151231/scan/effread.c Examining data/bls-standalone-0.20151231/scan/effwrite.c Examining data/bls-standalone-0.20151231/scan/globals.c Examining data/bls-standalone-0.20151231/scan/globals.h Examining data/bls-standalone-0.20151231/scan/merge.c Examining data/bls-standalone-0.20151231/scan/merge.h Examining data/bls-standalone-0.20151231/scan/scan.c Examining data/bls-standalone-0.20151231/scan/statetable.h Examining data/bls-standalone-0.20151231/scan/tags.c Examining data/bls-standalone-0.20151231/scan/tags.h Examining data/bls-standalone-0.20151231/scan/translate.c Examining data/bls-standalone-0.20151231/scan/translate.h FINAL RESULTS: data/bls-standalone-0.20151231/scan/globals.c:35:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer), format, va); data/bls-standalone-0.20151231/scan/globals.h:4:70: [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. void fail(const char *format, ...) __attribute__ ((noreturn, format (printf, 1, 2))); data/bls-standalone-0.20151231/scan/compile.c:137:16: [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, "+o:qd", long_options, NULL)) != -1) { data/bls-standalone-0.20151231/scan/scan.c:473:16: [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, "+hr:", long_options, NULL)) != -1) { data/bls-standalone-0.20151231/scan/compile.c:74:11: [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. unsigned char buffer[6 * 256]; data/bls-standalone-0.20151231/scan/compile.c:99:6: [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(buffer + 6 * o + 2, &u, 4); data/bls-standalone-0.20151231/scan/compile.c:115:4: [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(buffer + 6 * o + 2, &u, 4); data/bls-standalone-0.20151231/scan/compile.c:154:13: [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 *f = fopen(argv[optind], "r"); data/bls-standalone-0.20151231/scan/effread.c:68:11: [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. unsigned char buffer[5]; data/bls-standalone-0.20151231/scan/effread.c:77: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). f->file = fopen(filename, "r"); data/bls-standalone-0.20151231/scan/effwrite.c:66:11: [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. unsigned char buffer[5]; data/bls-standalone-0.20151231/scan/effwrite.c:79:13: [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). f->file = fopen(filename, "wb"); data/bls-standalone-0.20151231/scan/effwrite.c:84:2: [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(buffer, "eff", 3); data/bls-standalone-0.20151231/scan/effwrite.c:128:11: [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. unsigned char buffer[1]; data/bls-standalone-0.20151231/scan/effwrite.c:136:11: [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. unsigned char buffer[1 + 4]; data/bls-standalone-0.20151231/scan/effwrite.c:140:2: [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(buffer + 1, &u, 4); data/bls-standalone-0.20151231/scan/effwrite.c:144:11: [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. unsigned char buffer[1 + 2]; data/bls-standalone-0.20151231/scan/effwrite.c:148:2: [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(buffer + 1, &u, 2); data/bls-standalone-0.20151231/scan/effwrite.c:152:11: [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. unsigned char buffer[1 + 1]; data/bls-standalone-0.20151231/scan/effwrite.c:155:2: [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(buffer + 1, &u, 1); data/bls-standalone-0.20151231/scan/effwrite.c:160:11: [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. unsigned char buffer[1 + 1]; data/bls-standalone-0.20151231/scan/effwrite.c:171:11: [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. unsigned char buffer[1 + 1 + 2]; data/bls-standalone-0.20151231/scan/effwrite.c:178:2: [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(buffer + 2, &un, 2); data/bls-standalone-0.20151231/scan/globals.c:30:9: [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 buffer[4096]; data/bls-standalone-0.20151231/scan/scan.c:129:11: [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. unsigned char buffer[6]; data/bls-standalone-0.20151231/scan/scan.c:155:4: [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(&u, buffer + 2, 4); data/bls-standalone-0.20151231/scan/scan.c:313:3: [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(n->extradata, extractstart, extractlen); data/bls-standalone-0.20151231/scan/scan.c:326:18: [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 unsigned char buffer[102400]; data/bls-standalone-0.20151231/scan/scan.c:504:8: [2] (misc) open: 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). fd = open(argv[optind], O_RDONLY); data/bls-standalone-0.20151231/scan/tags.c:178:2: [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(p->pattern, options, len + 1); data/bls-standalone-0.20151231/scan/translate.c:129:2: [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(ps[count], state, (len+1)*sizeof(bool)); data/bls-standalone-0.20151231/scan/translate.c:176:4: [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(i[thisofs].match, all, sizeof(all)); data/bls-standalone-0.20151231/scan/effread.c:67: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). size_t typelen = strlen(type); data/bls-standalone-0.20151231/scan/effwrite.c:65: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). size_t typelen = strlen(type); data/bls-standalone-0.20151231/scan/effwrite.c:115:15: [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). buffer[1] = strlen(type); data/bls-standalone-0.20151231/scan/scan.c:350:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). got = read(fd, buffer + filleduntil, data/bls-standalone-0.20151231/scan/tags.c:176:8: [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(options); data/bls-standalone-0.20151231/scan/tags.c:325: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(line) != got) data/bls-standalone-0.20151231/scan/tags.c:361:36: [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). eff_writestring(file, tag->name, strlen(tag->name)); data/bls-standalone-0.20151231/scan/translate.c:167:8: [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(pattern); ANALYSIS SUMMARY: Hits = 40 Lines analyzed = 2316 in approximately 0.09 seconds (26687 lines/second) Physical Source Lines of Code (SLOC) = 1913 Hits@level = [0] 12 [1] 8 [2] 28 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 52 [1+] 40 [2+] 32 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 27.1824 [1+] 20.9096 [2+] 16.7277 [3+] 2.09096 [4+] 1.04548 [5+] 0 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.