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/cura-engine-4.8/libs/clipper/clipper.cpp
Examining data/cura-engine-4.8/libs/clipper/clipper.hpp
Examining data/cura-engine-4.8/libs/rapidjson/allocators.h
Examining data/cura-engine-4.8/libs/rapidjson/document.h
Examining data/cura-engine-4.8/libs/rapidjson/encodedstream.h
Examining data/cura-engine-4.8/libs/rapidjson/encodings.h
Examining data/cura-engine-4.8/libs/rapidjson/error/en.h
Examining data/cura-engine-4.8/libs/rapidjson/error/error.h
Examining data/cura-engine-4.8/libs/rapidjson/filereadstream.h
Examining data/cura-engine-4.8/libs/rapidjson/filewritestream.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/biginteger.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/diyfp.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/dtoa.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/ieee754.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/itoa.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/meta.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/pow10.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/stack.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/strfunc.h
Examining data/cura-engine-4.8/libs/rapidjson/internal/strtod.h
Examining data/cura-engine-4.8/libs/rapidjson/memorybuffer.h
Examining data/cura-engine-4.8/libs/rapidjson/memorystream.h
Examining data/cura-engine-4.8/libs/rapidjson/msinttypes/inttypes.h
Examining data/cura-engine-4.8/libs/rapidjson/msinttypes/stdint.h
Examining data/cura-engine-4.8/libs/rapidjson/prettywriter.h
Examining data/cura-engine-4.8/libs/rapidjson/rapidjson.h
Examining data/cura-engine-4.8/libs/rapidjson/reader.h
Examining data/cura-engine-4.8/libs/rapidjson/stringbuffer.h
Examining data/cura-engine-4.8/libs/rapidjson/writer.h
Examining data/cura-engine-4.8/src/Application.cpp
Examining data/cura-engine-4.8/src/Application.h
Examining data/cura-engine-4.8/src/ConicalOverhang.cpp
Examining data/cura-engine-4.8/src/ConicalOverhang.h
Examining data/cura-engine-4.8/src/ExtruderTrain.cpp
Examining data/cura-engine-4.8/src/ExtruderTrain.h
Examining data/cura-engine-4.8/src/FanSpeedLayerTime.h
Examining data/cura-engine-4.8/src/FffGcodeWriter.cpp
Examining data/cura-engine-4.8/src/FffGcodeWriter.h
Examining data/cura-engine-4.8/src/FffPolygonGenerator.cpp
Examining data/cura-engine-4.8/src/FffPolygonGenerator.h
Examining data/cura-engine-4.8/src/FffProcessor.cpp
Examining data/cura-engine-4.8/src/FffProcessor.h
Examining data/cura-engine-4.8/src/GCodePathConfig.cpp
Examining data/cura-engine-4.8/src/GCodePathConfig.h
Examining data/cura-engine-4.8/src/GcodeLayerThreader.h
Examining data/cura-engine-4.8/src/InsetOrderOptimizer.cpp
Examining data/cura-engine-4.8/src/InsetOrderOptimizer.h
Examining data/cura-engine-4.8/src/LayerPlan.cpp
Examining data/cura-engine-4.8/src/LayerPlan.h
Examining data/cura-engine-4.8/src/LayerPlanBuffer.cpp
Examining data/cura-engine-4.8/src/LayerPlanBuffer.h
Examining data/cura-engine-4.8/src/MergeInfillLines.cpp
Examining data/cura-engine-4.8/src/MergeInfillLines.h
Examining data/cura-engine-4.8/src/MeshGroup.cpp
Examining data/cura-engine-4.8/src/MeshGroup.h
Examining data/cura-engine-4.8/src/Mold.cpp
Examining data/cura-engine-4.8/src/Mold.h
Examining data/cura-engine-4.8/src/Preheat.cpp
Examining data/cura-engine-4.8/src/Preheat.h
Examining data/cura-engine-4.8/src/PrimeTower.cpp
Examining data/cura-engine-4.8/src/PrimeTower.h
Examining data/cura-engine-4.8/src/PrintFeature.h
Examining data/cura-engine-4.8/src/RetractionConfig.h
Examining data/cura-engine-4.8/src/Scene.cpp
Examining data/cura-engine-4.8/src/Scene.h
Examining data/cura-engine-4.8/src/SkirtBrim.cpp
Examining data/cura-engine-4.8/src/SkirtBrim.h
Examining data/cura-engine-4.8/src/Slice.cpp
Examining data/cura-engine-4.8/src/Slice.h
Examining data/cura-engine-4.8/src/SpaceFillType.h
Examining data/cura-engine-4.8/src/SupportInfillPart.cpp
Examining data/cura-engine-4.8/src/SupportInfillPart.h
Examining data/cura-engine-4.8/src/TopSurface.cpp
Examining data/cura-engine-4.8/src/TopSurface.h
Examining data/cura-engine-4.8/src/TreeSupport.cpp
Examining data/cura-engine-4.8/src/TreeSupport.h
Examining data/cura-engine-4.8/src/WallsComputation.cpp
Examining data/cura-engine-4.8/src/WallsComputation.h
Examining data/cura-engine-4.8/src/Weaver.cpp
Examining data/cura-engine-4.8/src/Weaver.h
Examining data/cura-engine-4.8/src/WipeScriptConfig.h
Examining data/cura-engine-4.8/src/Wireframe2gcode.cpp
Examining data/cura-engine-4.8/src/Wireframe2gcode.h
Examining data/cura-engine-4.8/src/bridge.cpp
Examining data/cura-engine-4.8/src/bridge.h
Examining data/cura-engine-4.8/src/communication/ArcusCommunication.cpp
Examining data/cura-engine-4.8/src/communication/ArcusCommunication.h
Examining data/cura-engine-4.8/src/communication/ArcusCommunicationPrivate.cpp
Examining data/cura-engine-4.8/src/communication/ArcusCommunicationPrivate.h
Examining data/cura-engine-4.8/src/communication/CommandLine.cpp
Examining data/cura-engine-4.8/src/communication/CommandLine.h
Examining data/cura-engine-4.8/src/communication/Communication.h
Examining data/cura-engine-4.8/src/communication/Listener.cpp
Examining data/cura-engine-4.8/src/communication/Listener.h
Examining data/cura-engine-4.8/src/communication/SliceDataStruct.h
Examining data/cura-engine-4.8/src/gcodeExport.cpp
Examining data/cura-engine-4.8/src/gcodeExport.h
Examining data/cura-engine-4.8/src/infill.cpp
Examining data/cura-engine-4.8/src/infill.h
Examining data/cura-engine-4.8/src/infill/DensityProvider.h
Examining data/cura-engine-4.8/src/infill/GyroidInfill.cpp
Examining data/cura-engine-4.8/src/infill/GyroidInfill.h
Examining data/cura-engine-4.8/src/infill/ImageBasedDensityProvider.cpp
Examining data/cura-engine-4.8/src/infill/ImageBasedDensityProvider.h
Examining data/cura-engine-4.8/src/infill/NoZigZagConnectorProcessor.cpp
Examining data/cura-engine-4.8/src/infill/NoZigZagConnectorProcessor.h
Examining data/cura-engine-4.8/src/infill/SierpinskiFill.cpp
Examining data/cura-engine-4.8/src/infill/SierpinskiFill.h
Examining data/cura-engine-4.8/src/infill/SierpinskiFillProvider.cpp
Examining data/cura-engine-4.8/src/infill/SierpinskiFillProvider.h
Examining data/cura-engine-4.8/src/infill/SubDivCube.cpp
Examining data/cura-engine-4.8/src/infill/SubDivCube.h
Examining data/cura-engine-4.8/src/infill/UniformDensityProvider.h
Examining data/cura-engine-4.8/src/infill/ZigzagConnectorProcessor.cpp
Examining data/cura-engine-4.8/src/infill/ZigzagConnectorProcessor.h
Examining data/cura-engine-4.8/src/layerPart.cpp
Examining data/cura-engine-4.8/src/layerPart.h
Examining data/cura-engine-4.8/src/main.cpp
Examining data/cura-engine-4.8/src/mesh.cpp
Examining data/cura-engine-4.8/src/mesh.h
Examining data/cura-engine-4.8/src/multiVolumes.cpp
Examining data/cura-engine-4.8/src/multiVolumes.h
Examining data/cura-engine-4.8/src/pathOrderOptimizer.cpp
Examining data/cura-engine-4.8/src/pathOrderOptimizer.h
Examining data/cura-engine-4.8/src/pathPlanning/Comb.cpp
Examining data/cura-engine-4.8/src/pathPlanning/Comb.h
Examining data/cura-engine-4.8/src/pathPlanning/CombPath.h
Examining data/cura-engine-4.8/src/pathPlanning/CombPaths.h
Examining data/cura-engine-4.8/src/pathPlanning/GCodePath.cpp
Examining data/cura-engine-4.8/src/pathPlanning/GCodePath.h
Examining data/cura-engine-4.8/src/pathPlanning/LinePolygonsCrossings.cpp
Examining data/cura-engine-4.8/src/pathPlanning/LinePolygonsCrossings.h
Examining data/cura-engine-4.8/src/pathPlanning/NozzleTempInsert.cpp
Examining data/cura-engine-4.8/src/pathPlanning/NozzleTempInsert.h
Examining data/cura-engine-4.8/src/pathPlanning/TimeMaterialEstimates.cpp
Examining data/cura-engine-4.8/src/pathPlanning/TimeMaterialEstimates.h
Examining data/cura-engine-4.8/src/progress/Progress.cpp
Examining data/cura-engine-4.8/src/progress/Progress.h
Examining data/cura-engine-4.8/src/progress/ProgressEstimator.h
Examining data/cura-engine-4.8/src/progress/ProgressEstimatorLinear.h
Examining data/cura-engine-4.8/src/progress/ProgressStageEstimator.cpp
Examining data/cura-engine-4.8/src/progress/ProgressStageEstimator.h
Examining data/cura-engine-4.8/src/raft.cpp
Examining data/cura-engine-4.8/src/raft.h
Examining data/cura-engine-4.8/src/settings/AdaptiveLayerHeights.cpp
Examining data/cura-engine-4.8/src/settings/AdaptiveLayerHeights.h
Examining data/cura-engine-4.8/src/settings/EnumSettings.h
Examining data/cura-engine-4.8/src/settings/FlowTempGraph.cpp
Examining data/cura-engine-4.8/src/settings/FlowTempGraph.h
Examining data/cura-engine-4.8/src/settings/PathConfigStorage.cpp
Examining data/cura-engine-4.8/src/settings/PathConfigStorage.h
Examining data/cura-engine-4.8/src/settings/Settings.cpp
Examining data/cura-engine-4.8/src/settings/Settings.h
Examining data/cura-engine-4.8/src/settings/types/AngleDegrees.h
Examining data/cura-engine-4.8/src/settings/types/AngleRadians.h
Examining data/cura-engine-4.8/src/settings/types/Duration.h
Examining data/cura-engine-4.8/src/settings/types/LayerIndex.h
Examining data/cura-engine-4.8/src/settings/types/Ratio.h
Examining data/cura-engine-4.8/src/settings/types/Temperature.h
Examining data/cura-engine-4.8/src/settings/types/Velocity.h
Examining data/cura-engine-4.8/src/skin.cpp
Examining data/cura-engine-4.8/src/skin.h
Examining data/cura-engine-4.8/src/sliceDataStorage.cpp
Examining data/cura-engine-4.8/src/sliceDataStorage.h
Examining data/cura-engine-4.8/src/slicer.cpp
Examining data/cura-engine-4.8/src/slicer.h
Examining data/cura-engine-4.8/src/support.cpp
Examining data/cura-engine-4.8/src/support.h
Examining data/cura-engine-4.8/src/timeEstimate.cpp
Examining data/cura-engine-4.8/src/timeEstimate.h
Examining data/cura-engine-4.8/src/utils/AABB.cpp
Examining data/cura-engine-4.8/src/utils/AABB.h
Examining data/cura-engine-4.8/src/utils/AABB3D.cpp
Examining data/cura-engine-4.8/src/utils/AABB3D.h
Examining data/cura-engine-4.8/src/utils/Coord_t.h
Examining data/cura-engine-4.8/src/utils/Date.cpp
Examining data/cura-engine-4.8/src/utils/Date.h
Examining data/cura-engine-4.8/src/utils/FMatrix4x3.cpp
Examining data/cura-engine-4.8/src/utils/FMatrix4x3.h
Examining data/cura-engine-4.8/src/utils/IntPoint.h
Examining data/cura-engine-4.8/src/utils/LazyInitialization.h
Examining data/cura-engine-4.8/src/utils/LinearAlg2D.cpp
Examining data/cura-engine-4.8/src/utils/ListPolyIt.cpp
Examining data/cura-engine-4.8/src/utils/ListPolyIt.h
Examining data/cura-engine-4.8/src/utils/Lock.h
Examining data/cura-engine-4.8/src/utils/MinimumSpanningTree.cpp
Examining data/cura-engine-4.8/src/utils/MinimumSpanningTree.h
Examining data/cura-engine-4.8/src/utils/NoCopy.h
Examining data/cura-engine-4.8/src/utils/Point3.cpp
Examining data/cura-engine-4.8/src/utils/Point3.h
Examining data/cura-engine-4.8/src/utils/PolygonConnector.cpp
Examining data/cura-engine-4.8/src/utils/PolygonConnector.h
Examining data/cura-engine-4.8/src/utils/PolygonProximityLinker.cpp
Examining data/cura-engine-4.8/src/utils/PolygonProximityLinker.h
Examining data/cura-engine-4.8/src/utils/PolygonsPointIndex.cpp
Examining data/cura-engine-4.8/src/utils/PolygonsPointIndex.h
Examining data/cura-engine-4.8/src/utils/ProximityPointLink.cpp
Examining data/cura-engine-4.8/src/utils/ProximityPointLink.h
Examining data/cura-engine-4.8/src/utils/SVG.cpp
Examining data/cura-engine-4.8/src/utils/SVG.h
Examining data/cura-engine-4.8/src/utils/SparseGrid.h
Examining data/cura-engine-4.8/src/utils/SparseLineGrid.h
Examining data/cura-engine-4.8/src/utils/SparsePointGrid.h
Examining data/cura-engine-4.8/src/utils/SparsePointGridInclusive.h
Examining data/cura-engine-4.8/src/utils/SymmetricPair.h
Examining data/cura-engine-4.8/src/utils/UnionFind.h
Examining data/cura-engine-4.8/src/utils/algorithm.h
Examining data/cura-engine-4.8/src/utils/floatpoint.h
Examining data/cura-engine-4.8/src/utils/getpath.cpp
Examining data/cura-engine-4.8/src/utils/getpath.h
Examining data/cura-engine-4.8/src/utils/gettime.cpp
Examining data/cura-engine-4.8/src/utils/gettime.h
Examining data/cura-engine-4.8/src/utils/linearAlg2D.h
Examining data/cura-engine-4.8/src/utils/logoutput.cpp
Examining data/cura-engine-4.8/src/utils/logoutput.h
Examining data/cura-engine-4.8/src/utils/macros.h
Examining data/cura-engine-4.8/src/utils/math.h
Examining data/cura-engine-4.8/src/utils/optional.h
Examining data/cura-engine-4.8/src/utils/orderOptimizer.h
Examining data/cura-engine-4.8/src/utils/polygon.cpp
Examining data/cura-engine-4.8/src/utils/polygon.h
Examining data/cura-engine-4.8/src/utils/polygonUtils.cpp
Examining data/cura-engine-4.8/src/utils/polygonUtils.h
Examining data/cura-engine-4.8/src/utils/socket.cpp
Examining data/cura-engine-4.8/src/utils/socket.h
Examining data/cura-engine-4.8/src/utils/string.h
Examining data/cura-engine-4.8/src/wallOverlap.cpp
Examining data/cura-engine-4.8/src/wallOverlap.h
Examining data/cura-engine-4.8/src/weaveDataStorage.h
Examining data/cura-engine-4.8/tests/InfillTest.cpp
Examining data/cura-engine-4.8/tests/LayerPlanTest.cpp
Examining data/cura-engine-4.8/tests/MergeInfillLinesTest.cpp
Examining data/cura-engine-4.8/tests/ReadTestPolygons.cpp
Examining data/cura-engine-4.8/tests/ReadTestPolygons.h
Examining data/cura-engine-4.8/tests/TimeEstimateCalculatorTest.cpp
Examining data/cura-engine-4.8/tests/arcus/ArcusCommunicationTest.cpp
Examining data/cura-engine-4.8/tests/arcus/MockCommunication.h
Examining data/cura-engine-4.8/tests/arcus/MockSocket.cpp
Examining data/cura-engine-4.8/tests/arcus/MockSocket.h
Examining data/cura-engine-4.8/tests/arcus/ArcusCommunicationPrivateTest.cpp
Examining data/cura-engine-4.8/tests/integration/SlicePhaseTest.cpp
Examining data/cura-engine-4.8/tests/main.cpp
Examining data/cura-engine-4.8/tests/settings/SettingsTest.cpp
Examining data/cura-engine-4.8/tests/utils/AABB3DTest.cpp
Examining data/cura-engine-4.8/tests/utils/AABBTest.cpp
Examining data/cura-engine-4.8/tests/utils/IntPointTest.cpp
Examining data/cura-engine-4.8/tests/utils/LinearAlg2DTest.cpp
Examining data/cura-engine-4.8/tests/utils/MinimumSpanningTreeTest.cpp
Examining data/cura-engine-4.8/tests/utils/PolygonConnectorTest.cpp
Examining data/cura-engine-4.8/tests/utils/PolygonTest.cpp
Examining data/cura-engine-4.8/tests/utils/PolygonUtilsTest.cpp
Examining data/cura-engine-4.8/tests/utils/SparseGridTest.cpp
Examining data/cura-engine-4.8/tests/utils/StringTest.cpp
Examining data/cura-engine-4.8/tests/utils/UnionFindTest.cpp
Examining data/cura-engine-4.8/tests/GCodeExportTest.cpp

FINAL RESULTS:

data/cura-engine-4.8/src/communication/CommandLine.cpp:360:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(paths, search_path_env); //Necessary because strtok actually modifies the original string, and we don't want to modify the environment variable itself.
data/cura-engine-4.8/src/utils/Date.cpp:43:10:  [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.
    std::sscanf(build_date, "%s %d %d", s_month, &ret.day, &ret.year);
data/cura-engine-4.8/src/utils/SVG.h:133:10:  [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.
    void printf(const char* txt, Args&&... args);
data/cura-engine-4.8/src/utils/SVG.h:148:11:  [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.
void SVG::printf(const char* txt, Args&&... args)
data/cura-engine-4.8/src/utils/SVG.h:150:5:  [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.
    fprintf(out, txt, args...);
data/cura-engine-4.8/src/utils/getpath.cpp:29:10:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    std::strcpy(buffer, filePath.c_str()); // copy the string because dirname(.) changes the input string!!!
data/cura-engine-4.8/src/utils/logoutput.cpp:32:9:  [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.
        vfprintf(stderr, fmt, args);
data/cura-engine-4.8/src/utils/logoutput.cpp:45:9:  [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.
        vfprintf(stderr, fmt, args);
data/cura-engine-4.8/src/utils/logoutput.cpp:57:9:  [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.
        vfprintf(stderr, fmt, args);
data/cura-engine-4.8/src/utils/logoutput.cpp:72:9:  [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.
        vfprintf(stderr, fmt, args);
data/cura-engine-4.8/src/utils/logoutput.cpp:89:9:  [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.
        vfprintf(stderr, fmt, args);
data/cura-engine-4.8/src/utils/string.h:130:22:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    int char_count = sprintf(buffer, format, coord);
data/cura-engine-4.8/tests/InfillTest.cpp:22:14:  [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.
        std::snprintf(buff, buff_size, format_string.c_str(), args...);
data/cura-engine-4.8/src/FffGcodeWriter.cpp:1476:17:  [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(gcode_layer.getLayerNr());
data/cura-engine-4.8/src/FffGcodeWriter.cpp:1721:13:  [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(gcode_layer.getLayerNr());
data/cura-engine-4.8/src/communication/CommandLine.cpp:351:29:  [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* search_path_env = getenv("CURA_ENGINE_SEARCH_PATH");
data/cura-engine-4.8/tests/GCodeExportTest.cpp:256:20:  [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.
    EXPECT_EQ(std::getenv("DEB_VERSION_UPSTREAM"), token.substr(19));
data/cura-engine-4.8/libs/rapidjson/allocators.h:203:18:  [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(newBuffer, originalPtr, originalSize);
data/cura-engine-4.8/libs/rapidjson/document.h:1540: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 padding[4];
data/cura-engine-4.8/libs/rapidjson/document.h:1544: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 padding2[4];
data/cura-engine-4.8/libs/rapidjson/document.h:1548: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 padding[4];
data/cura-engine-4.8/libs/rapidjson/document.h:1552: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 padding2[4];
data/cura-engine-4.8/libs/rapidjson/document.h:1586:18:  [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(data_.a.elements, values, count * sizeof(GenericValue));
data/cura-engine-4.8/libs/rapidjson/document.h:1598:18:  [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(data_.o.members, members, count * sizeof(Member));
data/cura-engine-4.8/libs/rapidjson/document.h:1625: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(str, s, s.length * sizeof(Ch));
data/cura-engine-4.8/libs/rapidjson/internal/biginteger.h:32: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(digits_, rhs.digits_, count_ * sizeof(Type));
data/cura-engine-4.8/libs/rapidjson/internal/itoa.h:24: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.
    static const char cDigitsLut[200] = {
data/cura-engine-4.8/libs/rapidjson/reader.h:273: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.
    static const char whitespace[16] = " \n\r\t";
data/cura-engine-4.8/libs/rapidjson/reader.h:310: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.
    static const char whitespaces[4][17] = {
data/cura-engine-4.8/libs/rapidjson/reader.h:669:22:  [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 escape[256] = {
data/cura-engine-4.8/libs/rapidjson/reader.h:1041: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.
        static const unsigned char tokenMap[256] = {
data/cura-engine-4.8/libs/rapidjson/reader.h:1064:22:  [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 G[cIterativeParsingStateCount][kTokenCount] = {
data/cura-engine-4.8/libs/rapidjson/writer.h:205: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[11];
data/cura-engine-4.8/libs/rapidjson/writer.h:213: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[10];
data/cura-engine-4.8/libs/rapidjson/writer.h:221: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[21];
data/cura-engine-4.8/libs/rapidjson/writer.h:229: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[20];
data/cura-engine-4.8/libs/rapidjson/writer.h:237: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[25];
data/cura-engine-4.8/libs/rapidjson/writer.h:245:22:  [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 hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
data/cura-engine-4.8/libs/rapidjson/writer.h:246:22:  [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 escape[256] = {
data/cura-engine-4.8/src/FffGcodeWriter.h:105:21:  [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).
        output_file.open(filename);
data/cura-engine-4.8/src/MeshGroup.cpp:127: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).
    FILE* f = fopen(filename, "rt");
data/cura-engine-4.8/src/MeshGroup.cpp:128: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/cura-engine-4.8/src/MeshGroup.cpp:160: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).
    FILE* f = fopen(filename, "rb");
data/cura-engine-4.8/src/MeshGroup.cpp:167: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[80];
data/cura-engine-4.8/src/MeshGroup.cpp:213: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).
    FILE* f = fopen(filename, "rb");
data/cura-engine-4.8/src/MeshGroup.cpp:241: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[6];
data/cura-engine-4.8/src/communication/CommandLine.cpp:322:18:  [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* file = fopen(json_filename.c_str(), "rb");
data/cura-engine-4.8/src/communication/CommandLine.cpp:330: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 read_buffer[4096];
data/cura-engine-4.8/src/communication/CommandLine.cpp:359: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 paths[128 * 1024]; //Maximum length of environment variable.
data/cura-engine-4.8/src/communication/CommandLine.cpp:401:41:  [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).
                const int extruder_nr = atoi(extruder_train->name.GetString());
data/cura-engine-4.8/src/settings/Settings.cpp:83:12:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    return atoi(get<std::string>(key).c_str());
data/cura-engine-4.8/src/settings/Settings.cpp:93: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).
    const int num = atoi(value.c_str());
data/cura-engine-4.8/src/settings/Settings.cpp:99:28:  [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).
    int extruder_nr = std::atoi(get<std::string>(key).c_str());
data/cura-engine-4.8/src/settings/Settings.cpp:109:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    return std::atoi(get<std::string>(key).c_str()) - 1; //For the user we display layer numbers starting from 1, but we start counting from 0. Still it may be negative for Raft layers.
data/cura-engine-4.8/src/settings/Settings.cpp:604: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[4096];
data/cura-engine-4.8/src/utils/Date.cpp:40: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 s_month[5];
data/cura-engine-4.8/src/utils/SVG.cpp:64: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).
    out = fopen(filename.c_str(), "w");
data/cura-engine-4.8/src/utils/getpath.cpp:16: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[MAX_PATH];  // This buffer will hold the complete path.
data/cura-engine-4.8/src/utils/getpath.cpp:28: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[filePath.size()];
data/cura-engine-4.8/src/utils/string.h:42: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[buffer_size];
data/cura-engine-4.8/src/utils/string.h:43:22:  [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.
    int char_count = sprintf(buffer, "%d", coord); // we haven't found any way for the windows compiler to accept formatting of a coord_t, so it has to be int32_t instead
data/cura-engine-4.8/src/utils/string.h:126: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 format[5] = "%.xF"; // write a float with [x] digits after the dot
data/cura-engine-4.8/src/utils/string.h:129: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[buffer_size];
data/cura-engine-4.8/tests/InfillTest.cpp:21: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 buff[buff_size];
data/cura-engine-4.8/tests/InfillTest.cpp:133: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 buff[buff_size];
data/cura-engine-4.8/tests/ReadTestPolygons.cpp:30:29:  [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* handle = std::fopen(filename.c_str(), "r");
data/cura-engine-4.8/src/FffPolygonGenerator.cpp:433:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#pragma omp atomic read
data/cura-engine-4.8/src/FffPolygonGenerator.cpp:495:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#pragma omp atomic read
data/cura-engine-4.8/src/utils/SVG.cpp:63:48:  [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).
    output_is_html = strcmp(filename.c_str() + strlen(filename.c_str()) - 4, "html") == 0;
data/cura-engine-4.8/tests/ReadTestPolygons.cpp:48:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            else if (read <= 0)
data/cura-engine-4.8/tests/ReadTestPolygons.cpp:57:36:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if (read == EOF || read <= 0)

ANALYSIS SUMMARY:

Hits = 71
Lines analyzed = 67733 in approximately 1.81 seconds (37468 lines/second)
Physical Source Lines of Code (SLOC) = 45346
Hits@level = [0]  58 [1]   5 [2]  49 [3]   4 [4]  13 [5]   0
Hits@level+ = [0+] 129 [1+]  71 [2+]  66 [3+]  17 [4+]  13 [5+]   0
Hits/KSLOC@level+ = [0+] 2.84479 [1+] 1.56574 [2+] 1.45548 [3+] 0.374895 [4+] 0.286685 [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.