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/geographiclib-1.51/include/GeographicLib/GeodesicExact.hpp Examining data/geographiclib-1.51/include/GeographicLib/Geoid.hpp Examining data/geographiclib-1.51/include/GeographicLib/Gnomonic.hpp Examining data/geographiclib-1.51/include/GeographicLib/EllipticFunction.hpp Examining data/geographiclib-1.51/include/GeographicLib/SphericalHarmonic.hpp Examining data/geographiclib-1.51/include/GeographicLib/Geocentric.hpp Examining data/geographiclib-1.51/include/GeographicLib/AlbersEqualArea.hpp Examining data/geographiclib-1.51/include/GeographicLib/CassiniSoldner.hpp Examining data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp Examining data/geographiclib-1.51/include/GeographicLib/Georef.hpp Examining data/geographiclib-1.51/include/GeographicLib/UTMUPS.hpp Examining data/geographiclib-1.51/include/GeographicLib/OSGB.hpp Examining data/geographiclib-1.51/include/GeographicLib/Constants.hpp Examining data/geographiclib-1.51/include/GeographicLib/PolygonArea.hpp Examining data/geographiclib-1.51/include/GeographicLib/MagneticModel.hpp Examining data/geographiclib-1.51/include/GeographicLib/GeoCoords.hpp Examining data/geographiclib-1.51/include/GeographicLib/SphericalHarmonic1.hpp Examining data/geographiclib-1.51/include/GeographicLib/MGRS.hpp Examining data/geographiclib-1.51/include/GeographicLib/Math.hpp Examining data/geographiclib-1.51/include/GeographicLib/GeodesicLineExact.hpp Examining data/geographiclib-1.51/include/GeographicLib/GARS.hpp Examining data/geographiclib-1.51/include/GeographicLib/Config.h Examining data/geographiclib-1.51/include/GeographicLib/SphericalEngine.hpp Examining data/geographiclib-1.51/include/GeographicLib/Geodesic.hpp Examining data/geographiclib-1.51/include/GeographicLib/DMS.hpp Examining data/geographiclib-1.51/include/GeographicLib/AzimuthalEquidistant.hpp Examining data/geographiclib-1.51/include/GeographicLib/TransverseMercator.hpp Examining data/geographiclib-1.51/include/GeographicLib/TransverseMercatorExact.hpp Examining data/geographiclib-1.51/include/GeographicLib/Utility.hpp Examining data/geographiclib-1.51/include/GeographicLib/NormalGravity.hpp Examining data/geographiclib-1.51/include/GeographicLib/Ellipsoid.hpp Examining data/geographiclib-1.51/include/GeographicLib/PolarStereographic.hpp Examining data/geographiclib-1.51/include/GeographicLib/Rhumb.hpp Examining data/geographiclib-1.51/include/GeographicLib/LocalCartesian.hpp Examining data/geographiclib-1.51/include/GeographicLib/MagneticCircle.hpp Examining data/geographiclib-1.51/include/GeographicLib/Geohash.hpp Examining data/geographiclib-1.51/include/GeographicLib/SphericalHarmonic2.hpp Examining data/geographiclib-1.51/include/GeographicLib/GravityModel.hpp Examining data/geographiclib-1.51/include/GeographicLib/GeodesicLine.hpp Examining data/geographiclib-1.51/include/GeographicLib/LambertConformalConic.hpp Examining data/geographiclib-1.51/include/GeographicLib/GravityCircle.hpp Examining data/geographiclib-1.51/include/GeographicLib/Accumulator.hpp Examining data/geographiclib-1.51/include/GeographicLib/CircularEngine.hpp Examining data/geographiclib-1.51/legacy/C/inverse.c Examining data/geographiclib-1.51/legacy/C/geodesic.c Examining data/geographiclib-1.51/legacy/C/planimeter.c Examining data/geographiclib-1.51/legacy/C/geodesic.h Examining data/geographiclib-1.51/legacy/C/geodtest.c Examining data/geographiclib-1.51/legacy/C/direct.c Examining data/geographiclib-1.51/examples/example-GeodesicExact.cpp Examining data/geographiclib-1.51/examples/example-UTMUPS.cpp Examining data/geographiclib-1.51/examples/example-Accumulator.cpp Examining data/geographiclib-1.51/examples/example-Geodesic-small.cpp Examining data/geographiclib-1.51/examples/example-Georef.cpp Examining data/geographiclib-1.51/examples/example-LambertConformalConic.cpp Examining data/geographiclib-1.51/examples/example-AzimuthalEquidistant.cpp Examining data/geographiclib-1.51/examples/example-Gnomonic.cpp Examining data/geographiclib-1.51/examples/example-PolarStereographic.cpp Examining data/geographiclib-1.51/examples/example-DMS.cpp Examining data/geographiclib-1.51/examples/example-RhumbLine.cpp Examining data/geographiclib-1.51/examples/example-MagneticModel.cpp Examining data/geographiclib-1.51/examples/example-GeodesicLineExact.cpp Examining data/geographiclib-1.51/examples/JacobiConformal.cpp Examining data/geographiclib-1.51/examples/example-OSGB.cpp Examining data/geographiclib-1.51/examples/make-egmcof.cpp Examining data/geographiclib-1.51/examples/example-SphericalEngine.cpp Examining data/geographiclib-1.51/examples/example-GARS.cpp Examining data/geographiclib-1.51/examples/example-NearestNeighbor.cpp Examining data/geographiclib-1.51/examples/example-Geohash.cpp Examining data/geographiclib-1.51/examples/example-Constants.cpp Examining data/geographiclib-1.51/examples/JacobiConformal.hpp Examining data/geographiclib-1.51/examples/example-TransverseMercator.cpp Examining data/geographiclib-1.51/examples/example-Geoid.cpp Examining data/geographiclib-1.51/examples/example-CircularEngine.cpp Examining data/geographiclib-1.51/examples/example-Geodesic.cpp Examining data/geographiclib-1.51/examples/example-GeographicErr.cpp Examining data/geographiclib-1.51/examples/example-TransverseMercatorExact.cpp Examining data/geographiclib-1.51/examples/example-Math.cpp Examining data/geographiclib-1.51/examples/example-SphericalHarmonic2.cpp Examining data/geographiclib-1.51/examples/example-EllipticFunction.cpp Examining data/geographiclib-1.51/examples/example-NormalGravity.cpp Examining data/geographiclib-1.51/examples/example-GravityCircle.cpp Examining data/geographiclib-1.51/examples/example-AlbersEqualArea.cpp Examining data/geographiclib-1.51/examples/example-MGRS.cpp Examining data/geographiclib-1.51/examples/example-SphericalHarmonic1.cpp Examining data/geographiclib-1.51/examples/GeoidToGTX.cpp Examining data/geographiclib-1.51/examples/example-GeoCoords.cpp Examining data/geographiclib-1.51/examples/example-LocalCartesian.cpp Examining data/geographiclib-1.51/examples/example-MagneticCircle.cpp Examining data/geographiclib-1.51/examples/example-Utility.cpp Examining data/geographiclib-1.51/examples/example-GravityModel.cpp Examining data/geographiclib-1.51/examples/example-CassiniSoldner.cpp Examining data/geographiclib-1.51/examples/example-Ellipsoid.cpp Examining data/geographiclib-1.51/examples/example-Rhumb.cpp Examining data/geographiclib-1.51/examples/example-PolygonArea.cpp Examining data/geographiclib-1.51/examples/example-Geocentric.cpp Examining data/geographiclib-1.51/examples/example-SphericalHarmonic.cpp Examining data/geographiclib-1.51/examples/example-GeodesicLine.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GeodesicExact.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-UTMUPS.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Accumulator.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Geodesic-small.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Georef.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-LambertConformalConic.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-AzimuthalEquidistant.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Gnomonic.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-PolarStereographic.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-DMS.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-RhumbLine.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-MagneticModel.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GeodesicLineExact.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-OSGB.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GARS.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Geohash.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-TransverseMercator.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Geoid.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-CircularEngine.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Geodesic.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-TransverseMercatorExact.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-SphericalHarmonic2.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-EllipticFunction.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-NormalGravity.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GravityCircle.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-MGRS.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-SphericalHarmonic1.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GeoCoords.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-LocalCartesian.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-MagneticCircle.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GravityModel.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-CassiniSoldner.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Ellipsoid.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Rhumb.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-PolygonArea.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-Geocentric.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-SphericalHarmonic.cpp Examining data/geographiclib-1.51/dotnet/examples/ManagedCPP/example-GeodesicLine.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/EllipticFunction.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geohash.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalHarmonic2.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalHarmonic1.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/AzimuthalEquidistant.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/CircularEngine.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/MagneticCircle.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geocentric.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/PolygonArea.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/NETGeographicLib.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalHarmonic1.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/stdafx.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/LambertConformalConic.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GARS.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GravityModel.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/OSGB.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/stdafx.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/PolarStereographic.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/CassiniSoldner.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeodesicExact.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Ellipsoid.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geodesic.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/LambertConformalConic.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/MagneticCircle.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalCoefficients.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalHarmonic.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/UTMUPS.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/AlbersEqualArea.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/DMS.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geodesic.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GravityModel.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/CassiniSoldner.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GARS.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Rhumb.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/DMS.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/MagneticModel.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeodesicExact.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/NormalGravity.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/AlbersEqualArea.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/UTMUPS.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/TransverseMercator.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/MGRS.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/LocalCartesian.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geohash.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/TransverseMercator.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Gnomonic.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Georef.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GravityCircle.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeodesicLineExact.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Georef.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalHarmonic2.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/AzimuthalEquidistant.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geoid.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Rhumb.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeoCoords.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/AssemblyInfo.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/EllipticFunction.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/LocalCartesian.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/CircularEngine.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/PolygonArea.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geocentric.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeoCoords.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GravityCircle.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalHarmonic.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Gnomonic.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/NETGeographicLib.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Accumulator.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Ellipsoid.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeodesicLine.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/MagneticModel.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/OSGB.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/PolarStereographic.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Accumulator.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/NormalGravity.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeodesicLineExact.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/Geoid.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/MGRS.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/GeodesicLine.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/TransverseMercatorExact.cpp Examining data/geographiclib-1.51/dotnet/NETGeographicLib/TransverseMercatorExact.h Examining data/geographiclib-1.51/dotnet/NETGeographicLib/SphericalCoefficients.cpp Examining data/geographiclib-1.51/wrapper/python/PyGeographicLib.cpp Examining data/geographiclib-1.51/wrapper/matlab/geodesicinverse.cpp Examining data/geographiclib-1.51/wrapper/C/cgeoid.h Examining data/geographiclib-1.51/wrapper/C/cgeoid.cpp Examining data/geographiclib-1.51/wrapper/C/geoidtest.c Examining data/geographiclib-1.51/tools/GeodesicProj.cpp Examining data/geographiclib-1.51/tools/Planimeter.cpp Examining data/geographiclib-1.51/tools/GeoConvert.cpp Examining data/geographiclib-1.51/tools/CartConvert.cpp Examining data/geographiclib-1.51/tools/TransverseMercatorProj.cpp Examining data/geographiclib-1.51/tools/RhumbSolve.cpp Examining data/geographiclib-1.51/tools/MagneticField.cpp Examining data/geographiclib-1.51/tools/Gravity.cpp Examining data/geographiclib-1.51/tools/GeodSolve.cpp Examining data/geographiclib-1.51/tools/GeoidEval.cpp Examining data/geographiclib-1.51/tools/ConicProj.cpp Examining data/geographiclib-1.51/src/GeodesicExactC4.cpp Examining data/geographiclib-1.51/src/EllipticFunction.cpp Examining data/geographiclib-1.51/src/MagneticCircle.cpp Examining data/geographiclib-1.51/src/PolygonArea.cpp Examining data/geographiclib-1.51/src/Utility.cpp Examining data/geographiclib-1.51/src/PolarStereographic.cpp Examining data/geographiclib-1.51/src/CassiniSoldner.cpp Examining data/geographiclib-1.51/src/GeodesicExact.cpp Examining data/geographiclib-1.51/src/Ellipsoid.cpp Examining data/geographiclib-1.51/src/LambertConformalConic.cpp Examining data/geographiclib-1.51/src/UTMUPS.cpp Examining data/geographiclib-1.51/src/Math.cpp Examining data/geographiclib-1.51/src/Geodesic.cpp Examining data/geographiclib-1.51/src/GravityModel.cpp Examining data/geographiclib-1.51/src/GARS.cpp Examining data/geographiclib-1.51/src/DMS.cpp Examining data/geographiclib-1.51/src/SphericalEngine.cpp Examining data/geographiclib-1.51/src/NormalGravity.cpp Examining data/geographiclib-1.51/src/AlbersEqualArea.cpp Examining data/geographiclib-1.51/src/TransverseMercator.cpp Examining data/geographiclib-1.51/src/LocalCartesian.cpp Examining data/geographiclib-1.51/src/Geohash.cpp Examining data/geographiclib-1.51/src/Gnomonic.cpp Examining data/geographiclib-1.51/src/GeodesicLineExact.cpp Examining data/geographiclib-1.51/src/Georef.cpp Examining data/geographiclib-1.51/src/AzimuthalEquidistant.cpp Examining data/geographiclib-1.51/src/Rhumb.cpp Examining data/geographiclib-1.51/src/GeoCoords.cpp Examining data/geographiclib-1.51/src/CircularEngine.cpp Examining data/geographiclib-1.51/src/Geocentric.cpp Examining data/geographiclib-1.51/src/GravityCircle.cpp Examining data/geographiclib-1.51/src/Accumulator.cpp Examining data/geographiclib-1.51/src/MagneticModel.cpp Examining data/geographiclib-1.51/src/OSGB.cpp Examining data/geographiclib-1.51/src/Geoid.cpp Examining data/geographiclib-1.51/src/MGRS.cpp Examining data/geographiclib-1.51/src/GeodesicLine.cpp Examining data/geographiclib-1.51/src/TransverseMercatorExact.cpp FINAL RESULTS: data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:663:42: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. friend class boost::serialization::access; data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:692:40: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. friend class boost::serialization::access; data/geographiclib-1.51/src/Geoid.cpp:491:23: [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* geoidpath = getenv("GEOGRAPHICLIB_GEOID_PATH"); data/geographiclib-1.51/src/Geoid.cpp:496:22: [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* datapath = getenv("GEOGRAPHICLIB_DATA"); data/geographiclib-1.51/src/Geoid.cpp:504:23: [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* geoidname = getenv("GEOGRAPHICLIB_GEOID_NAME"); data/geographiclib-1.51/src/GravityModel.cpp:358:25: [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* gravitypath = getenv("GEOGRAPHICLIB_GRAVITY_PATH"); data/geographiclib-1.51/src/GravityModel.cpp:363:22: [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* datapath = getenv("GEOGRAPHICLIB_DATA"); data/geographiclib-1.51/src/GravityModel.cpp:371:25: [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* gravityname = getenv("GEOGRAPHICLIB_GRAVITY_NAME"); data/geographiclib-1.51/src/MagneticModel.cpp:262:26: [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* magneticpath = getenv("GEOGRAPHICLIB_MAGNETIC_PATH"); data/geographiclib-1.51/src/MagneticModel.cpp:267:22: [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* datapath = getenv("GEOGRAPHICLIB_DATA"); data/geographiclib-1.51/src/MagneticModel.cpp:275:26: [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* magneticname = getenv("GEOGRAPHICLIB_MAGNETIC_NAME"); data/geographiclib-1.51/src/Utility.cpp:44:24: [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* digitenv = getenv("GEOGRAPHICLIB_DIGITS"); data/geographiclib-1.51/include/GeographicLib/Math.hpp:657:18: [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 c[sizeof(T)]; data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:455: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 id[17]; data/geographiclib-1.51/src/GARS.cpp:39: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 gars1[maxlen_]; data/geographiclib-1.51/src/Geohash.cpp:41: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 geohash1[maxlen_]; data/geographiclib-1.51/src/Geoid.cpp:216:11: [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). _file.open(_filename.c_str(), ios::binary); data/geographiclib-1.51/src/Georef.cpp:44: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 georef1[maxlen_]; data/geographiclib-1.51/src/GravityModel.cpp:66: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 id[idlength_ + 1]; data/geographiclib-1.51/src/MGRS.cpp:60: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 mgrs1[2 + 3 + 2 * maxprec_]; data/geographiclib-1.51/src/MagneticModel.cpp:73: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 id[idlength_ + 1]; data/geographiclib-1.51/src/OSGB.cpp:45: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 grid[2 + 2 * maxprec_]; data/geographiclib-1.51/src/OSGB.cpp:101: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 grid[2 + 2 * maxprec_]; data/geographiclib-1.51/tools/CartConvert.cpp:117: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/CartConvert.cpp:138:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/ConicProj.cpp:145: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/ConicProj.cpp:166:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/GeoConvert.cpp:149: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/GeoConvert.cpp:170:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/GeodSolve.cpp:213: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/GeodSolve.cpp:234:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/GeodesicProj.cpp:123: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/GeodesicProj.cpp:144:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/GeoidEval.cpp:137: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/GeoidEval.cpp:158:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/Gravity.cpp:165: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/Gravity.cpp:186:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/MagneticField.cpp:187: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/MagneticField.cpp:208:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/Planimeter.cpp:117: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/Planimeter.cpp:138:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/RhumbSolve.cpp:148: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/RhumbSolve.cpp:169:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/tools/TransverseMercatorProj.cpp:139: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). infile.open(ifile.c_str()); data/geographiclib-1.51/tools/TransverseMercatorProj.cpp:160:15: [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). outfile.open(ofile.c_str()); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:456:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(id, 16); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:460:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&version1), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:461:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&realspec), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:462:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&bucket), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:463:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&numpoints), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:464:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&treesize), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:465:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&cost), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:488:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(&node.index), sizeof(int)); data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:490:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(node.data.lower), data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:492:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(node.data.upper), data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:494:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(node.data.child), data/geographiclib-1.51/include/GeographicLib/NearestNeighbor.hpp:497:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(reinterpret_cast<char *>(node.leaves), data/geographiclib-1.51/include/GeographicLib/Utility.hpp:503:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). str.read(reinterpret_cast<char*>(array), num * sizeof(ExtT)); data/geographiclib-1.51/include/GeographicLib/Utility.hpp:520:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). str.read(reinterpret_cast<char*>(buffer), n * sizeof(ExtT)); data/geographiclib-1.51/src/GravityModel.cpp:67:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). coeffstr.read(id, idlength_); data/geographiclib-1.51/src/MagneticModel.cpp:74:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). coeffstr.read(id, idlength_); ANALYSIS SUMMARY: Hits = 61 Lines analyzed = 66876 in approximately 2.37 seconds (28200 lines/second) Physical Source Lines of Code (SLOC) = 35118 Hits@level = [0] 50 [1] 16 [2] 33 [3] 10 [4] 2 [5] 0 Hits@level+ = [0+] 111 [1+] 61 [2+] 45 [3+] 12 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 3.16077 [1+] 1.737 [2+] 1.28139 [3+] 0.341705 [4+] 0.0569509 [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.