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/beancount-2.3.3/beancount/parser/decimal.c Examining data/beancount-2.3.3/beancount/parser/decimal.h Examining data/beancount-2.3.3/beancount/parser/grammar.c Examining data/beancount-2.3.3/beancount/parser/grammar.h Examining data/beancount-2.3.3/beancount/parser/lexer.c Examining data/beancount-2.3.3/beancount/parser/lexer.h Examining data/beancount-2.3.3/beancount/parser/macros.h Examining data/beancount-2.3.3/beancount/parser/parser.c Examining data/beancount-2.3.3/beancount/parser/parser.h Examining data/beancount-2.3.3/beancount/parser/tokens.c Examining data/beancount-2.3.3/beancount/parser/tokens.h Examining data/beancount-2.3.3/beancount/parser/tokens_test.c Examining data/beancount-2.3.3/experiments/v3/decimal/test_serialize_decimal.cc Examining data/beancount-2.3.3/experiments/v3/decimal/testdec.cc Examining data/beancount-2.3.3/experiments/v3/serialization/riegeli_print.cc FINAL RESULTS: data/beancount-2.3.3/beancount/parser/grammar.c:1171:21: [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. # define YYFPRINTF fprintf data/beancount-2.3.3/beancount/parser/grammar.c:1732: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 yymsgbuf[128]; data/beancount-2.3.3/beancount/parser/tokens.c:57:5: [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[256]; data/beancount-2.3.3/beancount/parser/tokens_test.c:11:5: [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[256]; data/beancount-2.3.3/experiments/v3/decimal/testdec.cc:22: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 status_str[MPD_MAX_FLAG_STRING]; data/beancount-2.3.3/beancount/parser/grammar.c:1415:46: [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). # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) data/beancount-2.3.3/beancount/parser/lexer.c:1261: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/beancount-2.3.3/beancount/parser/lexer.c:2610:37: [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( yystr, (int) strlen(yystr) , yyscanner); data/beancount-2.3.3/beancount/parser/lexer.c:3159:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!read) { data/beancount-2.3.3/beancount/parser/lexer.c:3163:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = PyLong_AsSize_t(read); data/beancount-2.3.3/beancount/parser/lexer.c:3170:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_XDECREF(read); data/beancount-2.3.3/beancount/parser/tokens_test.c:85: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). len = cunescape(s, strlen(s), true, &unescaped, &lines); data/beancount-2.3.3/beancount/parser/tokens_test.c:92: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). len = cunescape(s, strlen(s), true, &unescaped, &lines); data/beancount-2.3.3/beancount/parser/tokens_test.c:93:28: [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). assert(len == (ssize_t)strlen(s)); data/beancount-2.3.3/beancount/parser/tokens_test.c:99: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). len = cunescape(s, strlen(s), true, &unescaped, &lines); data/beancount-2.3.3/beancount/parser/tokens_test.c:100:28: [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). assert(len == (ssize_t)strlen(s)); data/beancount-2.3.3/beancount/parser/tokens_test.c:106: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). len = cunescape(s, strlen(s), true, &unescaped, &lines); data/beancount-2.3.3/beancount/parser/tokens_test.c:107:28: [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). assert(len == (ssize_t)strlen(s) - 2); ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 8041 in approximately 0.28 seconds (28701 lines/second) Physical Source Lines of Code (SLOC) = 5718 Hits@level = [0] 3 [1] 13 [2] 4 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 21 [1+] 18 [2+] 5 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 3.67261 [1+] 3.14795 [2+] 0.874432 [3+] 0.174886 [4+] 0.174886 [5+] 0 Dot directories skipped = 2 (--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.