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/libstatgen-1.0.14/bam/BamIndex.cpp Examining data/libstatgen-1.0.14/bam/BamIndex.h Examining data/libstatgen-1.0.14/bam/BamInterface.cpp Examining data/libstatgen-1.0.14/bam/BamInterface.h Examining data/libstatgen-1.0.14/bam/CigarHelper.cpp Examining data/libstatgen-1.0.14/bam/CigarHelper.h Examining data/libstatgen-1.0.14/bam/GenericSamInterface.cpp Examining data/libstatgen-1.0.14/bam/GenericSamInterface.h Examining data/libstatgen-1.0.14/bam/Pileup.h Examining data/libstatgen-1.0.14/bam/PileupElement.cpp Examining data/libstatgen-1.0.14/bam/PileupElement.h Examining data/libstatgen-1.0.14/bam/PileupElementBaseQual.cpp Examining data/libstatgen-1.0.14/bam/PileupElementBaseQual.h Examining data/libstatgen-1.0.14/bam/PosList.cpp Examining data/libstatgen-1.0.14/bam/PosList.h Examining data/libstatgen-1.0.14/bam/SamCoordOutput.cpp Examining data/libstatgen-1.0.14/bam/SamCoordOutput.h Examining data/libstatgen-1.0.14/bam/SamFile.cpp Examining data/libstatgen-1.0.14/bam/SamFile.h Examining data/libstatgen-1.0.14/bam/SamFileHeader.cpp Examining data/libstatgen-1.0.14/bam/SamFileHeader.h Examining data/libstatgen-1.0.14/bam/SamFilter.cpp Examining data/libstatgen-1.0.14/bam/SamFilter.h Examining data/libstatgen-1.0.14/bam/SamFlag.h Examining data/libstatgen-1.0.14/bam/SamHeaderHD.cpp Examining data/libstatgen-1.0.14/bam/SamHeaderHD.h Examining data/libstatgen-1.0.14/bam/SamHeaderPG.cpp Examining data/libstatgen-1.0.14/bam/SamHeaderPG.h Examining data/libstatgen-1.0.14/bam/SamHeaderRG.cpp Examining data/libstatgen-1.0.14/bam/SamHeaderRG.h Examining data/libstatgen-1.0.14/bam/SamHeaderRecord.cpp Examining data/libstatgen-1.0.14/bam/SamHeaderRecord.h Examining data/libstatgen-1.0.14/bam/SamHeaderSQ.cpp Examining data/libstatgen-1.0.14/bam/SamHeaderSQ.h Examining data/libstatgen-1.0.14/bam/SamHeaderTag.cpp Examining data/libstatgen-1.0.14/bam/SamHeaderTag.h Examining data/libstatgen-1.0.14/bam/SamHelper.h Examining data/libstatgen-1.0.14/bam/SamInterface.cpp Examining data/libstatgen-1.0.14/bam/SamInterface.h Examining data/libstatgen-1.0.14/bam/SamQuerySeqWithRefHelper.cpp Examining data/libstatgen-1.0.14/bam/SamQuerySeqWithRefHelper.h Examining data/libstatgen-1.0.14/bam/SamRecord.cpp Examining data/libstatgen-1.0.14/bam/SamRecord.h Examining data/libstatgen-1.0.14/bam/SamRecordHelper.cpp Examining data/libstatgen-1.0.14/bam/SamRecordHelper.h Examining data/libstatgen-1.0.14/bam/SamRecordPool.cpp Examining data/libstatgen-1.0.14/bam/SamRecordPool.h Examining data/libstatgen-1.0.14/bam/SamReferenceInfo.cpp Examining data/libstatgen-1.0.14/bam/SamReferenceInfo.h Examining data/libstatgen-1.0.14/bam/SamStatistics.cpp Examining data/libstatgen-1.0.14/bam/SamStatistics.h Examining data/libstatgen-1.0.14/bam/SamStatus.h Examining data/libstatgen-1.0.14/bam/SamTags.cpp Examining data/libstatgen-1.0.14/bam/SamTags.h Examining data/libstatgen-1.0.14/bam/SamValidation.cpp Examining data/libstatgen-1.0.14/bam/SamValidation.h Examining data/libstatgen-1.0.14/bam/examples/pileup/Main.cpp Examining data/libstatgen-1.0.14/bam/examples/printRefPositions/Main.cpp Examining data/libstatgen-1.0.14/bam/examples/printRefPositions/PrintRefPositions.cpp Examining data/libstatgen-1.0.14/bam/examples/printRefPositions/PrintRefPositions.h Examining data/libstatgen-1.0.14/bam/test/BamIndexTest.cpp Examining data/libstatgen-1.0.14/bam/test/BamIndexTest.h Examining data/libstatgen-1.0.14/bam/test/Main.cpp Examining data/libstatgen-1.0.14/bam/test/Modify.cpp Examining data/libstatgen-1.0.14/bam/test/Modify.h Examining data/libstatgen-1.0.14/bam/test/ModifyVar.cpp Examining data/libstatgen-1.0.14/bam/test/ModifyVar.h Examining data/libstatgen-1.0.14/bam/test/ReadFiles.cpp Examining data/libstatgen-1.0.14/bam/test/ReadFiles.h Examining data/libstatgen-1.0.14/bam/test/SamFileTest.cpp Examining data/libstatgen-1.0.14/bam/test/SamFileTest.h Examining data/libstatgen-1.0.14/bam/test/ShiftIndels.cpp Examining data/libstatgen-1.0.14/bam/test/ShiftIndels.h Examining data/libstatgen-1.0.14/bam/test/TestCigarHelper.cpp Examining data/libstatgen-1.0.14/bam/test/TestCigarHelper.h Examining data/libstatgen-1.0.14/bam/test/TestEquals.cpp Examining data/libstatgen-1.0.14/bam/test/TestEquals.h Examining data/libstatgen-1.0.14/bam/test/TestFilter.cpp Examining data/libstatgen-1.0.14/bam/test/TestFilter.h Examining data/libstatgen-1.0.14/bam/test/TestPileup.cpp Examining data/libstatgen-1.0.14/bam/test/TestPileup.h Examining data/libstatgen-1.0.14/bam/test/TestPosList.cpp Examining data/libstatgen-1.0.14/bam/test/TestPosList.h Examining data/libstatgen-1.0.14/bam/test/TestSamCoordOutput.cpp Examining data/libstatgen-1.0.14/bam/test/TestSamCoordOutput.h Examining data/libstatgen-1.0.14/bam/test/TestSamRecordHelper.cpp Examining data/libstatgen-1.0.14/bam/test/TestSamRecordHelper.h Examining data/libstatgen-1.0.14/bam/test/TestSamRecordPool.cpp Examining data/libstatgen-1.0.14/bam/test/TestSamRecordPool.h Examining data/libstatgen-1.0.14/bam/test/TestValidate.cpp Examining data/libstatgen-1.0.14/bam/test/TestValidate.h Examining data/libstatgen-1.0.14/bam/test/ValidationTest.cpp Examining data/libstatgen-1.0.14/bam/test/ValidationTest.h Examining data/libstatgen-1.0.14/bam/test/WriteFiles.cpp Examining data/libstatgen-1.0.14/bam/test/WriteFiles.h Examining data/libstatgen-1.0.14/fastq/BaseComposition.cpp Examining data/libstatgen-1.0.14/fastq/BaseComposition.h Examining data/libstatgen-1.0.14/fastq/BaseCount.cpp Examining data/libstatgen-1.0.14/fastq/BaseCount.h Examining data/libstatgen-1.0.14/fastq/FastQFile.cpp Examining data/libstatgen-1.0.14/fastq/FastQFile.h Examining data/libstatgen-1.0.14/fastq/FastQStatus.cpp Examining data/libstatgen-1.0.14/fastq/FastQStatus.h Examining data/libstatgen-1.0.14/fastq/test/FastQFileTest.cpp Examining data/libstatgen-1.0.14/general/BaseAsciiMap.cpp Examining data/libstatgen-1.0.14/general/BaseAsciiMap.h Examining data/libstatgen-1.0.14/general/BaseQualityHelper.cpp Examining data/libstatgen-1.0.14/general/BaseQualityHelper.h Examining data/libstatgen-1.0.14/general/BaseUtilities.cpp Examining data/libstatgen-1.0.14/general/BaseUtilities.h Examining data/libstatgen-1.0.14/general/BasicHash.cpp Examining data/libstatgen-1.0.14/general/BasicHash.h Examining data/libstatgen-1.0.14/general/BgzfFileType.cpp Examining data/libstatgen-1.0.14/general/BgzfFileType.h Examining data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp Examining data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.h Examining data/libstatgen-1.0.14/general/CSG_MD5.h Examining data/libstatgen-1.0.14/general/CharBuffer.cpp Examining data/libstatgen-1.0.14/general/CharBuffer.h Examining data/libstatgen-1.0.14/general/Chromosome.h Examining data/libstatgen-1.0.14/general/Cigar.cpp Examining data/libstatgen-1.0.14/general/Cigar.h Examining data/libstatgen-1.0.14/general/CigarRoller.cpp Examining data/libstatgen-1.0.14/general/CigarRoller.h Examining data/libstatgen-1.0.14/general/Constant.h Examining data/libstatgen-1.0.14/general/Error.cpp Examining data/libstatgen-1.0.14/general/Error.h Examining data/libstatgen-1.0.14/general/ErrorHandler.cpp Examining data/libstatgen-1.0.14/general/ErrorHandler.h Examining data/libstatgen-1.0.14/general/FileType.cpp Examining data/libstatgen-1.0.14/general/FileType.h Examining data/libstatgen-1.0.14/general/FortranFormat.cpp Examining data/libstatgen-1.0.14/general/FortranFormat.h Examining data/libstatgen-1.0.14/general/Generic.cpp Examining data/libstatgen-1.0.14/general/Generic.h Examining data/libstatgen-1.0.14/general/GenomeSequence.cpp Examining data/libstatgen-1.0.14/general/GenomeSequence.h Examining data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h Examining data/libstatgen-1.0.14/general/GenotypeLists.cpp Examining data/libstatgen-1.0.14/general/GenotypeLists.h Examining data/libstatgen-1.0.14/general/GreedyTupleAligner.h Examining data/libstatgen-1.0.14/general/GzipFileType.cpp Examining data/libstatgen-1.0.14/general/GzipFileType.h Examining data/libstatgen-1.0.14/general/GzipHeader.cpp Examining data/libstatgen-1.0.14/general/GzipHeader.h Examining data/libstatgen-1.0.14/general/Hash.cpp Examining data/libstatgen-1.0.14/general/Hash.h Examining data/libstatgen-1.0.14/general/IndexBase.cpp Examining data/libstatgen-1.0.14/general/IndexBase.h Examining data/libstatgen-1.0.14/general/InplaceMerge.cpp Examining data/libstatgen-1.0.14/general/InplaceMerge.h Examining data/libstatgen-1.0.14/general/Input.cpp Examining data/libstatgen-1.0.14/general/Input.h Examining data/libstatgen-1.0.14/general/InputFile.cpp Examining data/libstatgen-1.0.14/general/InputFile.h Examining data/libstatgen-1.0.14/general/IntArray.cpp Examining data/libstatgen-1.0.14/general/IntArray.h Examining data/libstatgen-1.0.14/general/IntHash.cpp Examining data/libstatgen-1.0.14/general/IntHash.h Examining data/libstatgen-1.0.14/general/LongHash.h Examining data/libstatgen-1.0.14/general/LongInt.h Examining data/libstatgen-1.0.14/general/LongLongCounter.cpp Examining data/libstatgen-1.0.14/general/LongLongCounter.h Examining data/libstatgen-1.0.14/general/MapFunction.cpp Examining data/libstatgen-1.0.14/general/MapFunction.h Examining data/libstatgen-1.0.14/general/MathConstant.h Examining data/libstatgen-1.0.14/general/MathMatrix.cpp Examining data/libstatgen-1.0.14/general/MathMatrix.h Examining data/libstatgen-1.0.14/general/MathVector.cpp Examining data/libstatgen-1.0.14/general/MathVector.h Examining data/libstatgen-1.0.14/general/MemoryAllocators.cpp Examining data/libstatgen-1.0.14/general/MemoryAllocators.h Examining data/libstatgen-1.0.14/general/MemoryInfo.cpp Examining data/libstatgen-1.0.14/general/MemoryInfo.h Examining data/libstatgen-1.0.14/general/MemoryMap.cpp Examining data/libstatgen-1.0.14/general/MemoryMap.h Examining data/libstatgen-1.0.14/general/MemoryMapArray.cpp Examining data/libstatgen-1.0.14/general/MemoryMapArray.h Examining data/libstatgen-1.0.14/general/MiniDeflate.cpp Examining data/libstatgen-1.0.14/general/MiniDeflate.h Examining data/libstatgen-1.0.14/general/NonOverlapRegions.cpp Examining data/libstatgen-1.0.14/general/NonOverlapRegions.h Examining data/libstatgen-1.0.14/general/PackedVector.h Examining data/libstatgen-1.0.14/general/Parameters.h Examining data/libstatgen-1.0.14/general/Pedigree.cpp Examining data/libstatgen-1.0.14/general/Pedigree.h Examining data/libstatgen-1.0.14/general/PedigreeAlleleFreq.cpp Examining data/libstatgen-1.0.14/general/PedigreeAlleleFreq.h Examining data/libstatgen-1.0.14/general/PedigreeAlleles.h Examining data/libstatgen-1.0.14/general/PedigreeDescription.cpp Examining data/libstatgen-1.0.14/general/PedigreeDescription.h Examining data/libstatgen-1.0.14/general/PedigreeFamily.cpp Examining data/libstatgen-1.0.14/general/PedigreeFamily.h Examining data/libstatgen-1.0.14/general/PedigreeGlobals.cpp Examining data/libstatgen-1.0.14/general/PedigreeGlobals.h Examining data/libstatgen-1.0.14/general/PedigreeLoader.cpp Examining data/libstatgen-1.0.14/general/PedigreePerson.cpp Examining data/libstatgen-1.0.14/general/PedigreePerson.h Examining data/libstatgen-1.0.14/general/PedigreeTrim.cpp Examining data/libstatgen-1.0.14/general/PedigreeTwin.cpp Examining data/libstatgen-1.0.14/general/Performance.h Examining data/libstatgen-1.0.14/general/PhoneHome.cpp Examining data/libstatgen-1.0.14/general/PhoneHome.h Examining data/libstatgen-1.0.14/general/QuickIndex.cpp Examining data/libstatgen-1.0.14/general/QuickIndex.h Examining data/libstatgen-1.0.14/general/Random.cpp Examining data/libstatgen-1.0.14/general/Random.h Examining data/libstatgen-1.0.14/general/ReferenceSequence.cpp Examining data/libstatgen-1.0.14/general/ReferenceSequence.h Examining data/libstatgen-1.0.14/general/ReusableVector.h Examining data/libstatgen-1.0.14/general/STLUtilities.cpp Examining data/libstatgen-1.0.14/general/STLUtilities.h Examining data/libstatgen-1.0.14/general/SimpleStats.h Examining data/libstatgen-1.0.14/general/SmithWaterman.cpp Examining data/libstatgen-1.0.14/general/SmithWaterman.h Examining data/libstatgen-1.0.14/general/Sort.cpp Examining data/libstatgen-1.0.14/general/Sort.h Examining data/libstatgen-1.0.14/general/StatGenStatus.cpp Examining data/libstatgen-1.0.14/general/StatGenStatus.h Examining data/libstatgen-1.0.14/general/String.cpp Examining data/libstatgen-1.0.14/general/StringAlias.cpp Examining data/libstatgen-1.0.14/general/StringAlias.h Examining data/libstatgen-1.0.14/general/StringArray.cpp Examining data/libstatgen-1.0.14/general/StringArray.h Examining data/libstatgen-1.0.14/general/StringBasics.cpp Examining data/libstatgen-1.0.14/general/StringBasics.h Examining data/libstatgen-1.0.14/general/StringHash.cpp Examining data/libstatgen-1.0.14/general/StringHash.h Examining data/libstatgen-1.0.14/general/StringMap.cpp Examining data/libstatgen-1.0.14/general/StringMap.h Examining data/libstatgen-1.0.14/general/Tabix.cpp Examining data/libstatgen-1.0.14/general/Tabix.h Examining data/libstatgen-1.0.14/general/TrimSequence.h Examining data/libstatgen-1.0.14/general/UncompressedFileType.cpp Examining data/libstatgen-1.0.14/general/UncompressedFileType.h Examining data/libstatgen-1.0.14/general/UnitTest.h Examining data/libstatgen-1.0.14/general/glfHandler.cpp Examining data/libstatgen-1.0.14/general/glfHandler.h Examining data/libstatgen-1.0.14/general/test/Chromosome_test.cpp Examining data/libstatgen-1.0.14/general/test/GenomeSequence_test.cpp Examining data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp Examining data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp Examining data/libstatgen-1.0.14/general/test/TrimSequence_test.cpp Examining data/libstatgen-1.0.14/general/test/baseUtilitiesTest/BaseUtilitiesTest.cpp Examining data/libstatgen-1.0.14/general/test/baseUtilitiesTest/BaseUtilitiesTest.h Examining data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp Examining data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.h Examining data/libstatgen-1.0.14/general/test/dbsnp/Main.cpp Examining data/libstatgen-1.0.14/general/test/gtest.cpp Examining data/libstatgen-1.0.14/general/test/inputFileTest/InputFileTest.cpp Examining data/libstatgen-1.0.14/general/test/inputFileTest/InputFileTest.h Examining data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.cpp Examining data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.h Examining data/libstatgen-1.0.14/general/test/nonOverlapRegions/NonOverlapRegionsTest.cpp Examining data/libstatgen-1.0.14/general/test/nonOverlapRegions/NonOverlapRegionsTest.h Examining data/libstatgen-1.0.14/general/test/packedVectorTest/PackedVectorTest.cpp Examining data/libstatgen-1.0.14/general/test/packedVectorTest/PackedVectorTest.h Examining data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.cpp Examining data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.h Examining data/libstatgen-1.0.14/general/test/reusableVector/ReusableVectorTest.cpp Examining data/libstatgen-1.0.14/general/test/reusableVector/ReusableVectorTest.h Examining data/libstatgen-1.0.14/general/test/string/StringTest.cpp Examining data/libstatgen-1.0.14/general/test/string/StringTest.h Examining data/libstatgen-1.0.14/general/test/trimSequence/TrimSequence.cpp Examining data/libstatgen-1.0.14/general/Parameters.cpp Examining data/libstatgen-1.0.14/general/Chromosome.cpp Examining data/libstatgen-1.0.14/glf/GlfException.cpp Examining data/libstatgen-1.0.14/glf/GlfException.h Examining data/libstatgen-1.0.14/glf/GlfFile.cpp Examining data/libstatgen-1.0.14/glf/GlfFile.h Examining data/libstatgen-1.0.14/glf/GlfHeader.cpp Examining data/libstatgen-1.0.14/glf/GlfHeader.h Examining data/libstatgen-1.0.14/glf/GlfRecord.cpp Examining data/libstatgen-1.0.14/glf/GlfRecord.h Examining data/libstatgen-1.0.14/glf/GlfRefSection.cpp Examining data/libstatgen-1.0.14/glf/GlfRefSection.h Examining data/libstatgen-1.0.14/glf/GlfStatus.cpp Examining data/libstatgen-1.0.14/glf/GlfStatus.h Examining data/libstatgen-1.0.14/glf/test/Main.cpp Examining data/libstatgen-1.0.14/glf/test/ReadFiles.cpp Examining data/libstatgen-1.0.14/glf/test/ReadFiles.h Examining data/libstatgen-1.0.14/glf/test/Validate.cpp Examining data/libstatgen-1.0.14/glf/test/Validate.h Examining data/libstatgen-1.0.14/glf/test/WriteFiles.cpp Examining data/libstatgen-1.0.14/glf/test/WriteFiles.h Examining data/libstatgen-1.0.14/samtools/bam.h Examining data/libstatgen-1.0.14/samtools/bgzf.c Examining data/libstatgen-1.0.14/samtools/bgzf.h Examining data/libstatgen-1.0.14/samtools/khash.h Examining data/libstatgen-1.0.14/samtools/knetfile.c Examining data/libstatgen-1.0.14/samtools/knetfile.h Examining data/libstatgen-1.0.14/vcf/VcfFile.cpp Examining data/libstatgen-1.0.14/vcf/VcfFile.h Examining data/libstatgen-1.0.14/vcf/VcfFileReader.cpp Examining data/libstatgen-1.0.14/vcf/VcfFileReader.h Examining data/libstatgen-1.0.14/vcf/VcfFileWriter.cpp Examining data/libstatgen-1.0.14/vcf/VcfFileWriter.h Examining data/libstatgen-1.0.14/vcf/VcfGenotypeField.cpp Examining data/libstatgen-1.0.14/vcf/VcfGenotypeField.h Examining data/libstatgen-1.0.14/vcf/VcfGenotypeFormat.cpp Examining data/libstatgen-1.0.14/vcf/VcfGenotypeFormat.h Examining data/libstatgen-1.0.14/vcf/VcfGenotypeSample.cpp Examining data/libstatgen-1.0.14/vcf/VcfGenotypeSample.h Examining data/libstatgen-1.0.14/vcf/VcfHeader.cpp Examining data/libstatgen-1.0.14/vcf/VcfHeader.h Examining data/libstatgen-1.0.14/vcf/VcfHelper.cpp Examining data/libstatgen-1.0.14/vcf/VcfHelper.h Examining data/libstatgen-1.0.14/vcf/VcfRecord.cpp Examining data/libstatgen-1.0.14/vcf/VcfRecord.h Examining data/libstatgen-1.0.14/vcf/VcfRecordDiscardRules.cpp Examining data/libstatgen-1.0.14/vcf/VcfRecordDiscardRules.h Examining data/libstatgen-1.0.14/vcf/VcfRecordField.cpp Examining data/libstatgen-1.0.14/vcf/VcfRecordField.h Examining data/libstatgen-1.0.14/vcf/VcfRecordFilter.cpp Examining data/libstatgen-1.0.14/vcf/VcfRecordFilter.h Examining data/libstatgen-1.0.14/vcf/VcfRecordGenotype.cpp Examining data/libstatgen-1.0.14/vcf/VcfRecordGenotype.h Examining data/libstatgen-1.0.14/vcf/VcfRecordInfo.cpp Examining data/libstatgen-1.0.14/vcf/VcfRecordInfo.h Examining data/libstatgen-1.0.14/vcf/VcfSubsetSamples.cpp Examining data/libstatgen-1.0.14/vcf/VcfSubsetSamples.h Examining data/libstatgen-1.0.14/vcf/test/Main.cpp Examining data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp Examining data/libstatgen-1.0.14/vcf/test/VcfFileTest.h Examining data/libstatgen-1.0.14/vcf/test/VcfHeaderTest.cpp Examining data/libstatgen-1.0.14/vcf/test/VcfHeaderTest.h FINAL RESULTS: data/libstatgen-1.0.14/bam/SamRecord.cpp:3379:25: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(extraPtr, "%s", getString(i).c_str()); data/libstatgen-1.0.14/general/CigarRoller.cpp:315:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(ptr, buf); data/libstatgen-1.0.14/general/Error.cpp:35:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(msg, ap); data/libstatgen-1.0.14/general/Error.cpp:51:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(msg, ap); data/libstatgen-1.0.14/general/Error.cpp:64:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(msg, ap); data/libstatgen-1.0.14/general/GenomeSequence.cpp:195:8: [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. if(access(_umfaFilename.c_str(), R_OK) != 0) data/libstatgen-1.0.14/general/GenomeSequence.cpp:507:30: [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. if (!_createOverwrite && access(_umfaFilename.c_str(), R_OK) == 0) data/libstatgen-1.0.14/general/Input.cpp:131:13: [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(s, _default); data/libstatgen-1.0.14/general/InputFile.cpp:405:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. buffer.vprintf(format, ap); data/libstatgen-1.0.14/general/MathMatrix.cpp:345:16: [4] (buffer) fscanf: 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. numItems = fscanf(f, " %s =", buffer); data/libstatgen-1.0.14/general/MathMatrix.cpp:356:20: [4] (buffer) fscanf: 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. numItems = fscanf(f, " %s", buffer); data/libstatgen-1.0.14/general/MemoryMap.cpp:170:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:184:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:208:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:222:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:234:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:264:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:278:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:288:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:297:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/MemoryMap.cpp:309:9: [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(stderr, message, file); data/libstatgen-1.0.14/general/Parameters.cpp:37:5: [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(description, desc); data/libstatgen-1.0.14/general/Parameters.cpp:75:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. buffer.vprintf(format, ap); data/libstatgen-1.0.14/general/Parameters.cpp:724:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(string, argv[i]); data/libstatgen-1.0.14/general/Parameters.cpp:835:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. buffer.vprintf(format, ap); data/libstatgen-1.0.14/general/Parameters.cpp:852:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. buffer.vprintf(format, ap); data/libstatgen-1.0.14/general/Parameters.cpp:869:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. buffer.vprintf(format, ap); data/libstatgen-1.0.14/general/Parameters.cpp:885:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. buffer.vprintf(format, ap); data/libstatgen-1.0.14/general/Pedigree.cpp:276:9: [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. printf(condensed ? "\nDone estimating frequencies for %d markers\n\n" : "\n\n", estimates); data/libstatgen-1.0.14/general/Pedigree.cpp:400:13: [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(output, markerCount < 20 ? "%3d/%3d\t" : "%d/%d\t", data/libstatgen-1.0.14/general/Pedigree.cpp:403:13: [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(output, markerCount < 20 ? "%3s/%3s\t" : "%s/%s\t", data/libstatgen-1.0.14/general/Pedigree.cpp:861:29: [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. printf( data/libstatgen-1.0.14/general/STLUtilities.h:243:13: [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. inline void fprintf(std::ostream &stream, const char* s) data/libstatgen-1.0.14/general/STLUtilities.h:254:6: [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. void fprintf(std::ostream &stream, const char* s, const T& value, const Args&... args) data/libstatgen-1.0.14/general/STLUtilities.h:331:13: [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(stream, s, args...); data/libstatgen-1.0.14/general/STLUtilities.h:340:6: [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* s, const T& value, const Args&... args) data/libstatgen-1.0.14/general/STLUtilities.h:342: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(std::cout, s, value, args...); data/libstatgen-1.0.14/general/STLUtilities.h:346:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. void sprintf(std::string &buffer, const char *fmt, const Args&... args) data/libstatgen-1.0.14/general/STLUtilities.h:350: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((std::ostream &) stream, fmt, args...); data/libstatgen-1.0.14/general/StringBasics.cpp:31:9: [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. #ifndef snprintf data/libstatgen-1.0.14/general/StringBasics.cpp:32:9: [4] (format) vsnprintf: 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 vsnprintf _vsnprintf data/libstatgen-1.0.14/general/StringBasics.cpp:33:9: [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 snprintf _snprintf data/libstatgen-1.0.14/general/StringBasics.cpp:33:19: [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 snprintf _snprintf data/libstatgen-1.0.14/general/StringBasics.cpp:526:14: [4] (buffer) fscanf: 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. If the scanf format is influenceable by an attacker, it's exploitable. io = fscanf(f, format, LockBuffer(clen) + len, check); data/libstatgen-1.0.14/general/StringBasics.cpp:1335:13: [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. int String::printf(const char * format, ...) data/libstatgen-1.0.14/general/StringBasics.cpp:1340:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, ap); data/libstatgen-1.0.14/general/StringBasics.cpp:1357:13: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. int String::vprintf(const char * format, va_list ap) data/libstatgen-1.0.14/general/StringBasics.cpp:1372:28: [4] (format) vsnprintf: 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. bytes_needed = vsnprintf(buffer, size, format, arguments); data/libstatgen-1.0.14/general/StringBasics.cpp:1431:34: [4] (format) vsnprintf: 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. bytes_needed = len + vsnprintf(buffer + len, size - len, format, arguments); data/libstatgen-1.0.14/general/StringBasics.cpp:1462:15: [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. int len = vfprintf(my_vsnprintf_file, format, args); data/libstatgen-1.0.14/general/StringBasics.h:331:12: [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. int printf(const char * format, ...); data/libstatgen-1.0.14/general/StringBasics.h:332:12: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. int vprintf(const char * format, va_list arglist); data/libstatgen-1.0.14/general/test/GenomeSequence_test.cpp:59:20: [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. int exitCode = system(RM_BS_REFERENCE); data/libstatgen-1.0.14/general/test/GenomeSequence_test.cpp:79:20: [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. int exitCode = system(RM_CS_REFERENCE); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:159:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(result, "hello, world! %20sand boo", "well then"); data/libstatgen-1.0.14/samtools/knetfile.c:346:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fp->retr, "RETR %s\r\n", p); data/libstatgen-1.0.14/samtools/knetfile.c:348:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fp->size_cmd, "SIZE %s\r\n", p); data/libstatgen-1.0.14/samtools/knetfile.c:446:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. l += sprintf(buf + l, "GET %s HTTP/1.0\r\nHost: %s\r\n", fp->path, fp->http_host); data/libstatgen-1.0.14/general/MemoryMapArray.h:232:15: [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. env = getenv("USER"); data/libstatgen-1.0.14/general/PhoneHome.cpp:185:9: [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 (time(NULL)); data/libstatgen-1.0.14/general/SmithWaterman.cpp:127:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, (char **) argv, "v")) != -1) data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:188:12: [3] (random) random: 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. Random random; data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:192:5: [3] (random) random: 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. random.Reset(0); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:196:34: [3] (random) random: 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. result << (char)('A' + ( random.NextInt() % range)); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:202:5: [3] (random) random: 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. random.Reset(0); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:206:29: [3] (random) random: 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. s += (char)('A' + ( random.NextInt() % range)); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:213:5: [3] (random) random: 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. random.Reset(0); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:217:30: [3] (random) random: 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. st += (char)('A' + ( random.NextInt() % range)); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:229:12: [3] (random) random: 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. Random random; data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:925:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while(( opt = getopt(argc, (char **) argv, "v")) != -1) { data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.cpp:273:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while(( opt = getopt(argc, (char **) argv, "v")) != -1) { data/libstatgen-1.0.14/general/test/packedVectorTest/PackedVectorTest.cpp:173:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while(( opt = getopt(argc, (char **) argv, "v")) != -1) { data/libstatgen-1.0.14/samtools/knetfile.c:420:10: [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. proxy = getenv("http_proxy"); data/libstatgen-1.0.14/bam/BamIndex.cpp:61: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 magic[4]; data/libstatgen-1.0.14/bam/BamInterface.cpp:147: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 magic[4]; data/libstatgen-1.0.14/bam/SamFile.cpp:122: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 magic[4]; data/libstatgen-1.0.14/bam/SamFile.cpp:143: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 magic[4]; data/libstatgen-1.0.14/bam/SamFile.cpp:187: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 magic[4]; data/libstatgen-1.0.14/bam/SamFileHeader.cpp:283:35: [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). myReferenceInfo.add(name, atoi(value)); data/libstatgen-1.0.14/bam/SamFileHeader.cpp:447:35: [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). myReferenceInfo.add(name, atoi(length)); data/libstatgen-1.0.14/bam/SamHeaderRecord.cpp:59: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 tag[3]; data/libstatgen-1.0.14/bam/SamInterface.cpp:347:34: [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. if(!record.addTag((const char *)nugget, nugget[3], data/libstatgen-1.0.14/bam/SamRecord.cpp:133:5: [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(&(myRecordPtr->myData), myReadName.c_str(), data/libstatgen-1.0.14/bam/SamRecord.cpp:548:5: [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(myRecordPtr, fromBuffer, fromBufferSize); data/libstatgen-1.0.14/bam/SamRecord.cpp:784:22: [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 intVal = atoi(valuePtr); data/libstatgen-1.0.14/bam/SamRecord.cpp:1876:5: [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(&recStruct, myRecordPtr, sizeof(bamRecordStruct)); data/libstatgen-1.0.14/bam/SamRecord.cpp:2553: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(&(myRecordPtr->myData), myReadName.c_str(), data/libstatgen-1.0.14/bam/SamRecord.cpp:2572: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(packedCigar, myCigarTempBuffer, data/libstatgen-1.0.14/bam/SamRecord.cpp:2858:5: [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(myCigarTempBuffer, packedCigar, data/libstatgen-1.0.14/bam/SamRecord.cpp:3207:36: [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. *duplicate += (char *)(strings[origIndex]); data/libstatgen-1.0.14/bam/SamRecord.h:45:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char myData[1]; data/libstatgen-1.0.14/bam/SamRecordHelper.cpp:60:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tag[3]; data/libstatgen-1.0.14/bam/examples/printRefPositions/Main.cpp:36:25: [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). startPosition = atoi(argv[4]); data/libstatgen-1.0.14/bam/examples/printRefPositions/Main.cpp:37:23: [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). endPosition = atoi(argv[5]); data/libstatgen-1.0.14/bam/test/ModifyVar.cpp:575: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 tag[3]; data/libstatgen-1.0.14/bam/test/ModifyVar.h:80:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char expectedSequenceBuffer[100]; data/libstatgen-1.0.14/bam/test/ModifyVar.h:82:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char expectedTagsBuffer[100]; data/libstatgen-1.0.14/bam/test/ReadFiles.cpp:454: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestEquals.cpp:361: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:46: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:308: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:512: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:714: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:909: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:1159: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:1305: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:1458: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:1588: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 tag[3]; data/libstatgen-1.0.14/bam/test/TestValidate.cpp:1737: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 tag[3]; data/libstatgen-1.0.14/bam/test/ValidationTest.cpp:29: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 qname[256]; data/libstatgen-1.0.14/bam/test/WriteFiles.cpp:57: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 type[3] = "HD"; data/libstatgen-1.0.14/bam/test/WriteFiles.cpp:58: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 tag[3] = "VN"; data/libstatgen-1.0.14/fastq/FastQFile.cpp:247: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 buffer[100]; data/libstatgen-1.0.14/fastq/FastQFile.cpp:248:7: [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. if(sprintf(buffer, data/libstatgen-1.0.14/fastq/FastQFile.cpp:255:7: [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. if(sprintf(buffer, data/libstatgen-1.0.14/fastq/FastQFile.cpp:854: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 buffer[100]; data/libstatgen-1.0.14/fastq/FastQFile.cpp:855:7: [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(buffer, "ERROR on Line %u: ", myLineNum); data/libstatgen-1.0.14/general/BaseAsciiMap.h:56:21: [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 unsigned char baseColor2int[256+1]; // base space read (ATCG) data/libstatgen-1.0.14/general/BaseAsciiMap.h:61:21: [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 unsigned char base2int[256+1]; // base space read (ATCG) data/libstatgen-1.0.14/general/BaseAsciiMap.h:65:21: [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 unsigned char color2int[256+1]; // base space read (ATCG) data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:197:13: [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(dest, src, count); data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:494:19: [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,"r"); data/libstatgen-1.0.14/general/CSG_MD5.h:63:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[64]; /* input buffer */ data/libstatgen-1.0.14/general/CSG_MD5.h:124:17: [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 unsigned char PADDING[64] = { data/libstatgen-1.0.14/general/CSG_MD5.h:225:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char digest[16], /* message digest */ data/libstatgen-1.0.14/general/CSG_MD5.h:228:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bits[8]; data/libstatgen-1.0.14/general/CSG_MD5.h:255:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char block[64]) data/libstatgen-1.0.14/general/CSG_MD5.h:400: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 *)output)[i] = (char)value; data/libstatgen-1.0.14/general/CharBuffer.cpp:79: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(myBuffer, stringBuffer.c_str(), stringBuffer.length()); data/libstatgen-1.0.14/general/CharBuffer.cpp:99:5: [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(myBuffer, buffer.myBuffer, buffer.myBufferLen); data/libstatgen-1.0.14/general/Chromosome.cpp:33: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). assert(!gs->open(isColorSpace)); data/libstatgen-1.0.14/general/Chromosome.cpp:44: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). assert(!gs->open(isColorSpace)); data/libstatgen-1.0.14/general/CigarRoller.cpp:304: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 buf[12]; // > 1 + log base 10 of MAXINT data/libstatgen-1.0.14/general/CigarRoller.cpp:314:9: [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%c", (*i).count, (*i).getChar()); data/libstatgen-1.0.14/general/GenomeSequence.cpp:158:9: [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). if (open(false)) data/libstatgen-1.0.14/general/GenomeSequence.cpp:182:22: [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). bool GenomeSequence::open(bool isColorSpace, int flags) data/libstatgen-1.0.14/general/GenomeSequence.cpp:209:31: [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). rc = genomeSequenceArray::open(_umfaFilename.c_str(), flags); data/libstatgen-1.0.14/general/GenomeSequence.cpp:327:9: [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(c->md5+2*i, "%02x", md5Signature[i]); data/libstatgen-1.0.14/general/GenomeSequence.cpp:515:19: [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). if (fastaFile.open(_fastaFilename.c_str())) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1323:19: [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). if (dbSNP.open(inputFileName, O_RDONLY)) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1384:19: [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). if (reference.open()) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1445:19: [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). if (reference.open()) data/libstatgen-1.0.14/general/GenomeSequence.h:152:10: [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). bool open(bool isColorSpace = false, int flags = O_RDONLY); data/libstatgen-1.0.14/general/GenomeSequence.h:159:10: [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). bool open(const char *filename, int flags = O_RDONLY) data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:55: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 md5[2*MD5_DIGEST_LENGTH + 1]; // 32 chars plus NUL, SAM SQ:M5 value data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:56: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 name[MAX_GENOME_INFO_STRING]; // SAM SQ:SN value data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:57: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 assemblyID[MAX_GENOME_INFO_STRING]; // SAM SQ:AS value data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:58: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 uri[MAX_GENOME_INFO_STRING]; // SAM SQ:UR value data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:59: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 species[MAX_GENOME_INFO_STRING]; // SAM SQ:SP value data/libstatgen-1.0.14/general/GenotypeLists.cpp:466:32: [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. printf("%s - ", (const char *) ped[family->path[i]].pid); data/libstatgen-1.0.14/general/GzipHeader.cpp:54: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(headerBuffer, buffer, GZIP_HEADER_SIZE); data/libstatgen-1.0.14/general/GzipHeader.cpp:85: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(headerBuffer, buffer, GZIP_HEADER_SIZE); data/libstatgen-1.0.14/general/GzipHeader.h:66: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 headerBuffer[GzipHeader::GZIP_HEADER_SIZE]; data/libstatgen-1.0.14/general/GzipHeader.h:68: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[GZIP_HEADER_SIZE]; data/libstatgen-1.0.14/general/Input.cpp: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[BUFSIZE]; data/libstatgen-1.0.14/general/Input.cpp:58: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[BUFSIZE]; data/libstatgen-1.0.14/general/Input.cpp:74: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[BUFSIZE]; data/libstatgen-1.0.14/general/Input.cpp:90: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[BUFSIZE]; data/libstatgen-1.0.14/general/Input.cpp:122: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[BUFSIZE]; data/libstatgen-1.0.14/general/InputFile.h:167:13: [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(buffer, myFileBuffer+myBufferIndex, size); data/libstatgen-1.0.14/general/InputFile.h:180:17: [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(buffer, myFileBuffer+myBufferIndex, availableBytes); data/libstatgen-1.0.14/general/InputFile.h:231:21: [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((char*)buffer+availableBytes, data/libstatgen-1.0.14/general/MathMatrix.cpp:342: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[100]; data/libstatgen-1.0.14/general/MathMatrix.cpp:375: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 dimensions[30]; data/libstatgen-1.0.14/general/MathMatrix.cpp:377: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(dimensions, "[%d x %d]", r, c); data/libstatgen-1.0.14/general/MathMatrix.cpp:391:45: [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. fprintf(f, "%*s ", width[j], (const char *) extras[j].label); data/libstatgen-1.0.14/general/MathMatrix.cpp:396:49: [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. fprintf(f, "\n%*s ", columnZero, (const char *) data[i]->label); data/libstatgen-1.0.14/general/MathMatrix.cpp:667:49: [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. fprintf(f, "\n%*s ", columnZero, (const char *) data[i]->label); data/libstatgen-1.0.14/general/MathMatrix.cpp:703:45: [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. fprintf(f, "%*s ", width[j], (const char *) extras[j].label); data/libstatgen-1.0.14/general/MathMatrix.cpp:710:49: [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. fprintf(f, "\n%*s ", columnZero, (const char *) data[i]->label); data/libstatgen-1.0.14/general/MathMatrix.cpp:746:45: [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. fprintf(f, "%*s ", width[j], (const char *) extras[j].label); data/libstatgen-1.0.14/general/MemoryAllocators.cpp:24:25: [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 *** cube = new char ** [n]; data/libstatgen-1.0.14/general/MemoryAllocators.cpp:78:26: [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 ** matrix = new char * [rows]; data/libstatgen-1.0.14/general/MemoryMap.cpp:156: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). bool MemoryMap::open(const char * file, int flags) data/libstatgen-1.0.14/general/MemoryMap.cpp:181: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). fd = ::open(file, flags); data/libstatgen-1.0.14/general/MemoryMap.cpp:283:5: [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). open(file, O_RDWR); data/libstatgen-1.0.14/general/MemoryMap.cpp:285: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). fd = ::open(file, O_RDWR|O_CREAT|O_TRUNC, 0666); data/libstatgen-1.0.14/general/MemoryMap.cpp:334:20: [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). result = this->open("test/test_memmap_data.txt"); data/libstatgen-1.0.14/general/MemoryMap.cpp:342:20: [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). result = this->open("test/test_memmap_data.txt"); data/libstatgen-1.0.14/general/MemoryMap.h:190: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). virtual bool open(const char * file, int flags = O_RDONLY); data/libstatgen-1.0.14/general/MemoryMap.h:218: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. return ((char *)data)[index]; data/libstatgen-1.0.14/general/MemoryMapArray.cpp:74: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). assert(test.open("twinkypie")==0); data/libstatgen-1.0.14/general/MemoryMapArray.cpp:102: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). assert(test.open("twinkypie")==0); data/libstatgen-1.0.14/general/MemoryMapArray.cpp:139: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). assert(test.open("twinkypie")==0); data/libstatgen-1.0.14/general/MemoryMapArray.cpp:168: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). assert(test.open("twinkypie")==0); data/libstatgen-1.0.14/general/MemoryMapArray.h:79: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 creationUser[32]; data/libstatgen-1.0.14/general/MemoryMapArray.h:80: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 creationHost[32]; data/libstatgen-1.0.14/general/MemoryMapArray.h:81: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 application[32]; data/libstatgen-1.0.14/general/MemoryMapArray.h:231: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 hostname[256]; data/libstatgen-1.0.14/general/MemoryMapArray.h:269:10: [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). bool open(const char *file, int flags = O_RDONLY) data/libstatgen-1.0.14/general/MemoryMapArray.h:271:29: [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 rc = MemoryMap::open(file, flags); data/libstatgen-1.0.14/general/Parameters.cpp:86:20: [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 *) var = atoi(value); data/libstatgen-1.0.14/general/Parameters.cpp:368:47: [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. matches.catprintf(" --%s", (const char *) index[i]); data/libstatgen-1.0.14/general/Parameters.cpp:472:31: [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 *) ptr->value = atoi(extras); data/libstatgen-1.0.14/general/Pedigree.cpp:72:27: [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. (const char *) persons[i]->famid, data/libstatgen-1.0.14/general/Pedigree.cpp:73:27: [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. (const char *) persons[i]->pid); data/libstatgen-1.0.14/general/Pedigree.cpp:271:38: [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. printf("%s ", (const char *) markerNames[m]); data/libstatgen-1.0.14/general/Pedigree.cpp:333:44: [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. fprintf(output, " M %s\n", (const char *) markerNames[m]); data/libstatgen-1.0.14/general/Pedigree.cpp:336:44: [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. fprintf(output, " T %s\n", (const char *) traitNames[t]); data/libstatgen-1.0.14/general/Pedigree.cpp:339:44: [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. fprintf(output, " A %s\n", (const char *) affectionNames[a]); data/libstatgen-1.0.14/general/Pedigree.cpp:342:44: [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. fprintf(output, " C %s\n", (const char *) covariateNames[c]); data/libstatgen-1.0.14/general/Pedigree.cpp:345:44: [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. fprintf(output, " $ %s\n", (const char *) stringNames[s]); data/libstatgen-1.0.14/general/Pedigree.cpp:404:28: [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. (const char *) markerInfo[m]->GetAlleleLabel(p->markers[m][0]), data/libstatgen-1.0.14/general/Pedigree.cpp:405:28: [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. (const char *) markerInfo[m]->GetAlleleLabel(p->markers[m][1])); data/libstatgen-1.0.14/general/Pedigree.cpp:436:16: [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(output, "wt"); data/libstatgen-1.0.14/general/Pedigree.cpp:444:16: [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(output, "wt"); data/libstatgen-1.0.14/general/Pedigree.cpp:484:19: [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. (const char *) traitNames[t], mean); data/libstatgen-1.0.14/general/Pedigree.cpp:581:47: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/Pedigree.cpp:582:47: [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. (const char *) persons[i]->sibs[j]->famid, data/libstatgen-1.0.14/general/Pedigree.cpp:583:47: [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. (const char *) persons[i]->sibs[j]->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:665:39: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/Pedigree.cpp:666:39: [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. (const char *) persons[i]->famid); data/libstatgen-1.0.14/general/Pedigree.cpp:669:43: [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. (const char *) persons[i]->father->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:674:43: [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. (const char *) persons[i]->mother->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:679:43: [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. (const char *) persons[i]->mother->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:680:43: [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. (const char *) persons[i]->father->pid); data/libstatgen-1.0.14/general/Pedigree.cpp:728:35: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/Pedigree.cpp:729:35: [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. (const char *) persons[i]->famid, (const char *) persons[i]->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:729:69: [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. (const char *) persons[i]->famid, (const char *) persons[i]->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:778:51: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/Pedigree.cpp:779:51: [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. (const char *) persons[i]->famid, data/libstatgen-1.0.14/general/Pedigree.cpp:780:51: [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. (const char *) persons[i]->sibs[j]->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:796:51: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/Pedigree.cpp:797:51: [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. (const char *) persons[i]->famid, data/libstatgen-1.0.14/general/Pedigree.cpp:798:51: [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. (const char *) persons[i]->sibs[j]->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:844:39: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/Pedigree.cpp:845:39: [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. (const char *) persons[i]->famid); data/libstatgen-1.0.14/general/Pedigree.cpp:848:43: [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. (const char *) persons[i]->father->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:852:43: [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. (const char *) persons[i]->mother->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:857:43: [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. (const char *) persons[i]->mother->pid, data/libstatgen-1.0.14/general/Pedigree.cpp:858:43: [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. (const char *) persons[i]->father->pid); data/libstatgen-1.0.14/general/PedigreeDescription.cpp:104:41: [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. columnCount+1, (const char *) tokens[0]); data/libstatgen-1.0.14/general/PedigreeDescription.cpp:246:23: [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. (const char *)(tokens[0]), (const char *)(tokens[1]), data/libstatgen-1.0.14/general/PedigreeDescription.cpp:246:50: [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. (const char *)(tokens[0]), (const char *)(tokens[1]), data/libstatgen-1.0.14/general/PedigreeDescription.cpp:247:23: [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. (const char *)(tokens[2])); data/libstatgen-1.0.14/general/PedigreeFamily.cpp:160:51: [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. printf("Problem Person: %s\n", (const char *) ped[i].pid); data/libstatgen-1.0.14/general/PedigreeFamily.cpp:216:23: [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. (const char *) famid, (const char *) ped[j].pid, data/libstatgen-1.0.14/general/PedigreeFamily.cpp:216:45: [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. (const char *) famid, (const char *) ped[j].pid, data/libstatgen-1.0.14/general/PedigreeFamily.cpp:217:23: [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. (const char *) ped[j].fatid, (const char *) ped[j].motid, data/libstatgen-1.0.14/general/PedigreeFamily.cpp:217:52: [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. (const char *) ped[j].fatid, (const char *) ped[j].motid, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:255: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(newArray, markerInfo, sizeof(MarkerInfo *) * markerInfoSize); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:284:38: [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. printf("%s ", (const char *) names[i]); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:415:26: [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. (const char *) sortedMarkers[i]->name, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:417:26: [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. (const char *) sortedMarkers[i-1]->name, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:420:26: [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. (const char *) sortedMarkers[i]->name, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:422:26: [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. (const char *) sortedMarkers[i-1]->name, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:525:31: [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). next_allele = atoi(tokens[1]) + 1; data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:638:30: [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. (const char *) tokens[1], (const char *) tokens[3]); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:638:56: [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. (const char *) tokens[1], (const char *) tokens[3]); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:644:30: [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. (const char *) tokens[1], (const char *) tokens[4]); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:644:56: [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. (const char *) tokens[1], (const char *) tokens[4]); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:727:21: [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 * output = fopen(filename, "wt"); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:750:32: [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. (const char *) markerInfo[i]->name, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:755:32: [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. (const char *) markerInfo[i]->name, data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:765:21: [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 * output = fopen(filename, "wt"); data/libstatgen-1.0.14/general/PedigreeGlobals.cpp:826:21: [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 unsigned char lookup[128]; data/libstatgen-1.0.14/general/PedigreeLoader.cpp:113:26: [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. (const char *) tokens[field-1]); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:147:42: [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). new_status = atoi(affection); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:152:51: [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. col, (const char *) affectionNames[a], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:161:43: [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. col, (const char *) affectionNames[a], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:183:43: [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. col, (const char *) markerNames[m], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:214:43: [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. col, (const char *) traitNames[t], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:243:43: [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. col, (const char *) covariateNames[c], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:257:43: [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. col, (const char *) stringNames[c], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:259:68: [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. (const char *) p->strings[c], (const char *) tokens[field]); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:285:44: [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). new_zygosity = atoi(zygosity); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:467:42: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:489:46: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:505:46: [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. (const char *) markerNames[m], data/libstatgen-1.0.14/general/PedigreeLoader.cpp:556:78: [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. printf(" AUTOMATIC MERGE: Reading data file '%s' ...\n", (const char *) filenames[i]); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:601:27: [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. (const char *) multiPd[i].filename, (const char *) filenames[i]); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:601:63: [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. (const char *) multiPd[i].filename, (const char *) filenames[i]); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:609:30: [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. (const char *) filenames[i]); data/libstatgen-1.0.14/general/PedigreeLoader.cpp:639:26: [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 result = atoi(code); data/libstatgen-1.0.14/general/PedigreeTrim.cpp:169:35: [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. (const char *) persons[fam->path[i]]->pid); data/libstatgen-1.0.14/general/PhoneHome.cpp:209: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 buf[BUF_SIZE]; data/libstatgen-1.0.14/general/STLUtilities.h:130: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 digits[20]; data/libstatgen-1.0.14/general/Sort.cpp:28:25: [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,Item(x),width);\ data/libstatgen-1.0.14/general/Sort.cpp:29:25: [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(Item(x),Item(y),width);\ data/libstatgen-1.0.14/general/Sort.cpp:30:25: [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(Item(y),tmp,width);\ data/libstatgen-1.0.14/general/Sort.cpp:186:25: [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,Item(x),width);\ data/libstatgen-1.0.14/general/Sort.cpp:187:25: [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(Item(x),Item(y),width);\ data/libstatgen-1.0.14/general/Sort.cpp:188:25: [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(Item(y),tmp,width);\ data/libstatgen-1.0.14/general/Sort.cpp:189:25: [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,Item2(x),width);\ data/libstatgen-1.0.14/general/Sort.cpp:190:25: [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(Item2(x),Item2(y),width);\ data/libstatgen-1.0.14/general/Sort.cpp:191:25: [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(Item2(y),tmp,width);\ data/libstatgen-1.0.14/general/StringArray.cpp:80:16: [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, "wt"); data/libstatgen-1.0.14/general/StringArray.cpp:88:16: [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, "wt"); data/libstatgen-1.0.14/general/StringArray.cpp:115:35: [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. fprintf(f, "%s%c", (const char *)(*strings[i]), i == count-1 ? '\n' : '\t'); data/libstatgen-1.0.14/general/StringArray.cpp:193:13: [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((char *) *strings[count++], ((const char *) s) + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:193:21: [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. memcpy((char *) *strings[count++], ((const char *) s) + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:214:13: [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((char *) *strings[count++], ((const char *) s) + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:214:21: [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. memcpy((char *) *strings[count++], ((const char *) s) + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:237:13: [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((char *) *strings[count++], (const char *) s + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:237:21: [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. memcpy((char *) *strings[count++], (const char *) s + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:259:13: [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((char *) *strings[count++], ((const char *) s) + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:259:21: [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. memcpy((char *) *strings[count++], ((const char *) s) + oldpos, pos - oldpos); data/libstatgen-1.0.14/general/StringArray.cpp:426:40: [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. fprintf(output, "%s\n", (const char *)(*strings[i])); data/libstatgen-1.0.14/general/StringArray.cpp:437:40: [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. fprintf(output, "%s%c", (const char *)(*strings[i]), i == count - 1 ? '\n' : '\t'); data/libstatgen-1.0.14/general/StringBasics.cpp:61: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(buffer, s, len + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:78:5: [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(buffer, s.buffer, len + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:97: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(tmp, buffer, len); data/libstatgen-1.0.14/general/StringBasics.cpp:123:5: [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(buffer, s.buffer, len + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:132:5: [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(buffer, s.buffer + start, n); data/libstatgen-1.0.14/general/StringBasics.cpp:149: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(buffer, s, len + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:205:5: [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(buffer + len, rhs.buffer, rhs.len + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:216: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(buffer + len, rhs, clen + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:225:5: [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(result.buffer, buffer, len); data/libstatgen-1.0.14/general/StringBasics.cpp:226:5: [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(result.buffer + len, rhs.buffer, rhs.len + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:237: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(result.buffer, buffer, len); data/libstatgen-1.0.14/general/StringBasics.cpp:238: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(result.buffer + len, rhs, clen + 1); data/libstatgen-1.0.14/general/StringBasics.cpp:363: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(buffer, "%.3f", rhs); data/libstatgen-1.0.14/general/StringBasics.cpp:508: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 check[2] = {0, 0}; data/libstatgen-1.0.14/general/StringBasics.cpp:554: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 check[2] = {'G', 0}; data/libstatgen-1.0.14/general/StringBasics.cpp:809:5: [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(result.buffer, buffer, n); data/libstatgen-1.0.14/general/StringBasics.cpp:819:5: [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(result.buffer, buffer + len - n, n); data/libstatgen-1.0.14/general/StringBasics.cpp:835:5: [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(result.buffer, buffer + start, n); data/libstatgen-1.0.14/general/StringBasics.cpp:1395: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 temp[100]; data/libstatgen-1.0.14/general/StringBasics.cpp:1456:29: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). my_vsnprintf_file = tmpfile(); data/libstatgen-1.0.14/general/StringBasics.h:206:16: [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(buffer); data/libstatgen-1.0.14/general/StringHash.cpp:571:21: [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 * output = fopen(filename, "wt"); data/libstatgen-1.0.14/general/Tabix.cpp:68: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 magic[4]; data/libstatgen-1.0.14/general/UncompressedFileType.cpp:44: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). filePtr = fopen(filename, mode); data/libstatgen-1.0.14/general/UncompressedFileType.cpp:60: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). filePtr = fopen(filename, mode); data/libstatgen-1.0.14/general/glfHandler.cpp:101:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magicNumber[4]; data/libstatgen-1.0.14/general/glfHandler.cpp:345: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 magicNumber[4] = {'G', 'L', 'F', 3}; data/libstatgen-1.0.14/general/glfHandler.cpp:394:44: [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. ifwrite(handle, (void *)(const char *) indelSequence[0], abs(data.indel.length[0])); data/libstatgen-1.0.14/general/glfHandler.cpp:395:44: [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. ifwrite(handle, (void *)(const char *) indelSequence[1], abs(data.indel.length[1])); data/libstatgen-1.0.14/general/glfHandler.h:34:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char lk[3]; data/libstatgen-1.0.14/general/glfHandler.h:39:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char padding[3]; data/libstatgen-1.0.14/general/glfHandler.h:59:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char lk[10]; data/libstatgen-1.0.14/general/glfHandler.h:139:12: [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 char translateBase[16]; data/libstatgen-1.0.14/general/glfHandler.h:140:12: [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 char backTranslateBase[5]; data/libstatgen-1.0.14/general/glfHandler.h:142:21: [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 unsigned char nullLogLikelihoods[10]; data/libstatgen-1.0.14/general/test/GenomeSequence_test.cpp:113:19: [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). if (reference.open()) { data/libstatgen-1.0.14/general/test/GenomeSequence_test.cpp:172:19: [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). if (reference.open()) { data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:153: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(result, "Hello, world!"); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:156: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(result, "n = %20.5lXXX", 123ULL); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:162: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(result, "addr = %08xXXX", 1234); data/libstatgen-1.0.14/general/test/STLUtilities_test.cpp:165: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(result, "Hello, world!! Imagine: %d!", 2345.1234); data/libstatgen-1.0.14/general/test/inputFileTest/InputFileTest.cpp:680: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 largeBuffer[largeTestFileSize + 5]; data/libstatgen-1.0.14/general/test/inputFileTest/InputFileTest.h:54: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 myTestBuffer[MAX_TEST_BUFFER_SIZE]; data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.cpp:82:77: [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). check(m_failures, ++m_testNum, "Re-open vector file", false, testVector.open(TEST_FILE_NAME)); data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.cpp:137:77: [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). check(m_failures, ++m_testNum, "Re-open vector file", false, testVector.open(TEST_FILE_NAME)); data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.cpp:193:77: [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). check(m_failures, ++m_testNum, "Re-open vector file", false, testVector.open(TEST_FILE_NAME)); data/libstatgen-1.0.14/general/test/memoryMapArrayTest/MemoryMapArrayTest.cpp:249:77: [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). check(m_failures, ++m_testNum, "Re-open vector file", false, testVector.open(TEST_FILE_NAME)); data/libstatgen-1.0.14/glf/GlfHeader.cpp:93: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 magic[GLF_MAGIC_LEN]; data/libstatgen-1.0.14/samtools/bgzf.c:54:30: [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). #define _bgzf_open(fn, mode) fopen(fn, mode) data/libstatgen-1.0.14/samtools/bgzf.c:148: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). if ((fpw = fopen(path, "w")) == 0) return 0; data/libstatgen-1.0.14/samtools/bgzf.c:153: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). if ((fpw = fopen(path, "r+")) == 0) return 0; data/libstatgen-1.0.14/samtools/bgzf.c:199:2: [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(buffer, g_magic, BLOCK_HEADER_LENGTH); // the last two bytes are a place holder for the length of the block data/libstatgen-1.0.14/samtools/bgzf.c:245: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(fp->uncompressed_block, fp->uncompressed_block + input_length, remaining); data/libstatgen-1.0.14/samtools/bgzf.c:308:2: [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(fp->uncompressed_block, p->block, BGZF_BLOCK_SIZE); data/libstatgen-1.0.14/samtools/bgzf.c:337:2: [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(kh_val(h, k).block, fp->uncompressed_block, BGZF_BLOCK_SIZE); data/libstatgen-1.0.14/samtools/bgzf.c:364:2: [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(compressed_block, header, BLOCK_HEADER_LENGTH); data/libstatgen-1.0.14/samtools/bgzf.c:396: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(output, buffer + fp->block_offset, copy_length); data/libstatgen-1.0.14/samtools/bgzf.c:441: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(buffer + fp->block_offset, input, copy_length); data/libstatgen-1.0.14/samtools/bgzf.c:576: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(str->s + str->l, buf + fp->block_offset, l); data/libstatgen-1.0.14/samtools/knetfile.c:204:26: [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). server.sin_port = htons(atoi(port)); data/libstatgen-1.0.14/samtools/knetfile.c:281:2: [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(ftp->pasv_ip, v, 4 * sizeof(int)); data/libstatgen-1.0.14/samtools/knetfile.c:289: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 host[80], port[10]; data/libstatgen-1.0.14/samtools/knetfile.c:297:2: [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(host, "%d.%d.%d.%d", ftp->pasv_ip[0], ftp->pasv_ip[1], ftp->pasv_ip[2], ftp->pasv_ip[3]); data/libstatgen-1.0.14/samtools/knetfile.c:298:2: [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(port, "%d", ftp->pasv_port); data/libstatgen-1.0.14/samtools/knetfile.c:373: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 tmp[32]; data/libstatgen-1.0.14/samtools/knetfile.c:375: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(tmp, "REST %lld\r\n", (long long)fp->offset); data/libstatgen-1.0.14/samtools/knetfile.c:377:3: [2] (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). Risk is low because the source is a constant string. strcpy(tmp, "REST "); data/libstatgen-1.0.14/samtools/knetfile.c:379:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(tmp, "\r\n"); data/libstatgen-1.0.14/samtools/knetfile.c:447:10: [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. l += sprintf(buf + l, "Range: bytes=%lld-\r\n", (long long)fp->offset); data/libstatgen-1.0.14/samtools/knetfile.c:448:7: [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. l += sprintf(buf + l, "\r\n"); data/libstatgen-1.0.14/samtools/knetfile.c:517: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(fn, O_RDONLY | O_BINARY); data/libstatgen-1.0.14/samtools/knetfile.c:519: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(fn, O_RDONLY); data/libstatgen-1.0.14/vcf/VcfFile.cpp:41:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bool VcfFile::open(const char* filename, const char* mode, data/libstatgen-1.0.14/vcf/VcfFile.h:40: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). virtual bool open(const char* filename, VcfHeader& header) = 0; data/libstatgen-1.0.14/vcf/VcfFile.h:68:10: [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). bool open(const char* filename, const char* mode, data/libstatgen-1.0.14/vcf/VcfFileReader.cpp:51: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). bool VcfFileReader::open(const char* filename, VcfHeader& header) data/libstatgen-1.0.14/vcf/VcfFileReader.cpp:57: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). if(VcfFile::open(filename, "r")) data/libstatgen-1.0.14/vcf/VcfFileReader.cpp:78: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). bool VcfFileReader::open(const char* filename, VcfHeader& header, data/libstatgen-1.0.14/vcf/VcfFileReader.cpp:82:9: [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). if(!open(filename, header)) data/libstatgen-1.0.14/vcf/VcfFileReader.h:56: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). virtual bool open(const char* filename, VcfHeader& header); data/libstatgen-1.0.14/vcf/VcfFileReader.h:75: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). virtual bool open(const char* filename, VcfHeader& header, data/libstatgen-1.0.14/vcf/VcfFileWriter.cpp:33: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). bool VcfFileWriter::open(const char* filename, VcfHeader& header, data/libstatgen-1.0.14/vcf/VcfFileWriter.cpp:37: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). if(VcfFile::open(filename, "w", compressionMode)) data/libstatgen-1.0.14/vcf/VcfFileWriter.cpp:58: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). bool VcfFileWriter::open(const char* filename, VcfHeader& header) data/libstatgen-1.0.14/vcf/VcfFileWriter.cpp:60: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). return(open(filename, header, InputFile::BGZF)); data/libstatgen-1.0.14/vcf/VcfFileWriter.h:41:10: [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). bool open(const char* filename, VcfHeader& header, data/libstatgen-1.0.14/vcf/VcfFileWriter.h:49: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). virtual bool open(const char* filename, VcfHeader& header); data/libstatgen-1.0.14/vcf/VcfRecord.cpp:76:26: [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). my1BasedPosNum = atoi(my1BasedPos.c_str()); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:69: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). assert(reader.open("fileDoesNotExist.txt", header) == false); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:133: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). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset1.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:413: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). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset2.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:567: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). reader.open("testFiles/vcfFile.vcf", header, NULL, NULL, data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:721: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). reader.open("testFiles/vcfFile.vcf", header, NULL, NULL, data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:875: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). reader.open("testFiles/vcfFile.vcf", header, NULL, "NA00002", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1029: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). reader.open("testFiles/vcfFile.vcf", header, NULL, "NA00001", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1184: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). reader.open("testFiles/vcfFile.vcf", header, NULL, "NA00001", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1266: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). reader.open("testFiles/vcfFile.vcf", header, NULL, "NA00001", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1348: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). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset1.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1423: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). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset1.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1510: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). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset1.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1572: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). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1703: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). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1807: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). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1813: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). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset1.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1875:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header, "testFiles/subset1.txt", data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1911:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:1979:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2036:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2149:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2230:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2307:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). reader.open("testFiles/vcfFile.vcf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2371:19: [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). assert(reader.open("testFiles/vcfFile.vcf", header) == true); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2372:19: [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). assert(writer.open("results/vcfFile.vcf", header, InputFile::DEFAULT) data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2380:19: [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). assert(reader.open("testFiles/vcfFile.vcf", header) == true); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2381:19: [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). assert(writer.open("results/vcfFileNoInfo.vcf", header, data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2391:19: [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). assert(reader.open("testFiles/vcfFile.vcf", header) == true); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2392:19: [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). assert(writer.open("results/vcfFileNoInfoBGZF.vcf", header) == true); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2401:19: [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). assert(reader.open("testFiles/vcfFile.vcf", header) == true); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2403:19: [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). assert(writer.open("results/vcfFileNoInfoKeepGT.vcf", header, data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2413:19: [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). assert(reader.open("testFiles/vcfFile.vcf", header) == true); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2419:19: [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). assert(writer.open("results/vcfFileNoInfoKeepGQHQ.vcf", header, data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2445: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2750: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2769: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2775: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2782: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2788: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2793: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2803: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2811: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2836: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2841: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2851: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2863: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2868: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2873: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2880: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2889: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2894: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2899: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2906: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2914: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). reader.open("testFiles/testTabix.vcf.bgzf", header); data/libstatgen-1.0.14/vcf/test/VcfFileTest.cpp:2937: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). reader.open("testFiles/testTabixBadIndex.vcf.bgzf", header); data/libstatgen-1.0.14/bam/BamInterface.cpp:197:30: [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). int32_t nameLength = strlen(refName) + 1; data/libstatgen-1.0.14/bam/Pileup.h:395:45: [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). if(strncmp(err.what(), overflowErr, strlen(overflowErr)) == 0) data/libstatgen-1.0.14/bam/SamFilter.cpp:252:29: [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. case Cigar::mismatch: data/libstatgen-1.0.14/bam/SamRecord.cpp:983: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). if(strlen(tag) != 2) data/libstatgen-1.0.14/bam/SamRecordHelper.cpp:46: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). if(strncmp(readSeq, sequence, strlen(sequence)) == 0) data/libstatgen-1.0.14/bam/SamValidation.cpp:249:28: [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). int32_t qnameLenNull = strlen(qname) + 1; data/libstatgen-1.0.14/bam/SamValidation.cpp:386:24: [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). int32_t rnameLen = strlen(rname); data/libstatgen-1.0.14/bam/SamValidation.cpp:555:32: [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(isValidCigar(cigar, strlen(sequence), validationErrors)); data/libstatgen-1.0.14/bam/SamValidation.cpp:571:24: [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). int32_t cigarLen = strlen(cigar); data/libstatgen-1.0.14/bam/SamValidation.cpp:625:18: [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 seqLen = strlen(sequence); data/libstatgen-1.0.14/bam/SamValidation.cpp:646:23: [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 qualLen = strlen(quality); data/libstatgen-1.0.14/general/BgzfFileType.h:104:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual inline int read(void * buffer, unsigned int size) data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:188:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ReturnCode read(uint8_t *buffer, ssize_t count) { data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:331:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = m_fileReader.read(&throwAwayBuffer, 1); data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:360:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PeekaheadBuffer::ReturnCode rc = m_fileReader.read((uint8_t *) (&header), sizeof(header)); data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:381:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = m_fileReader.read((uint8_t *) &gzipBuffer, header.BSIZE() + 1 - sizeof(header)); data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:529:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int BgzfFileTypeRecovery::read(void * buffer, unsigned int size) data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:536:50: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PeekaheadBuffer::ReturnCode rc = bgzfReader->read((uint8_t *) buffer, size); data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.cpp:590:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PeekaheadBuffer::ReturnCode rc = bgzfReader->read((uint8_t *) &ch, 1); data/libstatgen-1.0.14/general/BgzfFileTypeRecovery.h:75:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(void * buffer, unsigned int size); data/libstatgen-1.0.14/general/Cigar.cpp:104:18: [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. case mismatch: data/libstatgen-1.0.14/general/Cigar.cpp:129:18: [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. case mismatch: data/libstatgen-1.0.14/general/Cigar.cpp:455:18: [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. case mismatch: data/libstatgen-1.0.14/general/Cigar.h:90:9: [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. mismatch, ///< mismatch operation. Associated with CIGAR Operation "M" data/libstatgen-1.0.14/general/Cigar.h:134:22: [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. case mismatch: data/libstatgen-1.0.14/general/Cigar.h:157:31: [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. if ((operation == mismatch || operation == match) && (rhs.operation == mismatch || rhs.operation == match)) data/libstatgen-1.0.14/general/Cigar.h:157:84: [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. if ((operation == mismatch || operation == match) && (rhs.operation == mismatch || rhs.operation == match)) data/libstatgen-1.0.14/general/Cigar.h:182:18: [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. case mismatch: data/libstatgen-1.0.14/general/Cigar.h:224:18: [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. case mismatch: data/libstatgen-1.0.14/general/Cigar.h:303:18: [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. case mismatch: data/libstatgen-1.0.14/general/FileType.h:49:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual int read(void * buffer, unsigned int size) = 0; data/libstatgen-1.0.14/general/GenomeSequence.cpp:247: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). #define HAS_SUFFIX(str, suffix) ((strlen(suffix) < str.size()) && (str.substr(str.size() - strlen(suffix)) == suffix)) data/libstatgen-1.0.14/general/GenomeSequence.cpp:247:92: [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). #define HAS_SUFFIX(str, suffix) ((strlen(suffix) < str.size()) && (str.substr(str.size() - strlen(suffix)) == suffix)) data/libstatgen-1.0.14/general/GenomeSequence.cpp:831:50: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GenomeSequence::getReverseRead(std::string &read) data/libstatgen-1.0.14/general/GenomeSequence.cpp:834:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read.size()) for (int32_t i=(int) read.size() - 1; i>=0; i--) data/libstatgen-1.0.14/general/GenomeSequence.cpp:834:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read.size()) for (int32_t i=(int) read.size() - 1; i>=0; i--) data/libstatgen-1.0.14/general/GenomeSequence.cpp:836:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). newRead.push_back(BasePair(read[i])); data/libstatgen-1.0.14/general/GenomeSequence.cpp:841:45: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GenomeSequence::getReverseRead(String& read) data/libstatgen-1.0.14/general/GenomeSequence.cpp:844:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int j = read.Length()-1; data/libstatgen-1.0.14/general/GenomeSequence.cpp:848:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). temp = read[j]; data/libstatgen-1.0.14/general/GenomeSequence.cpp:849:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read[j] = read[i]; data/libstatgen-1.0.14/general/GenomeSequence.cpp:849:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read[j] = read[i]; data/libstatgen-1.0.14/general/GenomeSequence.cpp:850:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read[i] = temp; data/libstatgen-1.0.14/general/GenomeSequence.cpp:856:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string &read, data/libstatgen-1.0.14/general/GenomeSequence.cpp:870:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i<read.size(); i++) data/libstatgen-1.0.14/general/GenomeSequence.cpp:872:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (tolower(read[i]) != tolower((*this)[readLocation + i])) data/libstatgen-1.0.14/general/GenomeSequence.cpp:876:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (direction=='F' ? i<24 : (i >= (read.size() - 24))) validateMismatchCount++; data/libstatgen-1.0.14/general/GenomeSequence.cpp:889:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.c_str(), data/libstatgen-1.0.14/general/GenomeSequence.cpp:899:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.c_str(), data/libstatgen-1.0.14/general/GenomeSequence.cpp:909:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.c_str(), data/libstatgen-1.0.14/general/GenomeSequence.cpp:918:71: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (recurse && ABS(validateMismatchCount - mismatchCount) > (int) read.size()/2) data/libstatgen-1.0.14/general/GenomeSequence.cpp:921:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string reverseRead = read; data/libstatgen-1.0.14/general/GenomeSequence.cpp:1085:83: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GenomeSequence::getMismatchHatString(std::string &result, const std::string &read, genomeIndex_t location) const data/libstatgen-1.0.14/general/GenomeSequence.cpp:1088:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i < read.size(); i++) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1090:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i] == (*this)[location+i]) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1097:80: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GenomeSequence::getMismatchString(std::string &result, const std::string &read, genomeIndex_t location) const data/libstatgen-1.0.14/general/GenomeSequence.cpp:1100:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i < read.size(); i++) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1102:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i] == (*this)[location+i]) data/libstatgen-1.0.14/general/GenomeSequence.cpp:1103:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result.push_back(toupper(read[i])); data/libstatgen-1.0.14/general/GenomeSequence.cpp:1105:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result.push_back(tolower(read[i])); data/libstatgen-1.0.14/general/GenomeSequence.cpp:1109:63: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). genomeIndex_t GenomeSequence::simpleLocalAligner(std::string &read, std::string &quality, genomeIndex_t index, int windowSize) const data/libstatgen-1.0.14/general/GenomeSequence.cpp:1118:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (index + i + read.size() >= getNumberBases()) continue; data/libstatgen-1.0.14/general/GenomeSequence.cpp:1122:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). newScore = this->getMismatchCount(read, index + i); data/libstatgen-1.0.14/general/GenomeSequence.cpp:1126:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). newScore = this->getSumQ(read, quality, index + i); data/libstatgen-1.0.14/general/GenomeSequence.cpp:1319:9: [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). if (strlen(inputFileName)!=0) data/libstatgen-1.0.14/general/GenomeSequence.h:438:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void getReverseRead(std::string &read); data/libstatgen-1.0.14/general/GenomeSequence.h:441:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void getReverseRead(String& read); data/libstatgen-1.0.14/general/GenomeSequence.h:445:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string &read, data/libstatgen-1.0.14/general/GenomeSequence.h:473:51: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). genomeIndex_t simpleLocalAligner(std::string &read, std::string &quality, genomeIndex_t index, int windowSize) const; data/libstatgen-1.0.14/general/GenomeSequence.h:488:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int getMismatchCount(std::string &read, genomeIndex_t location, char exclude='\0') const data/libstatgen-1.0.14/general/GenomeSequence.h:491:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i<read.size(); i++) data/libstatgen-1.0.14/general/GenomeSequence.h:492:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i]!=exclude) mismatchCount += read[i]!=(*this)[location + i]; data/libstatgen-1.0.14/general/GenomeSequence.h:492:52: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i]!=exclude) mismatchCount += read[i]!=(*this)[location + i]; data/libstatgen-1.0.14/general/GenomeSequence.h:501:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int getSumQ(std::string &read, std::string &qualities, genomeIndex_t location) const data/libstatgen-1.0.14/general/GenomeSequence.h:504:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i<read.size(); i++) data/libstatgen-1.0.14/general/GenomeSequence.h:505:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sumQ += (read[i]!=(*this)[location + i] ? (qualities[i]-33) : 0); data/libstatgen-1.0.14/general/GenomeSequence.h:509:71: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void getMismatchHatString(std::string &result, const std::string &read, genomeIndex_t location) const; data/libstatgen-1.0.14/general/GenomeSequence.h:510:68: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void getMismatchString(std::string &result, const std::string &read, genomeIndex_t location) const; data/libstatgen-1.0.14/general/GenomeSequence.h:529:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string &read, data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:50:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, n, sizeof(name)-1); data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:64:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(assemblyID, newID, sizeof(assemblyID)-1); data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:69:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(species, newSpecies, sizeof(species)-1); data/libstatgen-1.0.14/general/GenomeSequenceHelpers.h:74:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(uri, newURI, sizeof(uri)-1); data/libstatgen-1.0.14/general/GreedyTupleAligner.h:51:9: [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. int mismatch; data/libstatgen-1.0.14/general/GreedyTupleAligner.h:86:25: [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. int& mismatch) data/libstatgen-1.0.14/general/GreedyTupleAligner.h:110:25: [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. if (mismatch >= MAX_MISMATCH) data/libstatgen-1.0.14/general/GreedyTupleAligner.h:119:33: [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. && ((j+1) > mismatch) data/libstatgen-1.0.14/general/GreedyTupleAligner.h:120:24: [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. && mismatch>0 data/libstatgen-1.0.14/general/GreedyTupleAligner.h:129:29: [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. int score = j - mismatch; data/libstatgen-1.0.14/general/GreedyTupleAligner.h:135:32: [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. bestMismatch = mismatch; data/libstatgen-1.0.14/general/GreedyTupleAligner.h:195:46: [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. cigarRoller.Add(CigarRoller::mismatch, queryLength - queryMatchCount); data/libstatgen-1.0.14/general/GreedyTupleAligner.h:200:124: [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. if ((pos = MatchTuple(query+q1, queryLength-q1, reference, searchStartIndex + r1, searchSize - r1, matchedLen, mismatch)) // found match position for tuple data/libstatgen-1.0.14/general/GreedyTupleAligner.h:255:39: [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. mismatch)) // found match position for tuple data/libstatgen-1.0.14/general/GzipFileType.h:108:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inline int read(void * buffer, unsigned int size) data/libstatgen-1.0.14/general/GzipHeader.cpp:83:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((int)GZIP_HEADER_SIZE == file.read(buffer, GZIP_HEADER_SIZE)) data/libstatgen-1.0.14/general/InputFile.h:512:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return myFileTypePtr->read(buffer, size); data/libstatgen-1.0.14/general/InputFile.h:755:32: [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). unsigned int numExpected = strlen(str); data/libstatgen-1.0.14/general/MathMatrix.cpp:347: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). buffer[strlen(buffer) - 1] = 0; data/libstatgen-1.0.14/general/MemoryMap.cpp:138:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t resultSize = read(fd, data, mapped_length); data/libstatgen-1.0.14/general/MemoryMapArray.h:92:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(application, s, sizeof(application)-1); data/libstatgen-1.0.14/general/MemoryMapArray.h:97:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(creationUser, s, sizeof(creationUser)-1); data/libstatgen-1.0.14/general/MemoryMapArray.h:102:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(creationHost, s, sizeof(creationHost)-1); data/libstatgen-1.0.14/general/Parameters.cpp:36:29: [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). description = new char [strlen(desc) + 1]; data/libstatgen-1.0.14/general/Parameters.cpp:322: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). group_len = max(strlen(ptr->description), group_len); data/libstatgen-1.0.14/general/Parameters.cpp:529:28: [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 item_len = 3 + strlen(ptr->description) + need_a_comma + state.Length(); data/libstatgen-1.0.14/general/Parameters.cpp:717:16: [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). len += strlen(argv[i]) + 1; data/libstatgen-1.0.14/general/Parameters.cpp:725:9: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(string, " "); data/libstatgen-1.0.14/general/PhoneHome.cpp:142:27: [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). if((name != NULL) && (strlen(name) != 0) && data/libstatgen-1.0.14/general/PhoneHome.cpp:143:26: [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). (val != NULL) && (strlen(val) != 0)) data/libstatgen-1.0.14/general/ReferenceSequence.cpp:81:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string &read, data/libstatgen-1.0.14/general/ReferenceSequence.cpp:95:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i<read.size(); i++) data/libstatgen-1.0.14/general/ReferenceSequence.cpp:97:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (tolower(read[i]) != tolower((*this)[readLocation + i])) data/libstatgen-1.0.14/general/ReferenceSequence.cpp:101:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (direction=='F' ? i<24 : (i >= (read.size() - 24))) validateMismatchCount++; data/libstatgen-1.0.14/general/ReferenceSequence.cpp:114:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.c_str(), data/libstatgen-1.0.14/general/ReferenceSequence.cpp:124:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.c_str(), data/libstatgen-1.0.14/general/ReferenceSequence.cpp:134:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read.c_str(), data/libstatgen-1.0.14/general/ReferenceSequence.cpp:143:71: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (recurse && abs(validateMismatchCount - mismatchCount) > (int) read.size()/2) data/libstatgen-1.0.14/general/ReferenceSequence.cpp:146:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string reverseRead = read; data/libstatgen-1.0.14/general/ReferenceSequence.h:147:113: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void getMismatchHatString(sequenceType &sequence, sequenceIndexType location, std::string &result, std::string &read) data/libstatgen-1.0.14/general/ReferenceSequence.h:150:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i < read.size(); i++) data/libstatgen-1.0.14/general/ReferenceSequence.h:152:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i] == sequence[location+i]) data/libstatgen-1.0.14/general/ReferenceSequence.h:160:110: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void getMismatchString(sequenceType &sequence, sequenceIndexType location, std::string &result, std::string &read) data/libstatgen-1.0.14/general/ReferenceSequence.h:163:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i < read.size(); i++) data/libstatgen-1.0.14/general/ReferenceSequence.h:165:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i] == sequence[location+i]) data/libstatgen-1.0.14/general/ReferenceSequence.h:166:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result.push_back(toupper(read[i])); data/libstatgen-1.0.14/general/ReferenceSequence.h:168:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result.push_back(tolower(read[i])); data/libstatgen-1.0.14/general/ReferenceSequence.h:181:84: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int getMismatchCount(sequenceType &sequence, sequenceIndexType location, readType &read, char exclude='\0') data/libstatgen-1.0.14/general/ReferenceSequence.h:184:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i<read.size(); i++) data/libstatgen-1.0.14/general/ReferenceSequence.h:185:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i]!=exclude) mismatchCount += read[i]!=sequence[location + i]; data/libstatgen-1.0.14/general/ReferenceSequence.h:185:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read[i]!=exclude) mismatchCount += read[i]!=sequence[location + i]; data/libstatgen-1.0.14/general/ReferenceSequence.h:195:75: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int getSumQ(sequenceType &sequence, sequenceIndexType location, readType &read, qualityType &qualities) data/libstatgen-1.0.14/general/ReferenceSequence.h:198:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (uint32_t i=0; i<read.size(); i++) data/libstatgen-1.0.14/general/ReferenceSequence.h:199:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sumQ += (read[i]!=sequence[location + i] ? (qualities[i]-33) : 0); data/libstatgen-1.0.14/general/ReferenceSequence.h:209:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). readType &read, data/libstatgen-1.0.14/general/ReferenceSequence.h:224:62: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). newScore = getMismatchCount(sequence, index + i, read); data/libstatgen-1.0.14/general/ReferenceSequence.h:228:53: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). newScore = getSumQ(sequence, index + i, read, quality); data/libstatgen-1.0.14/general/SmithWaterman.cpp:51:126: [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). SmithWaterman<256, 1024, uint16_t, const char *, const char *, const char *, uint32_t, uint32_t > sw(&A, &qualities, &B, strlen(A), strlen(B), allowedInsertDelete, direction); data/libstatgen-1.0.14/general/SmithWaterman.cpp:51:137: [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). SmithWaterman<256, 1024, uint16_t, const char *, const char *, const char *, uint32_t, uint32_t > sw(&A, &qualities, &B, strlen(A), strlen(B), allowedInsertDelete, direction); data/libstatgen-1.0.14/general/SmithWaterman.cpp:104:13: [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). if (strlen(B) < 100 || showAllCases) data/libstatgen-1.0.14/general/SmithWaterman.h:715:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Atype &read, data/libstatgen-1.0.14/general/SmithWaterman.h:735:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). setRead(&read); data/libstatgen-1.0.14/general/StringBasics.cpp:56:32: [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 clen = s == NULL ? 0 : strlen(s); data/libstatgen-1.0.14/general/StringBasics.cpp:146:20: [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 clen = strlen(s); data/libstatgen-1.0.14/general/StringBasics.cpp:214:20: [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 clen = strlen(rhs); data/libstatgen-1.0.14/general/StringBasics.cpp:235:20: [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 clen = strlen(rhs); data/libstatgen-1.0.14/general/StringBasics.cpp:622:14: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getchar(); data/libstatgen-1.0.14/general/UncompressedFileType.h:139:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inline int read(void * buffer, unsigned int size) data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:69:21: [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). ga.Align(query, strlen(query), reference, 0, strlen(ref), cs, matchPosition); data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:69:50: [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). ga.Align(query, strlen(query), reference, 0, strlen(ref), cs, matchPosition); data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:87:27: [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. case CigarRoller::mismatch: data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:139:67: [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). if((unsigned int)expectedCigar.getExpectedQueryBaseCount() != strlen(query)) { data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:142:142: [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). out << "Expected Cigar string length " << expectedCigar.getExpectedQueryBaseCount() << " does not match the length of the query " << strlen(query) << ". Please fix test case." << std::endl; data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:145:56: [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). if((unsigned int)cs.getExpectedQueryBaseCount() != strlen(query)) { data/libstatgen-1.0.14/general/test/GreedyTupleAligner_test.cpp:148:38: [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). out << "Query Length of " << strlen(query) << " does not match computed cigar string length of " << cs.getExpectedQueryBaseCount() << std::endl; data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:45:42: [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. Cigar::foundInReference(Cigar::mismatch)); data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:89:27: [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. op.operation = Cigar::mismatch; data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:118:38: [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. Cigar::foundInQuery(Cigar::mismatch)); data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:162:27: [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. op.operation = Cigar::mismatch; data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:192:32: [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. Cigar::isClip(Cigar::mismatch)); data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:236:27: [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. op.operation = Cigar::mismatch; data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:287:45: [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. op.count=5; op.operation = CigarRoller::mismatch; // test that match/mismatch get combined data/libstatgen-1.0.14/general/test/cigar/CigarRollerTest.cpp:303:45: [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. op.count=5; op.operation = CigarRoller::mismatch; data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.cpp:88:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string read("ACTGZZZZACTG"); data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.cpp:90:57: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Sequence::getMismatchHatString(sequence, 4, result, read); data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.cpp:96:65: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t location = Sequence::simpleLocalAligner(sequence, 0, read, quality, 12); data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.cpp:100:62: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int misMatches = Sequence::getMismatchCount(sequence, 0, read); data/libstatgen-1.0.14/general/test/referenceSequenceTest/ReferenceSequenceTest.cpp:105:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int sumQ = Sequence::getSumQ(sequence, 0, read, quality); data/libstatgen-1.0.14/glf/GlfFile.cpp:185:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(header.read(myFilePtr)) data/libstatgen-1.0.14/glf/GlfFile.cpp:287:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(refSection.read(myFilePtr)) data/libstatgen-1.0.14/glf/GlfFile.cpp:405:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(record.read(myFilePtr)) data/libstatgen-1.0.14/glf/GlfHeader.cpp:80:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool GlfHeader::read(IFILE filePtr) data/libstatgen-1.0.14/glf/GlfHeader.h:55:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/glf/GlfRecord.cpp:65:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool GlfRecord::read(IFILE filePtr) data/libstatgen-1.0.14/glf/GlfRecord.h:54:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/glf/GlfRefSection.cpp:79:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool GlfRefSection::read(IFILE filePtr) data/libstatgen-1.0.14/glf/GlfRefSection.h:57:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/samtools/knetfile.c:265: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). if(netwrite(ftp->ctrl_fd, cmd, strlen(cmd)) != strlen(cmd)) data/libstatgen-1.0.14/samtools/knetfile.c:265: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). if(netwrite(ftp->ctrl_fd, cmd, strlen(cmd)) != strlen(cmd)) data/libstatgen-1.0.14/samtools/knetfile.c:344:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fp->host, fn + 6, l); data/libstatgen-1.0.14/samtools/knetfile.c:345:27: [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). fp->retr = (char*)calloc(strlen(p) + 8, 1); data/libstatgen-1.0.14/samtools/knetfile.c:347:34: [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). fp->size_cmd = (char*)calloc(strlen(p) + 8, 1); data/libstatgen-1.0.14/samtools/knetfile.c:415:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fp->http_host, fn + 7, l); data/libstatgen-1.0.14/samtools/knetfile.c:563:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). curr = read(fp->fd, (void*)((char*)buf + l), rest); data/libstatgen-1.0.14/samtools/knetfile.h:8:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define netread(fd, ptr, len) read(fd, ptr, len) data/libstatgen-1.0.14/vcf/VcfFileReader.cpp:60:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!header.read(myFilePtr)) data/libstatgen-1.0.14/vcf/VcfFileReader.cpp:257:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!record.read(myFilePtr, mySiteOnly, myRecordDiscardRules, subsetPtr)) data/libstatgen-1.0.14/vcf/VcfGenotypeFormat.cpp:33:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfGenotypeFormat::read(IFILE filePtr) data/libstatgen-1.0.14/vcf/VcfGenotypeFormat.h:39:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/vcf/VcfGenotypeSample.cpp:44:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfGenotypeSample::read(IFILE filePtr, VcfGenotypeFormat& format) data/libstatgen-1.0.14/vcf/VcfGenotypeSample.h:42:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr, VcfGenotypeFormat& format); data/libstatgen-1.0.14/vcf/VcfHeader.cpp:34:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfHeader::read(IFILE filePtr) data/libstatgen-1.0.14/vcf/VcfHeader.h:41:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/vcf/VcfRecord.cpp:33:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfRecord::read(IFILE filePtr, bool siteOnly, data/libstatgen-1.0.14/vcf/VcfRecord.cpp:91:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read(filePtr, siteOnly, discardRules, sampleSubset)); data/libstatgen-1.0.14/vcf/VcfRecord.cpp:129:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!myFilter.read(filePtr)) data/libstatgen-1.0.14/vcf/VcfRecord.cpp:136:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!myInfo.read(filePtr)) data/libstatgen-1.0.14/vcf/VcfRecord.cpp:154:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). myGenotype.read(filePtr, sampleSubset); data/libstatgen-1.0.14/vcf/VcfRecord.h:50:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr, bool siteOnly, data/libstatgen-1.0.14/vcf/VcfRecordField.h:40:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual bool read(IFILE filePtr) = 0; data/libstatgen-1.0.14/vcf/VcfRecordFilter.cpp:28:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfRecordFilter::read(IFILE filePtr) data/libstatgen-1.0.14/vcf/VcfRecordFilter.h:45:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/vcf/VcfRecordGenotype.cpp:57:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfRecordGenotype::read(IFILE filePtr) data/libstatgen-1.0.14/vcf/VcfRecordGenotype.cpp:59:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read(filePtr, NULL)); data/libstatgen-1.0.14/vcf/VcfRecordGenotype.cpp:63:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfRecordGenotype::read(IFILE filePtr, VcfSubsetSamples* subsetInfo) data/libstatgen-1.0.14/vcf/VcfRecordGenotype.cpp:79:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!myFormat.read(filePtr)) data/libstatgen-1.0.14/vcf/VcfRecordGenotype.cpp:116:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!nextSample->read(filePtr, myFormat)) data/libstatgen-1.0.14/vcf/VcfRecordGenotype.h:56:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/vcf/VcfRecordGenotype.h:63:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr, VcfSubsetSamples* subsetInfo); data/libstatgen-1.0.14/vcf/VcfRecordInfo.cpp:34:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool VcfRecordInfo::read(IFILE filePtr) data/libstatgen-1.0.14/vcf/VcfRecordInfo.h:42:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(IFILE filePtr); data/libstatgen-1.0.14/vcf/test/VcfHeaderTest.cpp:51:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(header.read(filePtr) == false); data/libstatgen-1.0.14/vcf/test/VcfHeaderTest.cpp:61:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(header.read(filePtr)); data/libstatgen-1.0.14/vcf/test/VcfHeaderTest.cpp:93:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(header.read(filePtr)); ANALYSIS SUMMARY: Hits = 655 Lines analyzed = 79916 in approximately 1.91 seconds (41745 lines/second) Physical Source Lines of Code (SLOC) = 50920 Hits@level = [0] 259 [1] 213 [2] 369 [3] 15 [4] 58 [5] 0 Hits@level+ = [0+] 914 [1+] 655 [2+] 442 [3+] 73 [4+] 58 [5+] 0 Hits/KSLOC@level+ = [0+] 17.9497 [1+] 12.8633 [2+] 8.68028 [3+] 1.43362 [4+] 1.13904 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.