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/pldebugger-1.3/dbgcomm.c Examining data/pldebugger-1.3/dbgcomm.h Examining data/pldebugger-1.3/globalbp.h Examining data/pldebugger-1.3/pldbgapi.c Examining data/pldebugger-1.3/pldebugger.h Examining data/pldebugger-1.3/plpgsql_debugger.c Examining data/pldebugger-1.3/plugin_debugger.c FINAL RESULTS: data/pldebugger-1.3/pldbgapi.c:807:3: [4] (format) snprintf: 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. snprintf( data/pldebugger-1.3/plpgsql_debugger.c:1083:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( select, "SELECT %s", value ); data/pldebugger-1.3/plpgsql_debugger.c:1151:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( select, "SELECT '%s'", value ); data/pldebugger-1.3/pldbgapi.c:457: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 * values[3]; data/pldebugger-1.3/pldbgapi.c:592: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 frameString[PLDBG_STRING_MAX_LEN]; data/pldebugger-1.3/pldbgapi.c:631: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 sourceString[PLDBG_STRING_MAX_LEN]; data/pldebugger-1.3/pldbgapi.c:735: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 * values[8]; data/pldebugger-1.3/pldbgapi.c:798: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 * values[5]; data/pldebugger-1.3/pldbgapi.c:799: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 callCount[PLDBG_STRING_MAX_LEN]; data/pldebugger-1.3/pldbgapi.c:869: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 breakpointString[PLDBG_STRING_MAX_LEN]; data/pldebugger-1.3/pldbgapi.c:891: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 breakpointString[PLDBG_STRING_MAX_LEN]; data/pldebugger-1.3/plugin_debugger.c:411:14: [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). targetOid = atoi( command + 2 ); data/pldebugger-1.3/plugin_debugger.c:1062:18: [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). select_frame(atoi( &command[2] ), &frame, &lang); data/pldebugger-1.3/plugin_debugger.c:1140: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). lineno = atoi(lineno_s); data/pldebugger-1.3/pldbgapi.c:1297: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). size_t len = strlen( src ); data/pldebugger-1.3/plpgsql_debugger.c:466: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). size_t len = strlen(var->refname); data/pldebugger-1.3/plpgsql_debugger.c:468:13: [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(len != strlen(var_name)) data/pldebugger-1.3/plpgsql_debugger.c:1081: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). select = palloc( strlen( "SELECT " ) + strlen( value ) + 2 + 1 ); data/pldebugger-1.3/plpgsql_debugger.c:1081:41: [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). select = palloc( strlen( "SELECT " ) + strlen( value ) + 2 + 1 ); data/pldebugger-1.3/plugin_debugger.c:373: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). remaining = strlen(data); data/pldebugger-1.3/plugin_debugger.c:1137:6: [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(lineno_s) == 0) ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 5805 in approximately 0.16 seconds (35912 lines/second) Physical Source Lines of Code (SLOC) = 3150 Hits@level = [0] 7 [1] 7 [2] 11 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 28 [1+] 21 [2+] 14 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 8.88889 [1+] 6.66667 [2+] 4.44444 [3+] 0.952381 [4+] 0.952381 [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.