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/postgresql-ocaml-4.6.3/src/postgresql_stubs.c FINAL RESULTS: data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:293:5: [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(conn_info, String_val(v_conn_info), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:598: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(params[i], String_val(v_param), param_len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:608:49: [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. for (i = 0; i < nparams; i++) caml_stat_free((char *) params[i]); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:647: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(query, String_val(v_query), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:674: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(stm_name, String_val(v_stm_name), stm_name_len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:675: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(query, String_val(v_query), query_len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:704: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(stm_name, String_val(v_stm_name), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:730: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(query, String_val(v_query), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1124: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 errbuf[256]; data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1236: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(buf, String_val(v_buf) + pos, len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1261:5: [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(msg, String_val(v_msg), msg_len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1318: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(Bytes_val(v_buf) + pos, buf, len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1349: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(buf, String_val(v_buf), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1369: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(buf, String_val(v_buf) + pos, len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1473: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(fname, String_val(v_fname), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1493: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(fname, String_val(v_fname), len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1580: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(Bytes_val(v_buf) + pos, buf, len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:1623: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(buf, String_val(v_buf) + pos, len); data/postgresql-ocaml-4.6.3/src/postgresql_stubs.c:911: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). if (str == NULL || strlen(str) < 2 || !is_bytea_hex_protocol(str)) ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 1685 in approximately 0.06 seconds (27619 lines/second) Physical Source Lines of Code (SLOC) = 1438 Hits@level = [0] 1 [1] 1 [2] 18 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 20 [1+] 19 [2+] 18 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 13.9082 [1+] 13.2128 [2+] 12.5174 [3+] 0 [4+] 0 [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.