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/shasta-0.6.0/src/Alignment.cpp Examining data/shasta-0.6.0/src/Alignment.hpp Examining data/shasta-0.6.0/src/AlignmentCandidates.hpp Examining data/shasta-0.6.0/src/AlignmentGraph.cpp Examining data/shasta-0.6.0/src/AlignmentGraph.hpp Examining data/shasta-0.6.0/src/AssembledSegment.cpp Examining data/shasta-0.6.0/src/AssembledSegment.hpp Examining data/shasta-0.6.0/src/Assembler.cpp Examining data/shasta-0.6.0/src/Assembler.hpp Examining data/shasta-0.6.0/src/AssemblerAlign.cpp Examining data/shasta-0.6.0/src/AssemblerAlign1.cpp Examining data/shasta-0.6.0/src/AssemblerAlign3.cpp Examining data/shasta-0.6.0/src/AssemblerAlignmentGraph.cpp Examining data/shasta-0.6.0/src/AssemblerAlignments.cpp Examining data/shasta-0.6.0/src/AssemblerAnalyzePaths.cpp Examining data/shasta-0.6.0/src/AssemblerAssemblyGraph.cpp Examining data/shasta-0.6.0/src/AssemblerCompressedAssemblyGraph.cpp Examining data/shasta-0.6.0/src/AssemblerConflictReadGraph.cpp Examining data/shasta-0.6.0/src/AssemblerCreateReadGraphUsingPseudoPaths.cpp Examining data/shasta-0.6.0/src/AssemblerDetangle.cpp Examining data/shasta-0.6.0/src/AssemblerDirectedReadGraph.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-Alignments.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-AssemblyGraph.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-CompressedAssemblyGraph.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-DirectedReadGraph.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-MarkerGraph.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-ReadGraph.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer-Reads.cpp Examining data/shasta-0.6.0/src/AssemblerHttpServer.cpp Examining data/shasta-0.6.0/src/AssemblerInducedAlignments.cpp Examining data/shasta-0.6.0/src/AssemblerKmers.cpp Examining data/shasta-0.6.0/src/AssemblerLowHash.cpp Examining data/shasta-0.6.0/src/AssemblerMarkerGraph.cpp Examining data/shasta-0.6.0/src/AssemblerMarkerGraphRefine.cpp Examining data/shasta-0.6.0/src/AssemblerMarkers.cpp Examining data/shasta-0.6.0/src/AssemblerOptions.cpp Examining data/shasta-0.6.0/src/AssemblerOptions.hpp Examining data/shasta-0.6.0/src/AssemblerPhasing.cpp Examining data/shasta-0.6.0/src/AssemblerReadGraph.cpp Examining data/shasta-0.6.0/src/AssemblerReadGraph2.cpp Examining data/shasta-0.6.0/src/AssemblerReads.cpp Examining data/shasta-0.6.0/src/AssemblerSegmentGraph.cpp Examining data/shasta-0.6.0/src/AssemblyGraph.cpp Examining data/shasta-0.6.0/src/AssemblyGraph.hpp Examining data/shasta-0.6.0/src/AssemblyPathGraph.cpp Examining data/shasta-0.6.0/src/AssemblyPathGraph.hpp Examining data/shasta-0.6.0/src/AssemblyPathGraph2.cpp Examining data/shasta-0.6.0/src/AssemblyPathGraph2.hpp Examining data/shasta-0.6.0/src/Base.cpp Examining data/shasta-0.6.0/src/Base.hpp Examining data/shasta-0.6.0/src/BinaryIO.cpp Examining data/shasta-0.6.0/src/BinaryIO.hpp Examining data/shasta-0.6.0/src/BubbleGraph.cpp Examining data/shasta-0.6.0/src/BubbleGraph.hpp Examining data/shasta-0.6.0/src/CompactUndirectedGraph.cpp Examining data/shasta-0.6.0/src/CompactUndirectedGraph.hpp Examining data/shasta-0.6.0/src/CompressedAssemblyGraph.cpp Examining data/shasta-0.6.0/src/CompressedAssemblyGraph.hpp Examining data/shasta-0.6.0/src/CompressedRunnieReader.cpp Examining data/shasta-0.6.0/src/CompressedRunnieReader.hpp Examining data/shasta-0.6.0/src/ConflictReadGraph.cpp Examining data/shasta-0.6.0/src/ConflictReadGraph.hpp Examining data/shasta-0.6.0/src/ConsensusCaller.cpp Examining data/shasta-0.6.0/src/ConsensusCaller.hpp Examining data/shasta-0.6.0/src/Coverage.cpp Examining data/shasta-0.6.0/src/Coverage.hpp Examining data/shasta-0.6.0/src/DeBruijnGraph.hpp Examining data/shasta-0.6.0/src/DirectedReadGraph.cpp Examining data/shasta-0.6.0/src/DirectedReadGraph.hpp Examining data/shasta-0.6.0/src/DynamicConflictReadGraph.cpp Examining data/shasta-0.6.0/src/DynamicConflictReadGraph.hpp Examining data/shasta-0.6.0/src/Histogram.cpp Examining data/shasta-0.6.0/src/Histogram.hpp Examining data/shasta-0.6.0/src/HttpServer.cpp Examining data/shasta-0.6.0/src/HttpServer.hpp Examining data/shasta-0.6.0/src/InducedAlignment.cpp Examining data/shasta-0.6.0/src/InducedAlignment.hpp Examining data/shasta-0.6.0/src/Kmer.hpp Examining data/shasta-0.6.0/src/LocalAlignmentGraph.cpp Examining data/shasta-0.6.0/src/LocalAlignmentGraph.hpp Examining data/shasta-0.6.0/src/LocalAssemblyGraph.cpp Examining data/shasta-0.6.0/src/LocalAssemblyGraph.hpp Examining data/shasta-0.6.0/src/LocalDirectedReadGraph.cpp Examining data/shasta-0.6.0/src/LocalDirectedReadGraph.hpp Examining data/shasta-0.6.0/src/LocalMarkerGraph-Write.cpp Examining data/shasta-0.6.0/src/LocalMarkerGraph.cpp Examining data/shasta-0.6.0/src/LocalMarkerGraph.hpp Examining data/shasta-0.6.0/src/LocalReadGraph.cpp Examining data/shasta-0.6.0/src/LocalReadGraph.hpp Examining data/shasta-0.6.0/src/LongBaseSequence.cpp Examining data/shasta-0.6.0/src/LongBaseSequence.hpp Examining data/shasta-0.6.0/src/LowHash0.cpp Examining data/shasta-0.6.0/src/LowHash0.hpp Examining data/shasta-0.6.0/src/LowHash1.cpp Examining data/shasta-0.6.0/src/LowHash1.hpp Examining data/shasta-0.6.0/src/Marker.hpp Examining data/shasta-0.6.0/src/MarkerFinder.cpp Examining data/shasta-0.6.0/src/MarkerFinder.hpp Examining data/shasta-0.6.0/src/MarkerGraph.cpp Examining data/shasta-0.6.0/src/MarkerGraph.hpp Examining data/shasta-0.6.0/src/MarkerGraph2.hpp Examining data/shasta-0.6.0/src/MarkerInterval.hpp Examining data/shasta-0.6.0/src/MedianConsensusCaller.cpp Examining data/shasta-0.6.0/src/MedianConsensusCaller.hpp Examining data/shasta-0.6.0/src/MemoryMappedDirectedGraph.hpp Examining data/shasta-0.6.0/src/MemoryMappedObject.hpp Examining data/shasta-0.6.0/src/MemoryMappedUndirectedGraph.hpp Examining data/shasta-0.6.0/src/MemoryMappedVector.cpp Examining data/shasta-0.6.0/src/MemoryMappedVector.hpp Examining data/shasta-0.6.0/src/MemoryMappedVectorOfVectors.hpp Examining data/shasta-0.6.0/src/MetaMarkerGraph.cpp Examining data/shasta-0.6.0/src/MetaMarkerGraph.hpp Examining data/shasta-0.6.0/src/MiniAssemblyMarkerGraph.cpp Examining data/shasta-0.6.0/src/MiniAssemblyMarkerGraph.hpp Examining data/shasta-0.6.0/src/MultithreadedObject.cpp Examining data/shasta-0.6.0/src/MultithreadedObject.hpp Examining data/shasta-0.6.0/src/MurmurHash2.cpp Examining data/shasta-0.6.0/src/MurmurHash2.hpp Examining data/shasta-0.6.0/src/OrientedReadPair.hpp Examining data/shasta-0.6.0/src/PeakFinder.cpp Examining data/shasta-0.6.0/src/PeakFinder.hpp Examining data/shasta-0.6.0/src/PhasingData.cpp Examining data/shasta-0.6.0/src/PhasingData.hpp Examining data/shasta-0.6.0/src/PngImage.cpp Examining data/shasta-0.6.0/src/PngImage.hpp Examining data/shasta-0.6.0/src/PythonModule.cpp Examining data/shasta-0.6.0/src/ReadFlags.hpp Examining data/shasta-0.6.0/src/ReadGraph.cpp Examining data/shasta-0.6.0/src/ReadGraph.hpp Examining data/shasta-0.6.0/src/ReadId.hpp Examining data/shasta-0.6.0/src/ReadLoader.cpp Examining data/shasta-0.6.0/src/ReadLoader.hpp Examining data/shasta-0.6.0/src/Reads.cpp Examining data/shasta-0.6.0/src/Reads.hpp Examining data/shasta-0.6.0/src/SHASTA_ASSERT.hpp Examining data/shasta-0.6.0/src/SegmentGraph.cpp Examining data/shasta-0.6.0/src/SegmentGraph.hpp Examining data/shasta-0.6.0/src/ShortBaseSequence.cpp Examining data/shasta-0.6.0/src/ShortBaseSequence.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin-guppy-2.3.1-a.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin-guppy-2.3.5-a.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin-guppy-3.0.5-a.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin-guppy-3.4.4-a.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin-guppy-3.6.0-a.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin-r10-guppy-3.4.8-a.hpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller-Builtin.cpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller.cpp Examining data/shasta-0.6.0/src/SimpleBayesianConsensusCaller.hpp Examining data/shasta-0.6.0/src/SimpleConsensusCaller.cpp Examining data/shasta-0.6.0/src/SimpleConsensusCaller.hpp Examining data/shasta-0.6.0/src/Uint.hpp Examining data/shasta-0.6.0/src/algorithm.hpp Examining data/shasta-0.6.0/src/approximateColoring.hpp Examining data/shasta-0.6.0/src/approximateTopologicalSort.hpp Examining data/shasta-0.6.0/src/array.hpp Examining data/shasta-0.6.0/src/buildId.cpp Examining data/shasta-0.6.0/src/buildId.hpp Examining data/shasta-0.6.0/src/chokePoints.hpp Examining data/shasta-0.6.0/src/chrono.hpp Examining data/shasta-0.6.0/src/compressAlignment.cpp Examining data/shasta-0.6.0/src/compressAlignment.hpp Examining data/shasta-0.6.0/src/computeRunLengthRepresentation.cpp Examining data/shasta-0.6.0/src/computeRunLengthRepresentation.hpp Examining data/shasta-0.6.0/src/cstddef.hpp Examining data/shasta-0.6.0/src/cstdint.hpp Examining data/shasta-0.6.0/src/deduplicate.hpp Examining data/shasta-0.6.0/src/dset64-gccAtomic.hpp Examining data/shasta-0.6.0/src/dset64.hpp Examining data/shasta-0.6.0/src/dset64Test.cpp Examining data/shasta-0.6.0/src/dset64Test.hpp Examining data/shasta-0.6.0/src/filesystem.cpp Examining data/shasta-0.6.0/src/filesystem.hpp Examining data/shasta-0.6.0/src/findLinearChains.hpp Examining data/shasta-0.6.0/src/findMarkerId.hpp Examining data/shasta-0.6.0/src/fstream.hpp Examining data/shasta-0.6.0/src/html.cpp Examining data/shasta-0.6.0/src/html.hpp Examining data/shasta-0.6.0/src/iosfwd.hpp Examining data/shasta-0.6.0/src/iostream.hpp Examining data/shasta-0.6.0/src/iterator.hpp Examining data/shasta-0.6.0/src/makeBiconnected.hpp Examining data/shasta-0.6.0/src/mappedCopy.cpp Examining data/shasta-0.6.0/src/mappedCopy.hpp Examining data/shasta-0.6.0/src/memory.hpp Examining data/shasta-0.6.0/src/orderPairs.hpp Examining data/shasta-0.6.0/src/platformDependent.cpp Examining data/shasta-0.6.0/src/platformDependent.hpp Examining data/shasta-0.6.0/src/runCommandWithTimeout.cpp Examining data/shasta-0.6.0/src/runCommandWithTimeout.hpp Examining data/shasta-0.6.0/src/seqan.hpp Examining data/shasta-0.6.0/src/setOperations.hpp Examining data/shasta-0.6.0/src/shortestPath.hpp Examining data/shasta-0.6.0/src/span.hpp Examining data/shasta-0.6.0/src/splitRange.hpp Examining data/shasta-0.6.0/src/stdexcept.hpp Examining data/shasta-0.6.0/src/string.hpp Examining data/shasta-0.6.0/src/subgraph.hpp Examining data/shasta-0.6.0/src/testSpoa.cpp Examining data/shasta-0.6.0/src/testSpoa.hpp Examining data/shasta-0.6.0/src/timestamp.hpp Examining data/shasta-0.6.0/src/touchMemory.cpp Examining data/shasta-0.6.0/src/touchMemory.hpp Examining data/shasta-0.6.0/src/tuple.hpp Examining data/shasta-0.6.0/src/utility.hpp Examining data/shasta-0.6.0/src/vector.hpp Examining data/shasta-0.6.0/srcMain/main.cpp FINAL RESULTS: data/shasta-0.6.0/src/filesystem.cpp:266:25: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. ssize_t bytesRead = readlink("/proc/self/exe", &buf[0], bufSize); data/shasta-0.6.0/src/Assembler.cpp:45:16: [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. reads->access( data/shasta-0.6.0/src/AssemblerHttpServer-Alignments.cpp:494: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. ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-Alignments.cpp:900: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. ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-Alignments.cpp:2078:33: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-AssemblyGraph.cpp:121:33: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-DirectedReadGraph.cpp:410:14: [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()) != 0) { data/shasta-0.6.0/src/AssemblerHttpServer-DirectedReadGraph.cpp:498:37: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-DirectedReadGraph.cpp:601:37: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-MarkerGraph.cpp:118:33: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-MarkerGraph.cpp:1213:8: [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. ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-ReadGraph.cpp:310: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. ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-ReadGraph.cpp:391:37: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-ReadGraph.cpp:487:37: [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. const int commandStatus = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer-ReadGraph.cpp:523: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. ::system(base64Command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer.cpp:370:29: [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. const int errorCode = ::system(base64Command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer.cpp:416:29: [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. const int errorCode = ::system(command.c_str()); data/shasta-0.6.0/src/AssemblerHttpServer.cpp:1222: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. ::system(command.c_str()); data/shasta-0.6.0/src/HttpServer.cpp:89:15: [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. ::system(("xdg-open http://localhost:" + to_string(port)).c_str()); data/shasta-0.6.0/src/HttpServer.cpp:91:15: [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. ::system(("open http://localhost:" + to_string(port)).c_str()); data/shasta-0.6.0/src/HttpServer.cpp:131:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. boost::system::error_code errorCode; data/shasta-0.6.0/src/HttpServer.cpp:667:10: [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(("lsof -i -n > " + fileName).c_str())) { data/shasta-0.6.0/src/Reads.cpp:25:13: [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. void Reads::access( data/shasta-0.6.0/src/Reads.hpp:94:10: [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. void access( data/shasta-0.6.0/src/filesystem.cpp:132:10: [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()) != 0) { data/shasta-0.6.0/src/runCommandWithTimeout.cpp:45:36: [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. const int commandStatus = std::system(commandWithTimeout.c_str()); data/shasta-0.6.0/srcMain/main.cpp:406:37: [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. const int errorCode = ::system(command.c_str()); data/shasta-0.6.0/srcMain/main.cpp:428:37: [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. const int errorCode = ::system(command.c_str()); data/shasta-0.6.0/srcMain/main.cpp:1053:29: [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. const int errorCode = ::system(command.c_str()); data/shasta-0.6.0/srcMain/main.cpp:1088:29: [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. const int errorCode = ::system(command.c_str()); data/shasta-0.6.0/srcMain/main.cpp:1119: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. ::system(("sudo umount " + dataDirectory).c_str()); data/shasta-0.6.0/srcMain/main.cpp:1120:29: [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. const int errorCode = ::system(string("rm -rf " + dataDirectory).c_str()); data/shasta-0.6.0/srcMain/main.cpp:1134: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. ::system(command.c_str()); data/shasta-0.6.0/src/filesystem.cpp:256: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. ::realpath(path.c_str(), buffer.data()); data/shasta-0.6.0/src/platformDependent.cpp:18: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. return string(::getenv("TMPDIR")) + "/"; data/shasta-0.6.0/src/AssemblerAnalyzePaths.cpp:1287:23: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). alignmentsCsv.open("Alignments.csv"); data/shasta-0.6.0/src/AssemblerMarkerGraph.cpp:3797:18: [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). debugOut.open("simplifyMarkerGraphIterationPart1-" + to_string(iteration) + ".debugLog"); data/shasta-0.6.0/src/AssemblerMarkerGraph.cpp:3901:18: [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). debugOut.open("simplifyMarkerGraphIterationPart2-" + to_string(iteration) + ".debugLog"); data/shasta-0.6.0/src/AssemblerReadGraph2.cpp:48:26: [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). alignmentInfoCsv.open("AlignmentInfo.csv"); data/shasta-0.6.0/src/CompressedRunnieReader.cpp:27:38: [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->sequenceFileDescriptor = ::open(filePath.c_str(), O_RDONLY); data/shasta-0.6.0/src/HttpServer.cpp:57: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). acceptor.open(endpoint.protocol()); data/shasta-0.6.0/src/MemoryMappedObject.hpp:211:34: [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). const int fileDescriptor = ::open( data/shasta-0.6.0/src/MemoryMappedObject.hpp:226:34: [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). const int fileDescriptor = ::open( data/shasta-0.6.0/src/MemoryMappedVector.hpp:400:34: [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). const int fileDescriptor = ::open( data/shasta-0.6.0/src/MemoryMappedVector.hpp:415:34: [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). const int fileDescriptor = ::open( data/shasta-0.6.0/src/MultithreadedObject.hpp:214:17: [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). log.open(fileName); data/shasta-0.6.0/src/PngImage.cpp:30:23: [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 = std::fopen (fileName.c_str(), "w"); data/shasta-0.6.0/src/ReadId.hpp:51:36: [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 ReadId readId = std::atoi(s.substr(0, dashPosition).c_str()); data/shasta-0.6.0/src/ReadId.hpp:52:36: [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 Strand strand = std::atoi(s.substr(dashPosition+1, s.size()).c_str()); data/shasta-0.6.0/src/ReadLoader.cpp:513:34: [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). const int fileDescriptor = ::open(fileName.c_str(), flags); data/shasta-0.6.0/src/Uint.hpp:49:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&data, &i, N); data/shasta-0.6.0/src/Uint.hpp:92:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&i, &data, N); data/shasta-0.6.0/src/mappedCopy.cpp:31:39: [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). const int inputFileDescriptor = ::open(inputPath.c_str(), O_RDONLY); data/shasta-0.6.0/src/mappedCopy.cpp:43:40: [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). const int outputFileDescriptor = ::open(outputPath.c_str(), data/shasta-0.6.0/src/AssemblerAssemblyGraph.cpp:1232:13: [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. if(std::equal(repeatCounts0.begin(), repeatCounts0.end(), repeatCounts1.begin())) { data/shasta-0.6.0/src/AssemblerHttpServer-MarkerGraph.cpp:829:82: [1] (buffer) mismatch: 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. auto spoaAlignmentEngine = spoa::createAlignmentEngine(alignmentType, match, mismatch, gap); data/shasta-0.6.0/src/AssemblerKmers.cpp:384:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read.baseCount < k) { data/shasta-0.6.0/src/AssemblerKmers.cpp:391:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). kmer.set(position, read[position]); data/shasta-0.6.0/src/AssemblerKmers.cpp:405:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(position+k == read.baseCount) { data/shasta-0.6.0/src/AssemblerKmers.cpp:411:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). kmer.set(k-1, read[position+k]); data/shasta-0.6.0/src/AssemblerKmers.cpp:752:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read.baseCount < k) { data/shasta-0.6.0/src/AssemblerKmers.cpp:759:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). kmer.set(position, read[position]); data/shasta-0.6.0/src/AssemblerKmers.cpp:775:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(position+k == read.baseCount) { data/shasta-0.6.0/src/AssemblerKmers.cpp:781:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). kmer.set(k-1, read[position+k]); data/shasta-0.6.0/src/AssemblerKmers.cpp:789:53: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const uint32_t readKmerCount = uint32_t(read.baseCount + 1 - k); data/shasta-0.6.0/src/AssemblerMarkerGraph.cpp:2062:82: [1] (buffer) mismatch: 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. auto spoaAlignmentEngine = spoa::createAlignmentEngine(alignmentType, match, mismatch, gap); data/shasta-0.6.0/src/AssemblerMarkerGraph.cpp:4686:82: [1] (buffer) mismatch: 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. auto spoaAlignmentEngine = spoa::createAlignmentEngine(alignmentType, match, mismatch, gap); data/shasta-0.6.0/src/BinaryIO.cpp:23:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). file.read(reinterpret_cast<char*>(&s[0]), length); data/shasta-0.6.0/src/BinaryIO.hpp:52:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s.read(reinterpret_cast<char*>(&v), sizeof(T)); data/shasta-0.6.0/src/BinaryIO.hpp:63:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s.read(reinterpret_cast<char*>(v.data()), sizeof(T)*length); data/shasta-0.6.0/src/HttpServer.cpp:529:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s.read(&content.front(), content.size()); data/shasta-0.6.0/src/LocalMarkerGraph.cpp:202:50: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const uint32_t readLength = uint32_t(read.baseCount); data/shasta-0.6.0/src/LocalMarkerGraph.cpp:206:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). base = read.get(position); data/shasta-0.6.0/src/LocalMarkerGraph.cpp:208:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). base = read.get(readLength - 1 - position); data/shasta-0.6.0/src/LowHash1.cpp:412:33: [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. if(not std::equal(featureKmerIds0, featureKmerIds0+mLocal, featureKmerIds1)) { data/shasta-0.6.0/src/MarkerFinder.cpp:74:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read.baseCount >= k) { // Avoid pathological case. data/shasta-0.6.0/src/MarkerFinder.cpp:79:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). kmer.set(position, read[position]); data/shasta-0.6.0/src/MarkerFinder.cpp:96:71: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). markerPointerStrand1->position = uint32_t(read.baseCount - k - position); data/shasta-0.6.0/src/MarkerFinder.cpp:102:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(position+k == read.baseCount) { data/shasta-0.6.0/src/MarkerFinder.cpp:108:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). kmer.set(k-1, read[position+k]); data/shasta-0.6.0/src/MemoryMappedVector.hpp:144:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. std::equal(begin(), end(), that.begin()); data/shasta-0.6.0/src/ReadLoader.cpp:161:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vector<Base> read; data/shasta-0.6.0/src/ReadLoader.cpp:211:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.clear(); data/shasta-0.6.0/src/ReadLoader.cpp:230:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.push_back(base); data/shasta-0.6.0/src/ReadLoader.cpp:241:66: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __sync_fetch_and_add(&discardedInvalidBaseReadCount, read.size()); data/shasta-0.6.0/src/ReadLoader.cpp:246:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read.size() < minReadLength) { data/shasta-0.6.0/src/ReadLoader.cpp:248:64: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __sync_fetch_and_add(&discardedShortReadBaseCount, read.size()); data/shasta-0.6.0/src/ReadLoader.cpp:253:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(computeRunLengthRepresentation(read, runLengthRead, readRepeatCount)) { data/shasta-0.6.0/src/ReadLoader.cpp:260:69: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __sync_fetch_and_add(&discardedBadRepeatCountBaseCount, read.size()); data/shasta-0.6.0/src/ReadLoader.cpp:367:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vector<Base> read; data/shasta-0.6.0/src/ReadLoader.cpp:460:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.clear(); data/shasta-0.6.0/src/ReadLoader.cpp:468:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.push_back(base); data/shasta-0.6.0/src/ReadLoader.cpp:472:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read.size() < minReadLength) { data/shasta-0.6.0/src/ReadLoader.cpp:474:64: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __sync_fetch_and_add(&discardedShortReadBaseCount, read.size()); data/shasta-0.6.0/src/ReadLoader.cpp:479:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(computeRunLengthRepresentation(read, runLengthRead, readRepeatCount)) { data/shasta-0.6.0/src/ReadLoader.cpp:486:69: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __sync_fetch_and_add(&discardedBadRepeatCountBaseCount, read.size()); data/shasta-0.6.0/src/ReadLoader.cpp:523:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const int64_t bytesRead = ::read(fileDescriptor, bufferPointer, bufferCapacity); data/shasta-0.6.0/src/ReadLoader.cpp:687:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). NamedCompressedRunnieSequence read; data/shasta-0.6.0/src/ReadLoader.cpp:696:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). reader.getSequenceData(read, i); data/shasta-0.6.0/src/ReadLoader.cpp:697:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). copy(read.name.begin(), read.name.end(), reads.readNames.begin(readId)); data/shasta-0.6.0/src/ReadLoader.cpp:697:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). copy(read.name.begin(), read.name.end(), reads.readNames.begin(readId)); data/shasta-0.6.0/src/ReadLoader.cpp:699:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for(uint64_t j=0; j<read.sequence.size(); j++) { data/shasta-0.6.0/src/ReadLoader.cpp:700:59: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). storedSequence.set(j, Base::fromCharacter(read.sequence[j])); data/shasta-0.6.0/src/ReadLoader.cpp:702:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). copy(read.encoding.begin(), read.encoding.end(), reads.readRepeatCounts.begin(readId)); data/shasta-0.6.0/src/ReadLoader.cpp:702:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). copy(read.encoding.begin(), read.encoding.end(), reads.readRepeatCounts.begin(readId)); data/shasta-0.6.0/src/Reads.cpp:125:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read[position]; data/shasta-0.6.0/src/Reads.cpp:127:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read[read.baseCount-1-position].complement(); data/shasta-0.6.0/src/Reads.cpp:127:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read[read.baseCount-1-position].complement(); data/shasta-0.6.0/src/Reads.cpp:148:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). orientedPosition = uint32_t(read.baseCount) - 1 - orientedPosition; data/shasta-0.6.0/src/Reads.cpp:152:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). pair<Base, uint8_t> p = make_pair(read[orientedPosition], counts[orientedPosition]); data/shasta-0.6.0/src/Reads.cpp:264: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. if(std::equal(keyBegin, keyEnd, p)) { data/shasta-0.6.0/src/span.hpp:97: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. return std::equal(begin(), end(), that.begin()); data/shasta-0.6.0/src/testSpoa.cpp:23:79: [1] (buffer) mismatch: 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. auto alignment_engine = spoa::createAlignmentEngine(alignmentType, match, mismatch, gap); ANALYSIS SUMMARY: Hits = 113 Lines analyzed = 68163 in approximately 2.71 seconds (25180 lines/second) Physical Source Lines of Code (SLOC) = 45279 Hits@level = [0] 4 [1] 59 [2] 19 [3] 2 [4] 32 [5] 1 Hits@level+ = [0+] 117 [1+] 113 [2+] 54 [3+] 35 [4+] 33 [5+] 1 Hits/KSLOC@level+ = [0+] 2.58398 [1+] 2.49564 [2+] 1.19261 [3+] 0.772985 [4+] 0.728815 [5+] 0.0220853 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.