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/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/chrono.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/color.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/compile.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/core.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/locale.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/os.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/ostream.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/posix.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h Examining data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/ranges.h Examining data/osm2pgsql-1.3.0+ds/src/check-order.cpp Examining data/osm2pgsql-1.3.0+ds/src/check-order.hpp Examining data/osm2pgsql-1.3.0+ds/src/db-copy-mgr.hpp Examining data/osm2pgsql-1.3.0+ds/src/db-copy.cpp Examining data/osm2pgsql-1.3.0+ds/src/db-copy.hpp Examining data/osm2pgsql-1.3.0+ds/src/dependency-manager.cpp Examining data/osm2pgsql-1.3.0+ds/src/dependency-manager.hpp Examining data/osm2pgsql-1.3.0+ds/src/domain-matcher.hpp Examining data/osm2pgsql-1.3.0+ds/src/expire-tiles.cpp Examining data/osm2pgsql-1.3.0+ds/src/expire-tiles.hpp Examining data/osm2pgsql-1.3.0+ds/src/flex-table-column.cpp Examining data/osm2pgsql-1.3.0+ds/src/flex-table-column.hpp Examining data/osm2pgsql-1.3.0+ds/src/flex-table.cpp Examining data/osm2pgsql-1.3.0+ds/src/flex-table.hpp Examining data/osm2pgsql-1.3.0+ds/src/format.hpp Examining data/osm2pgsql-1.3.0+ds/src/gazetteer-style.cpp Examining data/osm2pgsql-1.3.0+ds/src/gazetteer-style.hpp Examining data/osm2pgsql-1.3.0+ds/src/geom-transform.cpp Examining data/osm2pgsql-1.3.0+ds/src/geom-transform.hpp Examining data/osm2pgsql-1.3.0+ds/src/geometry-processor.cpp Examining data/osm2pgsql-1.3.0+ds/src/geometry-processor.hpp Examining data/osm2pgsql-1.3.0+ds/src/id-tracker.cpp Examining data/osm2pgsql-1.3.0+ds/src/id-tracker.hpp Examining data/osm2pgsql-1.3.0+ds/src/input-handler.cpp Examining data/osm2pgsql-1.3.0+ds/src/input-handler.hpp Examining data/osm2pgsql-1.3.0+ds/src/lua-init.hpp Examining data/osm2pgsql-1.3.0+ds/src/lua-utils.cpp Examining data/osm2pgsql-1.3.0+ds/src/lua-utils.hpp Examining data/osm2pgsql-1.3.0+ds/src/middle-pgsql.cpp Examining data/osm2pgsql-1.3.0+ds/src/middle-pgsql.hpp Examining data/osm2pgsql-1.3.0+ds/src/middle-ram.cpp Examining data/osm2pgsql-1.3.0+ds/src/middle-ram.hpp Examining data/osm2pgsql-1.3.0+ds/src/middle.hpp Examining data/osm2pgsql-1.3.0+ds/src/node-persistent-cache.cpp Examining data/osm2pgsql-1.3.0+ds/src/node-persistent-cache.hpp Examining data/osm2pgsql-1.3.0+ds/src/node-ram-cache.cpp Examining data/osm2pgsql-1.3.0+ds/src/node-ram-cache.hpp Examining data/osm2pgsql-1.3.0+ds/src/options.cpp Examining data/osm2pgsql-1.3.0+ds/src/options.hpp Examining data/osm2pgsql-1.3.0+ds/src/osm2pgsql.cpp Examining data/osm2pgsql-1.3.0+ds/src/osmdata.cpp Examining data/osm2pgsql-1.3.0+ds/src/osmdata.hpp Examining data/osm2pgsql-1.3.0+ds/src/osmium-builder.cpp Examining data/osm2pgsql-1.3.0+ds/src/osmium-builder.hpp Examining data/osm2pgsql-1.3.0+ds/src/osmtypes.hpp Examining data/osm2pgsql-1.3.0+ds/src/output-flex.cpp Examining data/osm2pgsql-1.3.0+ds/src/output-flex.hpp Examining data/osm2pgsql-1.3.0+ds/src/output-gazetteer.cpp Examining data/osm2pgsql-1.3.0+ds/src/output-gazetteer.hpp Examining data/osm2pgsql-1.3.0+ds/src/output-multi.cpp Examining data/osm2pgsql-1.3.0+ds/src/output-multi.hpp Examining data/osm2pgsql-1.3.0+ds/src/output-null.cpp Examining data/osm2pgsql-1.3.0+ds/src/output-null.hpp Examining data/osm2pgsql-1.3.0+ds/src/output-pgsql.cpp Examining data/osm2pgsql-1.3.0+ds/src/output-pgsql.hpp Examining data/osm2pgsql-1.3.0+ds/src/output.cpp Examining data/osm2pgsql-1.3.0+ds/src/output.hpp Examining data/osm2pgsql-1.3.0+ds/src/pgsql.cpp Examining data/osm2pgsql-1.3.0+ds/src/pgsql.hpp Examining data/osm2pgsql-1.3.0+ds/src/processor-line.cpp Examining data/osm2pgsql-1.3.0+ds/src/processor-line.hpp Examining data/osm2pgsql-1.3.0+ds/src/processor-point.cpp Examining data/osm2pgsql-1.3.0+ds/src/processor-point.hpp Examining data/osm2pgsql-1.3.0+ds/src/processor-polygon.cpp Examining data/osm2pgsql-1.3.0+ds/src/processor-polygon.hpp Examining data/osm2pgsql-1.3.0+ds/src/progress-display.cpp Examining data/osm2pgsql-1.3.0+ds/src/progress-display.hpp Examining data/osm2pgsql-1.3.0+ds/src/reprojection-generic-none.cpp Examining data/osm2pgsql-1.3.0+ds/src/reprojection-generic-proj4.cpp Examining data/osm2pgsql-1.3.0+ds/src/reprojection.cpp Examining data/osm2pgsql-1.3.0+ds/src/reprojection.hpp Examining data/osm2pgsql-1.3.0+ds/src/sprompt.cpp Examining data/osm2pgsql-1.3.0+ds/src/sprompt.hpp Examining data/osm2pgsql-1.3.0+ds/src/table.cpp Examining data/osm2pgsql-1.3.0+ds/src/table.hpp Examining data/osm2pgsql-1.3.0+ds/src/taginfo-impl.hpp Examining data/osm2pgsql-1.3.0+ds/src/taginfo.cpp Examining data/osm2pgsql-1.3.0+ds/src/taginfo.hpp Examining data/osm2pgsql-1.3.0+ds/src/tagtransform-c.cpp Examining data/osm2pgsql-1.3.0+ds/src/tagtransform-c.hpp Examining data/osm2pgsql-1.3.0+ds/src/tagtransform-lua.cpp Examining data/osm2pgsql-1.3.0+ds/src/tagtransform-lua.hpp Examining data/osm2pgsql-1.3.0+ds/src/tagtransform.cpp Examining data/osm2pgsql-1.3.0+ds/src/tagtransform.hpp Examining data/osm2pgsql-1.3.0+ds/src/thread-pool.hpp Examining data/osm2pgsql-1.3.0+ds/src/util.cpp Examining data/osm2pgsql-1.3.0+ds/src/util.hpp Examining data/osm2pgsql-1.3.0+ds/src/version.hpp Examining data/osm2pgsql-1.3.0+ds/src/wildcmp.cpp Examining data/osm2pgsql-1.3.0+ds/src/wildcmp.hpp Examining data/osm2pgsql-1.3.0+ds/src/wkb.hpp Examining data/osm2pgsql-1.3.0+ds/tests/catch-main.cpp Examining data/osm2pgsql-1.3.0+ds/tests/common-cleanup.hpp Examining data/osm2pgsql-1.3.0+ds/tests/common-import.hpp Examining data/osm2pgsql-1.3.0+ds/tests/common-options.hpp Examining data/osm2pgsql-1.3.0+ds/tests/common-pg.hpp Examining data/osm2pgsql-1.3.0+ds/tests/test-db-copy-mgr.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-db-copy-thread.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-domain-matcher.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-expire-tiles.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-middle.cpp Parsing failed to find end of parameter list; semicolon terminated it in (way.nodes().cbegin(), way.nodes().cend(), nodes.cbegin(), [](osmium::NodeRef const &nr, osmium::Node const *node) { return nr.ref() == node->id() && Examining data/osm2pgsql-1.3.0+ds/tests/test-options-database.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-options-parse.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-options-projection.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-area.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-attr.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-bbox.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-example-configs.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-invalid-geom.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-line.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-lua-fail.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-nodes.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-nogeom.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-relation-changes.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-relation-combinations.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-relations.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-stage2.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-tablespace.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-types.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-uni.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-update.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-validgeom.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-way-add.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-way-change.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-way-del.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-way-relation-add.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex-way-relation-del.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-flex.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-gazetteer.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-line-storage.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-line.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-point-multi-table.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-point.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-poly-trivial.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-polygon.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-multi-tags.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-area.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-hstore-match-only.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-int4.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-schema.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-tablespace.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-validgeom.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql-z_order.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-output-pgsql.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-parse-osmium.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-persistent-cache.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-pgsql.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-ram-cache.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-taginfo.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-util.cpp Examining data/osm2pgsql-1.3.0+ds/tests/test-wildcard-match.cpp FINAL RESULTS: data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h:61:24: [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 FMT_SNPRINTF snprintf data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:182:6: [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. void vprintf(buffer<Char>& buf, basic_string_view<Char> format, data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:190:21: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. FMT_DEPRECATED void printf(detail::buffer<Char>& buf, data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:193:18: [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. return detail::vprintf(buf, format, args); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:195:15: [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. using detail::vprintf; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:634:32: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. inline std::basic_string<Char> vsprintf( data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:638: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(buffer, to_string_view(format), args); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:653:32: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. inline std::basic_string<Char> sprintf(const S& format, const Args&... args) { data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:655:10: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. return vsprintf(to_string_view(format), make_format_args<context>(args...)); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:659:12: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. inline int vfprintf( data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:663: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(buffer, to_string_view(format), args); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:681:12: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. inline int fprintf(std::FILE* f, const S& format, const Args&... args) { data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:683:10: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. return vfprintf(f, to_string_view(format), data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:688:12: [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. inline int vprintf( data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:691:10: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. return vfprintf(stdout, to_string_view(format), args); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:705:12: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. inline int printf(const S& format_str, const Args&... args) { data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:707:10: [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. return vprintf(to_string_view(format_str), data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:712:12: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. inline int vfprintf( data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:716: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(buffer, to_string_view(format), args); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:725:33: [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. typename ArgFormatter::iterator vprintf( data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:743:12: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. inline int fprintf(std::basic_ostream<Char>& os, const S& format_str, data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/printf.h:746:10: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. return vfprintf(os, to_string_view(format_str), data/osm2pgsql-1.3.0+ds/tests/common-cleanup.hpp:39:16: [4] (shell) system: 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. boost::system::error_code ec; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:4592:1: [3] (random) random: 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. random(T a, T b) { data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:4601:1: [3] (random) random: 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. random(T a, T b) { data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:12921:18: [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. std::srand(config.rngSeed()); data/osm2pgsql-1.3.0+ds/src/options.cpp:334:23: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while (-1 != (c = getopt_long(argc, argv, short_options, long_options, data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:101:13: [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. || (getenv("OSTYPE") && strcmp(getenv("OSTYPE"), "msys") == 0) data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:101:40: [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. || (getenv("OSTYPE") && strcmp(getenv("OSTYPE"), "msys") == 0) data/osm2pgsql-1.3.0+ds/tests/common-pg.hpp:114:46: [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. char const *const keep_db = std::getenv("OSM2PGSQL_KEEP_TEST_DB"); data/osm2pgsql-1.3.0+ds/tests/test-output-flex-example-configs.cpp:18:28: [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. char const *env = std::getenv("EXAMPLE_FILES"); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:2128: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 timeStamp[timeStampSize]; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:4406:29: [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. alignas(alignof(T)) char storage[sizeof(T)]; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:5898:16: [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. static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:7504: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). void open(); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:11318:14: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(&i, &f, sizeof(f)); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:11325:14: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(&i, &d, sizeof(d)); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:11867: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 m_buffer[L_tmpnam] = { 0 }; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:11954: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 buffer[100]; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:11963:23: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). m_file = std::tmpfile(); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:11987: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 buffer[100] = {}; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:12450:30: [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). tracker->open(); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13250:31: [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 **utf8Argv = new char *[ argc ]; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13409: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 data[bufferSize]; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13458:23: [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). m_ofs.open( filename.c_str() ); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:14161:23: [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). void TrackerBase::open() { data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:14261:13: [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). open(); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:15445: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 buffer[maxDoubleSize]; data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:15452:14: [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. std::sprintf(buffer, "%.3f", duration); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:16045:10: [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). void open() { data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:16079: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). tp.open(); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:16480: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 timeStamp[timeStampSize]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h:1157: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 format[max_format_size]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h:1346: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[2 * block_size - 1] = {}; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h:1347: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(buf, p, to_unsigned(num_chars_left)); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:250: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 data[sizeof(u)]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:257:12: [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. unsigned char value[sizeof(void*)]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:762:16: [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. static const char reset_color[5]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:763:16: [2] (buffer) wchar_t: 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. static const wchar_t wreset_color[5]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:765:16: [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. static const char left_padding_shifts[5]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:766:16: [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. static const char right_padding_shifts[5]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:888:49: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. inline void copy2(char* dst, const char* src) { memcpy(dst, src, 2); } data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:971: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 buffer[num_bits<UInt>() / BASE_BITS + 1]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:1479: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 prefix[4]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:1569: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 digits[40]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:3015:11: [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. mutable char buffer_[buffer_size]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format.h:3428: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 buffer[max_size > 5 ? max_size : 5]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/os.h:358: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 buffer_[buffer_size]; data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/os.h:392: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(f.buffer_ + f.pos_, buf.data() + remaining_pos, size); data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/os.h:398: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(f.buffer_ + f.pos_, buf.data() + remaining_pos, remaining_size); data/osm2pgsql-1.3.0+ds/src/expire-tiles.cpp:31:11: [2] (misc) fopen: 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). : outfile(fopen(filename, "a")) data/osm2pgsql-1.3.0+ds/src/gazetteer-style.cpp:304:34: [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). m_admin_level = std::atoi(v); data/osm2pgsql-1.3.0+ds/src/gazetteer-style.cpp:462: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 const osm_type[2] = { data/osm2pgsql-1.3.0+ds/src/middle-pgsql.cpp:142: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 key[1024]; data/osm2pgsql-1.3.0+ds/src/middle-pgsql.cpp:143: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 val[1024]; data/osm2pgsql-1.3.0+ds/src/middle-pgsql.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 role[1024]; data/osm2pgsql-1.3.0+ds/src/node-persistent-cache.cpp:58: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). m_fd = open(m_fname, O_RDWR | O_CREAT, 0644); data/osm2pgsql-1.3.0+ds/src/options.cpp:365:58: [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). projection = reprojection::create_projection(atoi(optarg)); data/osm2pgsql-1.3.0+ds/src/options.cpp:377:21: [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). cache = atoi(optarg); data/osm2pgsql-1.3.0+ds/src/options.cpp:516:25: [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). num_procs = atoi(optarg); data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:95:14: [2] (misc) fopen: 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). termin = fopen(DEVTTY, "r"); data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:96:15: [2] (misc) fopen: 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). termout = fopen(DEVTTY, "w"); data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:148: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[128]; data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:111: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 osmtype[24]; data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:112: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 tag[64]; data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:113: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 datatype[24]; data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:114: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 flags[128]; data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:118: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 buffer[1024]; data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:121:10: [2] (misc) fopen: 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). in = fopen(filename.c_str(), "rt"); data/osm2pgsql-1.3.0+ds/src/wkb.hpp:346:9: [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(&data, m_wkb + m_pos, sizeof(T)); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:3677:29: [1] (buffer) is_permutation: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return std::is_permutation(m_target.begin(), m_target.end(), vec.begin()); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13279:36: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static_cast<void>(std::getchar()); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13284:36: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static_cast<void>(std::getchar()); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13581:50: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin()); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13587:50: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin()); data/osm2pgsql-1.3.0+ds/contrib/catch2/include/catch.hpp:13675:67: [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). : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) ) data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h:105:33: [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 (message == buffer_ && strlen(buffer_) == buffer_size_ - 1) data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/format-inl.h:121:29: [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 result == 0 && strlen(buffer_) == buffer_size_ - 1 ? ERANGE data/osm2pgsql-1.3.0+ds/contrib/fmt/include/fmt/os.h:317:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). FMT_API size_t read(void* buffer, size_t count); data/osm2pgsql-1.3.0+ds/src/domain-matcher.hpp:22:33: [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). : m_domain(cls), m_len(std::strlen(cls)) data/osm2pgsql-1.3.0+ds/src/gazetteer-style.cpp:240:28: [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). auto const klen = std::strlen(k); data/osm2pgsql-1.3.0+ds/src/gazetteer-style.cpp:241:28: [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). auto const vlen = std::strlen(v); data/osm2pgsql-1.3.0+ds/src/gazetteer-style.cpp:377:57: [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 ((flag & SF_COUNTRY) && !has_country && std::strlen(v) == 2) { data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:145: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). length = strlen(destination); data/osm2pgsql-1.3.0+ds/src/sprompt.cpp:155:22: [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). buflen = strlen(buf); data/osm2pgsql-1.3.0+ds/src/taginfo.cpp:138:18: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. fields = sscanf(buffer, "%23s %63s %23s %127s", osmtype, tag, datatype, data/osm2pgsql-1.3.0+ds/tests/common-import.hpp:155:42: [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). osmium::io::File file{data, std::strlen(data), format}; data/osm2pgsql-1.3.0+ds/tests/test-middle.cpp:521:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. REQUIRE(std::equal(way.nodes().cbegin(), way.nodes().cend(), nodes.cbegin(), ANALYSIS SUMMARY: Hits = 108 Lines analyzed = 52965 in approximately 1.22 seconds (43321 lines/second) Physical Source Lines of Code (SLOC) = 39650 Hits@level = [0] 63 [1] 18 [2] 59 [3] 8 [4] 23 [5] 0 Hits@level+ = [0+] 171 [1+] 108 [2+] 90 [3+] 31 [4+] 23 [5+] 0 Hits/KSLOC@level+ = [0+] 4.31274 [1+] 2.72383 [2+] 2.26986 [3+] 0.781841 [4+] 0.580076 [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.