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/sdformat-9.3.0+ds/test/integration/fixed_joint_reduction.cc Examining data/sdformat-9.3.0+ds/test/integration/frame.cc Examining data/sdformat-9.3.0+ds/test/integration/material_pbr.cc Examining data/sdformat-9.3.0+ds/test/integration/unknown.cc Examining data/sdformat-9.3.0+ds/test/integration/plugin_include.cc Examining data/sdformat-9.3.0+ds/test/integration/joint_axis_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/link_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/light_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/link_light.cc Examining data/sdformat-9.3.0+ds/test/integration/joint_axis_frame.cc Examining data/sdformat-9.3.0+ds/test/integration/force_torque_sensor.cc Examining data/sdformat-9.3.0+ds/test/integration/world_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/deprecated_specs.cc Examining data/sdformat-9.3.0+ds/test/integration/joint_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/plugin_attribute.cc Examining data/sdformat-9.3.0+ds/test/integration/model_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/locale_fix.cc Examining data/sdformat-9.3.0+ds/test/integration/visual_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/cfm_damping_implicit_spring_damper.cc Examining data/sdformat-9.3.0+ds/test/integration/plugin_bool.cc Examining data/sdformat-9.3.0+ds/test/integration/include.cc Examining data/sdformat-9.3.0+ds/test/integration/urdf_gazebo_extensions.cc Examining data/sdformat-9.3.0+ds/test/integration/collision_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/root_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/model_versions.cc Examining data/sdformat-9.3.0+ds/test/integration/audio.cc Examining data/sdformat-9.3.0+ds/test/integration/geometry_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/disable_fixed_joint_reduction.cc Examining data/sdformat-9.3.0+ds/test/integration/sdf_basic.cc Examining data/sdformat-9.3.0+ds/test/integration/includes.cc Examining data/sdformat-9.3.0+ds/test/integration/category_bitmask.cc Examining data/sdformat-9.3.0+ds/test/integration/surface_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/locale_fix_cxx.cc Examining data/sdformat-9.3.0+ds/test/integration/nested_model.cc Examining data/sdformat-9.3.0+ds/test/integration/schema_test.cc Examining data/sdformat-9.3.0+ds/test/integration/provide_feedback.cc Examining data/sdformat-9.3.0+ds/test/integration/urdf_joint_parameters.cc Examining data/sdformat-9.3.0+ds/test/integration/sdf_custom.cc Examining data/sdformat-9.3.0+ds/test/integration/parser_error_detection.cc Examining data/sdformat-9.3.0+ds/test/integration/actor_dom.cc Examining data/sdformat-9.3.0+ds/test/integration/element_memory_leak.cc Examining data/sdformat-9.3.0+ds/test/integration/converter.cc Examining data/sdformat-9.3.0+ds/test/performance/parser_urdf.cc Examining data/sdformat-9.3.0+ds/src/Plane.cc Examining data/sdformat-9.3.0+ds/src/parser.cc Examining data/sdformat-9.3.0+ds/src/Magnetometer.cc Examining data/sdformat-9.3.0+ds/src/Material_TEST.cc Examining data/sdformat-9.3.0+ds/src/Physics_TEST.cc Examining data/sdformat-9.3.0+ds/src/Light_TEST.cc Examining data/sdformat-9.3.0+ds/src/Noise.cc Examining data/sdformat-9.3.0+ds/src/Altimeter_TEST.cc Examining data/sdformat-9.3.0+ds/src/SDF_TEST.cc Examining data/sdformat-9.3.0+ds/src/ign_TEST.cc Examining data/sdformat-9.3.0+ds/src/Collision.cc Examining data/sdformat-9.3.0+ds/src/Surface_TEST.cc Examining data/sdformat-9.3.0+ds/src/parser_urdf_TEST.cc Examining data/sdformat-9.3.0+ds/src/SDFExtension.cc Examining data/sdformat-9.3.0+ds/src/Lidar.cc Examining data/sdformat-9.3.0+ds/src/Visual_TEST.cc Examining data/sdformat-9.3.0+ds/src/Imu.cc Examining data/sdformat-9.3.0+ds/src/Root.cc Examining data/sdformat-9.3.0+ds/src/Mesh.cc Examining data/sdformat-9.3.0+ds/src/Sphere_TEST.cc Examining data/sdformat-9.3.0+ds/src/Converter.cc Examining data/sdformat-9.3.0+ds/src/Cylinder_TEST.cc Examining data/sdformat-9.3.0+ds/src/Box_TEST.cc Examining data/sdformat-9.3.0+ds/src/World.cc Examining data/sdformat-9.3.0+ds/src/Root_TEST.cc Examining data/sdformat-9.3.0+ds/src/Frame.cc Examining data/sdformat-9.3.0+ds/src/Camera.cc Examining data/sdformat-9.3.0+ds/src/Exception.cc Examining data/sdformat-9.3.0+ds/src/Link_TEST.cc Examining data/sdformat-9.3.0+ds/src/Error_TEST.cc Examining data/sdformat-9.3.0+ds/src/Actor.cc Examining data/sdformat-9.3.0+ds/src/Mesh_TEST.cc Examining data/sdformat-9.3.0+ds/src/Converter_TEST.cc Examining data/sdformat-9.3.0+ds/src/FrameSemantics.cc Examining data/sdformat-9.3.0+ds/src/Collision_TEST.cc Examining data/sdformat-9.3.0+ds/src/Gui.cc Examining data/sdformat-9.3.0+ds/src/Joint.cc Examining data/sdformat-9.3.0+ds/src/Visual.cc Examining data/sdformat-9.3.0+ds/src/Scene.cc Examining data/sdformat-9.3.0+ds/src/Utils_TEST.cc Examining data/sdformat-9.3.0+ds/src/Box.cc Examining data/sdformat-9.3.0+ds/src/JointAxis_TEST.cc Examining data/sdformat-9.3.0+ds/src/Pbr_TEST.cc Examining data/sdformat-9.3.0+ds/src/Camera_TEST.cc Examining data/sdformat-9.3.0+ds/src/Cylinder.cc Examining data/sdformat-9.3.0+ds/src/FrameSemantics_TEST.cc Examining data/sdformat-9.3.0+ds/src/Element_TEST.cc Examining data/sdformat-9.3.0+ds/src/Scene_TEST.cc Examining data/sdformat-9.3.0+ds/src/SemanticPose_TEST.cc Examining data/sdformat-9.3.0+ds/src/Plane_TEST.cc Examining data/sdformat-9.3.0+ds/src/SDF.cc Examining data/sdformat-9.3.0+ds/src/Sensor_TEST.cc Examining data/sdformat-9.3.0+ds/src/Atmosphere.cc Examining data/sdformat-9.3.0+ds/src/Imu_TEST.cc Examining data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.cpp Examining data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h Examining data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp Examining data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h Examining data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlerror.cpp Examining data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp Examining data/sdformat-9.3.0+ds/src/Link.cc Examining data/sdformat-9.3.0+ds/src/Surface.cc Examining data/sdformat-9.3.0+ds/src/Joint_TEST.cc Examining data/sdformat-9.3.0+ds/src/Altimeter.cc Examining data/sdformat-9.3.0+ds/src/Geometry_TEST.cc Examining data/sdformat-9.3.0+ds/src/Model.cc Examining data/sdformat-9.3.0+ds/src/AirPressure_TEST.cc Examining data/sdformat-9.3.0+ds/src/urdf/urdf_exception/exception.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/pose.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/twist.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/model.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/joint.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/color.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/types.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/link.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model/utils.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model_state/twist.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model_state/types.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_model_state/model_state.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_world/world.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_world/types.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/twist.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/urdf_parser.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/joint.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/model.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/exportdecl.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/link.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/world.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/pose.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/check_urdf.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/urdf_sensor.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/urdf_to_graphiz.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_parser/urdf_model_state.cpp Examining data/sdformat-9.3.0+ds/src/urdf/urdf_sensor/types.h Examining data/sdformat-9.3.0+ds/src/urdf/urdf_sensor/sensor.h Examining data/sdformat-9.3.0+ds/src/Noise_TEST.cc Examining data/sdformat-9.3.0+ds/src/Model_TEST.cc Examining data/sdformat-9.3.0+ds/src/parser_urdf.cc Examining data/sdformat-9.3.0+ds/src/SemanticPose.cc Examining data/sdformat-9.3.0+ds/src/World_TEST.cc Examining data/sdformat-9.3.0+ds/src/Param_TEST.cc Examining data/sdformat-9.3.0+ds/src/Material.cc Examining data/sdformat-9.3.0+ds/src/Magnetometer_TEST.cc Examining data/sdformat-9.3.0+ds/src/Element.cc Examining data/sdformat-9.3.0+ds/src/Console_TEST.cc Examining data/sdformat-9.3.0+ds/src/Types_TEST.cc Examining data/sdformat-9.3.0+ds/src/JointAxis.cc Examining data/sdformat-9.3.0+ds/src/Types.cc Examining data/sdformat-9.3.0+ds/src/parser_TEST.cc Examining data/sdformat-9.3.0+ds/src/Exception_TEST.cc Examining data/sdformat-9.3.0+ds/src/Pbr.cc Examining data/sdformat-9.3.0+ds/src/Light.cc Examining data/sdformat-9.3.0+ds/src/Sensor.cc Examining data/sdformat-9.3.0+ds/src/Utils.cc Examining data/sdformat-9.3.0+ds/src/Atmosphere_TEST.cc Examining data/sdformat-9.3.0+ds/src/Sphere.cc Examining data/sdformat-9.3.0+ds/src/Geometry.cc Examining data/sdformat-9.3.0+ds/src/Frame_TEST.cc Examining data/sdformat-9.3.0+ds/src/AirPressure.cc Examining data/sdformat-9.3.0+ds/src/Console.cc Examining data/sdformat-9.3.0+ds/src/Actor_TEST.cc Examining data/sdformat-9.3.0+ds/src/Error.cc Examining data/sdformat-9.3.0+ds/src/Physics.cc Examining data/sdformat-9.3.0+ds/src/Gui_TEST.cc Examining data/sdformat-9.3.0+ds/src/Param.cc Examining data/sdformat-9.3.0+ds/src/Lidar_TEST.cc Examining data/sdformat-9.3.0+ds/src/ign.cc Examining data/sdformat-9.3.0+ds/src/Filesystem.cc Examining data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc Examining data/sdformat-9.3.0+ds/examples/simple.cc Examining data/sdformat-9.3.0+ds/examples/dom.cc FINAL RESULTS: data/sdformat-9.3.0+ds/src/ign_TEST.cc:29:11: [4] (shell) popen: 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. #define popen _popen data/sdformat-9.3.0+ds/src/ign_TEST.cc:41:16: [4] (shell) popen: 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. FILE *pipe = popen(_cmd.c_str(), "r"); data/sdformat-9.3.0+ds/src/urdf/urdf_parser/urdf_to_graphiz.cpp:117:7: [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. if (system(command.c_str()) != -1) data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h:70:26: [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 TIXML_SNPRINTF _snprintf data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h:71:26: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. #define TIXML_SSCANF sscanf data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h:75:26: [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 TIXML_SNPRINTF snprintf data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h:76:26: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. #define TIXML_SSCANF sscanf data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h:78:26: [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 TIXML_SNPRINTF snprintf data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.h:79:26: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. #define TIXML_SSCANF sscanf data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:36: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. # define TIXML_LOG printf data/sdformat-9.3.0+ds/test/integration/element_memory_leak.cc:34:16: [4] (shell) popen: 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. FILE *pipe = popen(_cmd.c_str(), "r"); data/sdformat-9.3.0+ds/test/integration/locale_fix.cc:38:14: [4] (shell) popen: 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. FILE *fp = popen("locale -a | grep '^es\\|^pt_\\|^it_' | head -n 1", "r"); data/sdformat-9.3.0+ds/test/integration/schema_test.cc:53:11: [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. if (system(xmllintCmd.c_str()) != 0) data/sdformat-9.3.0+ds/src/Console.cc:50:27: [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. const char *home = std::getenv("HOME"); data/sdformat-9.3.0+ds/src/Console_TEST.cc:33:21: [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. const char *tmp = getenv("TMPDIR"); data/sdformat-9.3.0+ds/src/Filesystem.cc:141:11: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(buf.data(), resolved) != nullptr) data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc:37:21: [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. const char *tmp = getenv("TMPDIR"); data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc:60:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(dtemp, resolved) == nullptr) data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc:120: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(static_cast<uint32_t>(time(nullptr))); data/sdformat-9.3.0+ds/src/SDF.cc:128:31: [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. const char *pathCStr = std::getenv("SDF_PATH"); data/sdformat-9.3.0+ds/src/SDF_TEST.cc:646:21: [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. const char *tmp = getenv("TMPDIR"); data/sdformat-9.3.0+ds/src/ign_TEST.cc:729:35: [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 *currentLibraryPath = std::getenv("LD_LIBRARY_PATH"); data/sdformat-9.3.0+ds/src/Console.cc:74:32: [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). this->dataPtr->logFileStream.open(logFile.c_str(), std::ios::out); data/sdformat-9.3.0+ds/src/Console_TEST.cc:76: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). FILE *fp = fopen(sdf_file.c_str(), "w"); data/sdformat-9.3.0+ds/src/Filesystem.cc:139: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 resolved[PATH_MAX]; data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc:59: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 resolved[PATH_MAX]; data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc:73: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). int fd = open(_filename.c_str(), O_RDWR | O_CREAT, 0644); data/sdformat-9.3.0+ds/src/Filesystem_TEST.cc:113: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 temp_path[MAX_PATH + 1]; data/sdformat-9.3.0+ds/src/SDF_TEST.cc:691:13: [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). auto fp = fopen(tempFile.c_str(), "r"); data/sdformat-9.3.0+ds/src/ign_TEST.cc:46: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[128]; data/sdformat-9.3.0+ds/src/urdf/urdf_parser/urdf_to_graphiz.cpp:72:6: [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). os.open(file.c_str()); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.cpp:43: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(tmp.start(), data(), length()); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.cpp:56: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(tmp.start(), str, len); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:74: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(start(), copy.data(), length()); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:81: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(start(), copy, length()); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:88: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(start(), str, len); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:214: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 str[1]; data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:48: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). return fopen( filename, mode ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:89:4: [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[ 32 ]; data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:94: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( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:1227:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [64]; data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:1231:3: [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 (buf, "%d", _value); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:1238:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [256]; data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:1242:3: [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 (buf, "%g", _value); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:1249:9: [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 (value.c_str ()); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:597:4: [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 cArr[4] = { 0, 0, 0, 0 }; data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:631: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 cArr[4] = { 0, 0, 0, 0 }; data/sdformat-9.3.0+ds/test/integration/element_memory_leak.cc:42: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[128]; data/sdformat-9.3.0+ds/test/integration/locale_fix.cc:46: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[1024]; data/sdformat-9.3.0+ds/test/integration/nested_model.cc:611:6: [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). fs.open(expectedSdfPath); data/sdformat-9.3.0+ds/test/integration/nested_model.cc:665:6: [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). fs.open(expectedSdfPath); data/sdformat-9.3.0+ds/src/AirPressure.cc:123:26: [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. ignition::math::equal(this->dataPtr->referenceAltitude, data/sdformat-9.3.0+ds/src/Atmosphere.cc:178:21: [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. ignition::math::equal(this->dataPtr->temperatureGradient, data/sdformat-9.3.0+ds/src/Atmosphere.cc:180:21: [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. ignition::math::equal(this->dataPtr->pressure, data/sdformat-9.3.0+ds/src/Camera.cc:588:21: [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. ignition::math::equal(this->NearClip(), _cam.NearClip()) && data/sdformat-9.3.0+ds/src/Camera.cc:589:21: [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. ignition::math::equal(this->FarClip(), _cam.FarClip()) && data/sdformat-9.3.0+ds/src/Filesystem.cc:193:15: [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). int len = strlen(entry->d_name); data/sdformat-9.3.0+ds/src/Noise.cc:273:21: [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. ignition::math::equal(this->dataPtr->mean, _noise.Mean()) && data/sdformat-9.3.0+ds/src/Noise.cc:274:21: [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. ignition::math::equal(this->dataPtr->stdDev, _noise.StdDev()) && data/sdformat-9.3.0+ds/src/Noise.cc:275:21: [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. ignition::math::equal(this->dataPtr->biasMean, _noise.BiasMean()) && data/sdformat-9.3.0+ds/src/Noise.cc:276:21: [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. ignition::math::equal(this->dataPtr->biasStdDev, _noise.BiasStdDev()) && data/sdformat-9.3.0+ds/src/Noise.cc:277:21: [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. ignition::math::equal(this->dataPtr->precision, _noise.Precision()) && data/sdformat-9.3.0+ds/src/Noise.cc:278:21: [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. ignition::math::equal(this->dataPtr->dynamicBiasStdDev, data/sdformat-9.3.0+ds/src/Noise.cc:280:21: [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. ignition::math::equal(this->dataPtr->dynamicBiasCorrelationTime, data/sdformat-9.3.0+ds/src/Pbr.cc:145:25: [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. && (ignition::math::equal( data/sdformat-9.3.0+ds/src/Pbr.cc:147:25: [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. && (ignition::math::equal( data/sdformat-9.3.0+ds/src/Pbr.cc:149:25: [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. && (ignition::math::equal( data/sdformat-9.3.0+ds/src/Sensor.cc:208:24: [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. !ignition::math::equal(this->UpdateRate(), _sensor.UpdateRate())) data/sdformat-9.3.0+ds/src/parser_urdf.cc:2658:46: [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. ((!_link->inertial) || ignition::math::equal(_link->inertial->mass, 0.0))) data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.cpp:93:70: [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). TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.cpp:103:70: [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). TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:80: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). init( static_cast<size_type>( strlen(copy) )); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:99:35: [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 assign( copy, (size_type)strlen(copy)); data/sdformat-9.3.0+ds/src/win/tinyxml/tinystr.h:111:49: [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 append(suffix, static_cast<size_type>( strlen(suffix) )); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxml.cpp:99: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). outString->append( buf, (int)strlen( buf ) ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:525:12: [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). assert( strlen( entity[i].str ) == entity[i].strLength ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:641:8: [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). p += strlen( endTag ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:1364:7: [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). p += strlen( startTag ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:1392:8: [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). p += strlen( endTag ); data/sdformat-9.3.0+ds/src/win/tinyxml/tinyxmlparser.cpp:1527:8: [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). p += strlen( startTag ); ANALYSIS SUMMARY: Hits = 80 Lines analyzed = 56176 in approximately 1.36 seconds (41373 lines/second) Physical Source Lines of Code (SLOC) = 38891 Hits@level = [0] 28 [1] 29 [2] 29 [3] 9 [4] 13 [5] 0 Hits@level+ = [0+] 108 [1+] 80 [2+] 51 [3+] 22 [4+] 13 [5+] 0 Hits/KSLOC@level+ = [0+] 2.77699 [1+] 2.05703 [2+] 1.31136 [3+] 0.565684 [4+] 0.334268 [5+] 0 Dot directories skipped = 2 (--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.