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/octave-database-2.4.4/src/error-helpers.cc Examining data/octave-database-2.4.4/src/pq_exec.cc Examining data/octave-database-2.4.4/src/__pq_internal_exit__.cc Examining data/octave-database-2.4.4/src/wrap_endian.h Examining data/octave-database-2.4.4/src/oct-alt-includes.h Examining data/octave-database-2.4.4/src/pq_connection.cc Examining data/octave-database-2.4.4/src/var2bytea.cc Examining data/octave-database-2.4.4/src/command.h Examining data/octave-database-2.4.4/src/undef-ah-octave.h Examining data/octave-database-2.4.4/src/pq_update_types.cc Examining data/octave-database-2.4.4/src/pkglock.cc Examining data/octave-database-2.4.4/src/command.cc Examining data/octave-database-2.4.4/src/pq_lo.cc Examining data/octave-database-2.4.4/src/pq_conninfo.cc Examining data/octave-database-2.4.4/src/__pq_connect__.cc Examining data/octave-database-2.4.4/src/pq_connection.h Examining data/octave-database-2.4.4/src/pq_close.cc Examining data/octave-database-2.4.4/src/converters_arr_comp.cc Examining data/octave-database-2.4.4/src/converters.h Examining data/octave-database-2.4.4/src/converters.cc Examining data/octave-database-2.4.4/src/error-helpers.h Examining data/octave-database-2.4.4/src/bytea2var.cc FINAL RESULTS: data/octave-database-2.4.4/src/pq_lo.cc:89:15: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (! (fp = popen (cmd, "r"))) data/octave-database-2.4.4/src/pq_lo.cc:223:15: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (! (fp = popen (cmd, "w"))) data/octave-database-2.4.4/src/bytea2var.cc:77:7: [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 magic[magic_len+1]; data/octave-database-2.4.4/src/command.cc:74: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 *vals [npars]; data/octave-database-2.4.4/src/command.cc:534: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 buff [OCT_PQ_READSIZE]; data/octave-database-2.4.4/src/command.cc:677:7: [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 header [COPY_HEADER_SIZE]; data/octave-database-2.4.4/src/command.cc:679:7: [2] (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). Risk is low because the source is a constant string. strcpy (header, "PGCOPY\n\377\r\n\0"); data/octave-database-2.4.4/src/command.cc:681:7: [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 (&header[11], &tpu32, 4); data/octave-database-2.4.4/src/command.cc:683:7: [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 trailer [2]; data/octave-database-2.4.4/src/command.cc:685:7: [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 (&trailer, &tp16, 2); data/octave-database-2.4.4/src/command.h:107:26: [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). return octave_value (atoi (c)); data/octave-database-2.4.4/src/converters.cc:342: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 (m.fortran_vec (), c, nb); data/octave-database-2.4.4/src/converters.cc:374: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 (&(val[csize]), b.fortran_vec (), nl); data/octave-database-2.4.4/src/converters.cc:437: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 (&(val[csize]), s.data (), l); data/octave-database-2.4.4/src/converters.cc:1664:7: [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 (a.fortran_vec (), c, nb); data/octave-database-2.4.4/src/converters.cc:1739:7: [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 (&(val[csize]), a.fortran_vec (), 4); data/octave-database-2.4.4/src/converters.cc:1896: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 (a.fortran_vec (), c, 6); data/octave-database-2.4.4/src/converters.cc:1932: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 (&(val[csize]), a.fortran_vec (), 6); data/octave-database-2.4.4/src/converters.cc:1971: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 (a.fortran_vec (), c, nbytes); data/octave-database-2.4.4/src/converters.cc:2029: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 (&(val[csize]), a.fortran_vec (), nbytes); data/octave-database-2.4.4/src/converters.cc:2079: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 (m.fortran_vec (), c, 16); data/octave-database-2.4.4/src/converters.cc:2115: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 (&(val[csize]), b.fortran_vec (), 16); data/octave-database-2.4.4/src/converters.cc:2178: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 (&(val[csize]), s.data (), l); data/octave-database-2.4.4/src/pq_lo.cc:106: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 buff [OCT_PQ_BUFSIZE]; data/octave-database-2.4.4/src/pq_lo.cc:240: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 buff [OCT_PQ_BUFSIZE]; data/octave-database-2.4.4/src/var2bytea.cc:110:7: [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 (m.fortran_vec (), s.data (), s.length ()); data/octave-database-2.4.4/src/bytea2var.cc:78:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read (magic, magic_len); data/octave-database-2.4.4/src/bytea2var.cc:93:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read (&tmp, 1); data/octave-database-2.4.4/src/bytea2var.cc:105:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (! is.read (reinterpret_cast<char *> (&len), 4)) data/octave-database-2.4.4/src/bytea2var.cc:117:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (! is.read (buf, len)) data/octave-database-2.4.4/src/command.cc:565:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). istr.read (buff, OCT_PQ_READSIZE); ANALYSIS SUMMARY: Hits = 31 Lines analyzed = 6950 in approximately 0.16 seconds (42428 lines/second) Physical Source Lines of Code (SLOC) = 4800 Hits@level = [0] 5 [1] 5 [2] 24 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 36 [1+] 31 [2+] 26 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 7.5 [1+] 6.45833 [2+] 5.41667 [3+] 0.416667 [4+] 0.416667 [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.