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/mydumper-0.9.5/binlog.c Examining data/mydumper-0.9.5/binlog.h Examining data/mydumper-0.9.5/cmake/modules/Findcppcheck.cpp Examining data/mydumper-0.9.5/connection.c Examining data/mydumper-0.9.5/connection.h Examining data/mydumper-0.9.5/g_unix_signal.c Examining data/mydumper-0.9.5/g_unix_signal.h Examining data/mydumper-0.9.5/getPassword.c Examining data/mydumper-0.9.5/getPassword.h Examining data/mydumper-0.9.5/mydumper.c Examining data/mydumper-0.9.5/mydumper.h Examining data/mydumper-0.9.5/myloader.c Examining data/mydumper-0.9.5/myloader.h Examining data/mydumper-0.9.5/server_detect.c Examining data/mydumper-0.9.5/server_detect.h Examining data/mydumper-0.9.5/common.h FINAL RESULTS: data/mydumper-0.9.5/getPassword.c:7:13: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. password = getpass("Enter MySQL Password: "); data/mydumper-0.9.5/binlog.c:140: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(buf + 10, binlog_file, strlen(binlog_file)); data/mydumper-0.9.5/mydumper.c:1217:22: [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). if (row[tcol] && atoi(row[tcol])>longquery) { data/mydumper-0.9.5/mydumper.c:1219:58: [2] (integer) atol: 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). if (mysql_query(conn,p3=g_strdup_printf("KILL %lu",atol(row[icol])))) data/mydumper-0.9.5/myloader.c:561: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 buffer[256]; data/mydumper-0.9.5/binlog.c:140:32: [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). memcpy(buf + 10, binlog_file, strlen(binlog_file)); data/mydumper-0.9.5/binlog.c:146:3: [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). strlen(binlog_file) + 10, 1)) { data/mydumper-0.9.5/mydumper.c:328:27: [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). rc = pcre_exec(re,NULL,p,strlen(p),0,0,ovector,9); data/mydumper-0.9.5/mydumper.c:950:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/mydumper-0.9.5/mydumper.c:1168:30: [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). p2 = g_strndup(p, (unsigned)strlen(p)-8); data/mydumper-0.9.5/mydumper.c:1850:23: [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). escaped=g_new(char,strlen(from)*2+1); data/mydumper-0.9.5/mydumper.c:1851:47: [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). mysql_real_escape_string(conn,escaped,from,strlen(from)); data/mydumper-0.9.5/mydumper.c:1856:23: [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). escaped=g_new(char,strlen(to)*2+1); data/mydumper-0.9.5/mydumper.c:1857:47: [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). mysql_real_escape_string(conn,escaped,from,strlen(from)); data/mydumper-0.9.5/myloader.c:584: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). } while ((buffer[strlen(buffer)] != '\0') && *eof == FALSE); data/mydumper-0.9.5/server_detect.c:37:39: [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). rc = pcre_exec(re, NULL, db_version, strlen(db_version), 0, 0, ovector, 9); data/mydumper-0.9.5/server_detect.c:50:39: [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). rc = pcre_exec(re, NULL, db_version, strlen(db_version), 0, 0, ovector, 9); data/mydumper-0.9.5/server_detect.c:63:46: [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). rc = pcre_exec(re, NULL, db_version, strlen(db_version), 0, 0, ovector, 9); ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 4614 in approximately 0.15 seconds (29861 lines/second) Physical Source Lines of Code (SLOC) = 3682 Hits@level = [0] 8 [1] 13 [2] 4 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 26 [1+] 18 [2+] 5 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 7.06138 [1+] 4.88865 [2+] 1.35796 [3+] 0.271592 [4+] 0.271592 [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.