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/osmcoastline-2.2.4/include/gdalcpp.hpp Examining data/osmcoastline-2.2.4/src/coastline_polygons.cpp Examining data/osmcoastline-2.2.4/src/coastline_polygons.hpp Examining data/osmcoastline-2.2.4/src/coastline_ring.cpp Examining data/osmcoastline-2.2.4/src/coastline_ring.hpp Examining data/osmcoastline-2.2.4/src/coastline_ring_collection.cpp Examining data/osmcoastline-2.2.4/src/coastline_ring_collection.hpp Examining data/osmcoastline-2.2.4/src/nodegrid2opl.cpp Examining data/osmcoastline-2.2.4/src/options.cpp Examining data/osmcoastline-2.2.4/src/options.hpp Examining data/osmcoastline-2.2.4/src/osmcoastline.cpp Examining data/osmcoastline-2.2.4/src/osmcoastline_filter.cpp Examining data/osmcoastline-2.2.4/src/osmcoastline_segments.cpp Examining data/osmcoastline-2.2.4/src/osmcoastline_ways.cpp Examining data/osmcoastline-2.2.4/src/output_database.cpp Examining data/osmcoastline-2.2.4/src/output_database.hpp Examining data/osmcoastline-2.2.4/src/return_codes.hpp Examining data/osmcoastline-2.2.4/src/srs.cpp Examining data/osmcoastline-2.2.4/src/srs.hpp Examining data/osmcoastline-2.2.4/src/stats.hpp Examining data/osmcoastline-2.2.4/src/util.hpp Examining data/osmcoastline-2.2.4/src/version.hpp FINAL RESULTS: data/osmcoastline-2.2.4/src/options.cpp:57: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. const int c = getopt_long(argc, argv, "b:c:idhlm:o:p:rfs:S:vV", long_options, nullptr); data/osmcoastline-2.2.4/src/osmcoastline_filter.cpp:72: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. const int c = getopt_long(argc, argv, "ho:vV", long_options, nullptr); data/osmcoastline-2.2.4/src/osmcoastline_segments.cpp:128: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. const int c = getopt_long(argc, argv, "df:g:hV", long_options, nullptr); data/osmcoastline-2.2.4/src/options.cpp:67:39: [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). close_distance = std::atoi(optarg); // NOLINT(cert-err34-c) atoi is good enough for this use case data/osmcoastline-2.2.4/src/options.cpp:86:46: [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). max_points_in_polygon = std::atoi(optarg); // NOLINT(cert-err34-c) atoi is good enough for this use case data/osmcoastline-2.2.4/src/osmcoastline.cpp:194:25: [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). segments_fd = ::open(options.segmentfile.c_str(), O_WRONLY | O_CREAT, 0666); // NOLINT(hicpp-signed-bitwise) data/osmcoastline-2.2.4/src/osmcoastline_segments.cpp:62: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). m_fd(::open(filename.c_str(), O_RDONLY)) { data/osmcoastline-2.2.4/src/osmcoastline.cpp:229:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (const auto buffer = reader1.read()) { data/osmcoastline-2.2.4/src/osmcoastline.cpp:262:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (const auto buffer = reader2.read()) { ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 4207 in approximately 0.12 seconds (36070 lines/second) Physical Source Lines of Code (SLOC) = 2706 Hits@level = [0] 0 [1] 2 [2] 4 [3] 3 [4] 0 [5] 0 Hits@level+ = [0+] 9 [1+] 9 [2+] 7 [3+] 3 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 3.32594 [1+] 3.32594 [2+] 2.58684 [3+] 1.10865 [4+] 0 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.