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-connector-c++-1.1.12/cppconn/build_config.h Examining data/mysql-connector-c++-1.1.12/cppconn/variant.h Examining data/mysql-connector-c++-1.1.12/cppconn/resultset_metadata.h Examining data/mysql-connector-c++-1.1.12/cppconn/datatype.h Examining data/mysql-connector-c++-1.1.12/cppconn/statement.h Examining data/mysql-connector-c++-1.1.12/cppconn/prepared_statement.h Examining data/mysql-connector-c++-1.1.12/cppconn/metadata.h Examining data/mysql-connector-c++-1.1.12/cppconn/driver.h Examining data/mysql-connector-c++-1.1.12/cppconn/connection.h Examining data/mysql-connector-c++-1.1.12/cppconn/sqlstring.h Examining data/mysql-connector-c++-1.1.12/cppconn/resultset.h Examining data/mysql-connector-c++-1.1.12/cppconn/parameter_metadata.h Examining data/mysql-connector-c++-1.1.12/cppconn/warning.h Examining data/mysql-connector-c++-1.1.12/cppconn/exception.h Examining data/mysql-connector-c++-1.1.12/examples/connect.cpp Examining data/mysql-connector-c++-1.1.12/examples/resultset_types.cpp Examining data/mysql-connector-c++-1.1.12/examples/pthreads.cpp Examining data/mysql-connector-c++-1.1.12/examples/dynamic_load.cpp Examining data/mysql-connector-c++-1.1.12/examples/resultset_meta.cpp Examining data/mysql-connector-c++-1.1.12/examples/standalone_example_docs2.cpp Examining data/mysql-connector-c++-1.1.12/examples/examples.h Examining data/mysql-connector-c++-1.1.12/examples/resultset.cpp Examining data/mysql-connector-c++-1.1.12/examples/exceptions.cpp Examining data/mysql-connector-c++-1.1.12/examples/standalone_example.cpp Examining data/mysql-connector-c++-1.1.12/examples/prepared_statement.cpp Examining data/mysql-connector-c++-1.1.12/examples/resultset_binary.cpp Examining data/mysql-connector-c++-1.1.12/examples/debug_output.cpp Examining data/mysql-connector-c++-1.1.12/examples/standalone_example_docs1.cpp Examining data/mysql-connector-c++-1.1.12/examples/connection_meta_schemaobj.cpp Examining data/mysql-connector-c++-1.1.12/examples/statement.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/SubqueriesRegressionTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/BlobRegressionTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/PreparedStatementRegressionTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/EscapeProcessorRegressionTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/SubqueriesRegressionTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/PreparedStatementRegressionTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/EscapeProcessorRegressionTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/BlobRegressionTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/resources.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/resources.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/PreparedStatementTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/UnbufferedRsStmtTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/ResultSetMetadataTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/ResultSetMetadataTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/DatabaseMetaDataTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/DatabaseMetaDataTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/ConnectionTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/UnbufferedRsStmtTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/PreparedStatementTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/StatementTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/ConnectionTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/compliance/StatementTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/BaseTestFixture.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/BaseTestFixture.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/TransactionTest.cpp Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/TransactionTest.h Examining data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/ccpptests.cpp Examining data/mysql-connector-c++-1.1.12/test/driver_test.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/framework.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_outputter.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_timer.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_listener.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_tapOutputter.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_runner.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_timer.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_asserts.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/start_options.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_case.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_factory.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_container.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_listener.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_tapOutputter.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_filter.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_runner.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_asserts.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_suite.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_filter.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_factory.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/test_suite.cpp Examining data/mysql-connector-c++-1.1.12/test/framework/start_options.h Examining data/mysql-connector-c++-1.1.12/test/framework/test_container.cpp Examining data/mysql-connector-c++-1.1.12/test/static_test.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/template_bug_group/bug456.h Examining data/mysql-connector-c++-1.1.12/test/unit/template_bug_group/bug123.h Examining data/mysql-connector-c++-1.1.12/test/unit/template_bug_group/bug456.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/template_bug_group/bug123.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/performance/perf_statement.h Examining data/mysql-connector-c++-1.1.12/test/unit/performance/perf_statement.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/unit_fixture.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/art_resultset.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/variant.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/connectionmetadata.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/preparedstatement.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/uri.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/preparedstatement.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/statement.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/savepoint.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/resultset.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/connection.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/parametermetadata.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/savepoint.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/resultset.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/parametermetadata.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/variant.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/resultsetmetadata.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/uri.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/connection.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/resultsetmetadata.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/connectionmetadata.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/classes/art_resultset.h Examining data/mysql-connector-c++-1.1.12/test/unit/classes/statement.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/example/example.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/example/example.h Examining data/mysql-connector-c++-1.1.12/test/unit/bugs/bugs.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/bugs/bugs.h Examining data/mysql-connector-c++-1.1.12/test/unit/main.cpp Examining data/mysql-connector-c++-1.1.12/test/unit/unit_fixture.h Examining data/mysql-connector-c++-1.1.12/test/test_common.cpp Examining data/mysql-connector-c++-1.1.12/test/common/stringutils.cpp Examining data/mysql-connector-c++-1.1.12/test/common/singleton.h Examining data/mysql-connector-c++-1.1.12/test/common/stringutils.h Examining data/mysql-connector-c++-1.1.12/test/common/file.cpp Examining data/mysql-connector-c++-1.1.12/test/common/file.h Examining data/mysql-connector-c++-1.1.12/test/common/ccppTypes.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_public_iface.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_uri.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/libmysql_static_proxy.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/native_connection_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_client_api.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/libmysql_dynamic_proxy.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_private_iface.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_driver_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_client_api.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_resultset_wrapper.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_statement_wrapper.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/native_driver_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/libmysql_dynamic_proxy.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_driver_wrapper.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/libmysql_static_proxy.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_connection_wrapper.cpp Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_connection_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_resultset_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_native_statement_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/native_resultset_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/nativeapi/native_statement_wrapper.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_resultbind.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_uri.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset_metadata.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_resultset.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_warning.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_debug.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_error.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_resultset_metadata.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_connection_data.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_statement.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_driver.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_parameter_metadata.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_statement.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_art_rset_metadata.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_resultset.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_connection.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_metadata.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_statement_options.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_util.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_art_resultset.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_util.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_art_rset_metadata.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_driver.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_art_resultset.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_parameter_metadata.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_resultbind.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_debug.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset_metadata.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_warning.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_connection.cpp Examining data/mysql-connector-c++-1.1.12/driver/mysql_connection_options.h Examining data/mysql-connector-c++-1.1.12/driver/mysql_resultset_metadata.h Examining data/mysql-connector-c++-1.1.12/thread/my_no_pthread.h Examining data/mysql-connector-c++-1.1.12/thread/thr_mutex.c Examining data/mysql-connector-c++-1.1.12/thread/thr_alarm.h Examining data/mysql-connector-c++-1.1.12/thread/my_wincond.c Examining data/mysql-connector-c++-1.1.12/thread/my_pthread.h Examining data/mysql-connector-c++-1.1.12/thread/my_winthread.c Examining data/mysql-connector-c++-1.1.12/thread/my_pthread.c Examining data/mysql-connector-c++-1.1.12/thread/my_thr_init.c FINAL RESULTS: data/mysql-connector-c++-1.1.12/driver/mysql_debug.cpp:189:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, args); data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_private_iface.h:45:56: [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. #if ( defined(_WIN32) || defined(_WIN64) ) && !defined(snprintf) && (_MSC_VER < 1900) data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_private_iface.h:46:9: [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. #define snprintf _snprintf data/mysql-connector-c++-1.1.12/driver/nativeapi/mysql_private_iface.h:46:18: [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. #define snprintf _snprintf data/mysql-connector-c++-1.1.12/driver/mysql_debug.cpp:84:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("MYSQLCPPCONN_TRACE_ENABLED")) { data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.cpp:48:9: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. #define LoadLibrary(p) ::dlopen(p, RTLD_LAZY) data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.cpp:77:26: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. if ((loadedLibHandle = LoadLibrary(path2libFile.c_str())) == NULL) { data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.cpp:91:25: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. if ((loadedLibHandle= LoadLibrary(libFileName.c_str())) == NULL) { data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.cpp:96:26: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. if ((loadedLibHandle = LoadLibrary(fullname.c_str())) == NULL) { data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/BaseTestFixture.cpp:136:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand((unsigned) time(NULL)); data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.cpp:331:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand((unsigned) time(NULL)); data/mysql-connector-c++-1.1.12/thread/my_pthread.h:155:35: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. #define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) data/mysql-connector-c++-1.1.12/thread/my_pthread.h:156:33: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) data/mysql-connector-c++-1.1.12/thread/my_wincond.c:48:3: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(&cond->lock_waiting); data/mysql-connector-c++-1.1.12/thread/my_wincond.c:135:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cond->lock_waiting); data/mysql-connector-c++-1.1.12/thread/my_wincond.c:143:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cond->lock_waiting); data/mysql-connector-c++-1.1.12/thread/my_wincond.c:159:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(mutex); data/mysql-connector-c++-1.1.12/thread/my_wincond.c:166:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cond->lock_waiting); data/mysql-connector-c++-1.1.12/thread/my_wincond.c:179:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cond->lock_waiting); data/mysql-connector-c++-1.1.12/driver/mysql_art_resultset.cpp:79: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 buf[31]; data/mysql-connector-c++-1.1.12/driver/mysql_art_resultset.cpp:85: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 buf[20]; data/mysql-connector-c++-1.1.12/driver/mysql_art_resultset.cpp:91: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 buf[20]; data/mysql-connector-c++-1.1.12/driver/mysql_art_resultset.cpp:97: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 buf[3]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:1936: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[5]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:2158: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[10]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:2393: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[10]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:2679: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[10]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:2868: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 indexOther[5]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:2869: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 indexHash[5]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:2940:29: [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). rs_data_row.push_back(atoi(rs->getString("Non_unique").c_str())? true:false); // NON_UNIQUE data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:3081:10: [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 atoi(connection->getSessionVariable("max_connections").c_str()); data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:3141:10: [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 atoi(connection->getSessionVariable("max_allowed_packet").c_str()) - 4; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:3420: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 procRetNoRes[5]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:3422: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 procRetRes[5]; data/mysql-connector-c++-1.1.12/driver/mysql_metadata.cpp:3424: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 procRetUnknown[5]; data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:731: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(param->buffer, &value, p.second); data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:771: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(param->buffer, &value, p.second); data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:812: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(param->buffer, &value, p.second); data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:851: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(param->buffer, &value, p.second); data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:892: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(param->buffer, &value, p.second); data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:966:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. param->buffer = memcpy(new char[value.length() + 1], value.c_str(), value.length() + 1); data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.cpp:980:13: [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[28]; data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.cpp:994:13: [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[12]; data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.cpp:1002:13: [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[18]; data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.cpp:1020:13: [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[30]; data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset.cpp:1032:13: [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[50]; data/mysql-connector-c++-1.1.12/driver/mysql_resultbind.cpp:138:17: [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. delete[] (char *) rbind[i].buffer; data/mysql-connector-c++-1.1.12/driver/mysql_resultbind.cpp:150:15: [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. delete[] (char *) rbind[i].buffer; data/mysql-connector-c++-1.1.12/driver/mysql_resultset.cpp:704:9: [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[30]; data/mysql-connector-c++-1.1.12/driver/mysql_uri.cpp:219:17: [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). uri.setPort(atoi(host.substr(start_sep + 1, sql::SQLString::npos).c_str())); data/mysql-connector-c++-1.1.12/driver/nativeapi/library_loader.cpp:61:3: [2] (buffer) TCHAR: 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. TCHAR buffer[255]; data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/BlobRegressionTest.cpp:240: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 testData[dataSize]; data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/resources.cpp:129:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fileStream.open(fileName.c_str()); data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/resources.cpp:137:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fileStream.open((String(_possibleLocations[ i ]) + "/" + fileName).c_str()); data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.cpp:166: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 fromFile[8192]; data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.cpp:276: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[1048]; data/mysql-connector-c++-1.1.12/test/common/file.cpp:92:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). stream.open( name.c_str(), std::ios_base::out | std::ios_base::in data/mysql-connector-c++-1.1.12/test/common/file.cpp:95:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). stream.open( name.c_str(), std::ios_base::out data/mysql-connector-c++-1.1.12/test/common/file.cpp:121: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 buff[1024]; data/mysql-connector-c++-1.1.12/test/common/stringutils.cpp:142: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). return atoi( str.c_str() ); data/mysql-connector-c++-1.1.12/test/test_common.cpp:300: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 buff[64]; data/mysql-connector-c++-1.1.12/test/test_common.cpp:311:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "KILL %d", rset1->getInt(1)); data/mysql-connector-c++-1.1.12/test/unit/classes/connection.cpp:1062:16: [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). port=atoi(url.substr(port_pos + 1, std::string::npos).c_str()); data/mysql-connector-c++-1.1.12/test/unit/classes/connection.cpp:2828:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). infile.open("test_infile.txt"); data/mysql-connector-c++-1.1.12/test/unit/classes/preparedstatement.cpp:1398: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 blob_input[512]; data/mysql-connector-c++-1.1.12/test/unit/classes/preparedstatement.cpp:1401: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 blob_output[512]; data/mysql-connector-c++-1.1.12/thread/my_pthread.c:83: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 name[NX_MAX_OBJECT_NAME_LEN+1] = ""; data/mysql-connector-c++-1.1.12/thread/my_pthread.h:628: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 name[THREAD_NAME_SIZE+1]; data/mysql-connector-c++-1.1.12/thread/my_thr_init.c:494: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 name_buff[100]; data/mysql-connector-c++-1.1.12/thread/my_thr_init.c:499:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name_buff,"T@%lu", (ulong) id); data/mysql-connector-c++-1.1.12/thread/my_thr_init.c:510: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[64]; data/mysql-connector-c++-1.1.12/driver/mysql_prepared_statement.cpp:106:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). my_blob->read(buf.get(), MAX_SEND_LONGDATA_BUFFER); data/mysql-connector-c++-1.1.12/driver/mysql_ps_resultset_metadata.cpp:381:18: [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). return !(db && strlen(db)); data/mysql-connector-c++-1.1.12/driver/mysql_resultset_metadata.cpp:405:18: [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). return !(db && strlen(db)); data/mysql-connector-c++-1.1.12/driver/mysql_util.cpp:2384: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). srclen = strlen(src); data/mysql-connector-c++-1.1.12/examples/pthreads.cpp:164:7: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(300000); data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/regression/BlobRegressionTest.cpp:381:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ( ! blob->read(&tmp,1).fail() ) data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.cpp:167:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bIn.read(fromFile, sizeof (fromFile)); data/mysql-connector-c++-1.1.12/test/CJUnitTestsPort/simple/BlobTest.cpp:280:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inStr->read(buff, sizeof (buff)); data/mysql-connector-c++-1.1.12/test/common/file.cpp:128:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fStr.read( buff, sizeof(buff) ); data/mysql-connector-c++-1.1.12/test/unit/classes/preparedstatement.cpp:386:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). blob_output_stream->read(blob_out.get(), len); data/mysql-connector-c++-1.1.12/test/unit/classes/preparedstatement.cpp:402:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). blob_output_stream->read(blob_out.get(), len); ANALYSIS SUMMARY: Hits = 82 Lines analyzed = 88945 in approximately 2.64 seconds (33657 lines/second) Physical Source Lines of Code (SLOC) = 47026 Hits@level = [0] 271 [1] 11 [2] 52 [3] 15 [4] 4 [5] 0 Hits@level+ = [0+] 353 [1+] 82 [2+] 71 [3+] 19 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 7.50649 [1+] 1.74372 [2+] 1.5098 [3+] 0.404032 [4+] 0.0850593 [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.