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/pgq-3.4.1/lowlevel/insert_event.c Examining data/pgq-3.4.1/triggers/common.c Examining data/pgq-3.4.1/triggers/common.h Examining data/pgq-3.4.1/triggers/jsontriga.c Examining data/pgq-3.4.1/triggers/logtriga.c Examining data/pgq-3.4.1/triggers/logutriga.c Examining data/pgq-3.4.1/triggers/makesql.c Examining data/pgq-3.4.1/triggers/parsesql.c Examining data/pgq-3.4.1/triggers/parsesql.h Examining data/pgq-3.4.1/triggers/qbuilder.c Examining data/pgq-3.4.1/triggers/qbuilder.h Examining data/pgq-3.4.1/triggers/sqltriga.c Examining data/pgq-3.4.1/triggers/stringutil.c Examining data/pgq-3.4.1/triggers/stringutil.h FINAL RESULTS: data/pgq-3.4.1/triggers/jsontriga.c:71:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, EARLY); data/pgq-3.4.1/triggers/jsontriga.c:73:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, LATE); data/pgq-3.4.1/triggers/jsontriga.c:81:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, EARLY); data/pgq-3.4.1/triggers/jsontriga.c:83:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, LATE); data/pgq-3.4.1/lowlevel/insert_event.c:290: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 nulls[11]; data/pgq-3.4.1/triggers/common.c:83: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 nulls[7]; data/pgq-3.4.1/triggers/common.c:183: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 namebuf[NAMEDATALEN * 2 + 3]; data/pgq-3.4.1/triggers/common.c:705: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 namebuf[NAMEDATALEN + 1]; data/pgq-3.4.1/triggers/common.c:710: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(namebuf, name, len); data/pgq-3.4.1/triggers/jsontriga.c:92: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 buf[MAXDATELEN + 1]; data/pgq-3.4.1/triggers/jsontriga.c:110: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 buf[MAXDATELEN + 1]; data/pgq-3.4.1/triggers/jsontriga.c:131: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 buf[MAXDATELEN + 1]; data/pgq-3.4.1/triggers/qbuilder.c:50: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 abuf[32]; data/pgq-3.4.1/triggers/qbuilder.c:123: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 nulls[FUNC_MAX_ARGS]; data/pgq-3.4.1/triggers/common.c:502:20: [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). ev->attkind_len = strlen(ev->attkind); data/pgq-3.4.1/triggers/common.c:783:21: [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). qb_add_raw(q, pfx, strlen(pfx)); data/pgq-3.4.1/triggers/jsontriga.c:251:59: [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). appendBinaryStringInfo(ev_type, cstart, cpos - cstart + strlen(pkey_tag)); data/pgq-3.4.1/triggers/qbuilder.c:41:9: [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(str); data/pgq-3.4.1/triggers/qbuilder.c:81:29: [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 qb_add_raw(q, abuf, strlen(abuf)); data/pgq-3.4.1/triggers/stringutil.c:77: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). int c, len = strlen(str); ANALYSIS SUMMARY: Hits = 20 Lines analyzed = 3053 in approximately 0.09 seconds (34755 lines/second) Physical Source Lines of Code (SLOC) = 1996 Hits@level = [0] 5 [1] 6 [2] 10 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 25 [1+] 20 [2+] 14 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 12.5251 [1+] 10.02 [2+] 7.01403 [3+] 2.00401 [4+] 2.00401 [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.