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/mysql-ocaml-1.2.4/etc/errmsg.h Examining data/mysql-ocaml-1.2.4/mysql_stubs.c FINAL RESULTS: data/mysql-ocaml-1.2.4/mysql_stubs.c:90:3: [4] (format) vsnprintf: 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. vsnprintf(buf, sizeof buf, fmt, args); data/mysql-ocaml-1.2.4/mysql_stubs.c:86: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 buf[1024]; data/mysql-ocaml-1.2.4/mysql_stubs.c:150: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(String_val(v), s, length); data/mysql-ocaml-1.2.4/mysql_stubs.c:587: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(String_val(res), buf, esclen); data/mysql-ocaml-1.2.4/mysql_stubs.c:615: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(String_val(res), buf, esclen); data/mysql-ocaml-1.2.4/mysql_stubs.c:930: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 buf[1024]; data/mysql-ocaml-1.2.4/mysql_stubs.c:999: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(bind->buffer, String_val(v), len); data/mysql-ocaml-1.2.4/mysql_stubs.c:561:54: [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). s = val_str_option(msg, msg == (char *) NULL ? 0 : strlen(msg)); data/mysql-ocaml-1.2.4/mysql_stubs.c:790:38: [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). table = val_str_option(f->table, strlen(f->table)); data/mysql-ocaml-1.2.4/mysql_stubs.c:795:34: [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). def = val_str_option(f->def, strlen(f->def)); data/mysql-ocaml-1.2.4/mysql_stubs.c:925: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). ret = mysql_stmt_prepare(stmt, sql_c, strlen(sql_c)); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 1270 in approximately 0.05 seconds (26001 lines/second) Physical Source Lines of Code (SLOC) = 969 Hits@level = [0] 1 [1] 4 [2] 6 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 12 [1+] 11 [2+] 7 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 12.3839 [1+] 11.3519 [2+] 7.22394 [3+] 1.03199 [4+] 1.03199 [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.