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/bcftools-1.11/HMM.c Examining data/bcftools-1.11/HMM.h Examining data/bcftools-1.11/bam2bcf.c Examining data/bcftools-1.11/bam2bcf.h Examining data/bcftools-1.11/bam2bcf_indel.c Examining data/bcftools-1.11/bam_sample.c Examining data/bcftools-1.11/bam_sample.h Examining data/bcftools-1.11/bcftools.h Examining data/bcftools-1.11/bin.c Examining data/bcftools-1.11/bin.h Examining data/bcftools-1.11/call.h Examining data/bcftools-1.11/ccall.c Examining data/bcftools-1.11/cols.c Examining data/bcftools-1.11/cols.h Examining data/bcftools-1.11/consensus.c Examining data/bcftools-1.11/convert.c Examining data/bcftools-1.11/convert.h Examining data/bcftools-1.11/csq.c Examining data/bcftools-1.11/em.c Examining data/bcftools-1.11/extsort.c Examining data/bcftools-1.11/extsort.h Examining data/bcftools-1.11/filter.c Examining data/bcftools-1.11/filter.h Examining data/bcftools-1.11/gvcf.c Examining data/bcftools-1.11/gvcf.h Examining data/bcftools-1.11/hclust.c Examining data/bcftools-1.11/hclust.h Examining data/bcftools-1.11/hex.h Examining data/bcftools-1.11/khash_str2str.h Examining data/bcftools-1.11/kheap.h Examining data/bcftools-1.11/kmin.c Examining data/bcftools-1.11/kmin.h Examining data/bcftools-1.11/main.c Examining data/bcftools-1.11/mcall.c Examining data/bcftools-1.11/mpileup.c Examining data/bcftools-1.11/mw.h Examining data/bcftools-1.11/peakfit.c Examining data/bcftools-1.11/peakfit.h Examining data/bcftools-1.11/ploidy.c Examining data/bcftools-1.11/ploidy.h Examining data/bcftools-1.11/plugins/GTisec.c Examining data/bcftools-1.11/plugins/GTsubset.c Examining data/bcftools-1.11/plugins/ad-bias.c Examining data/bcftools-1.11/plugins/add-variantkey.c Examining data/bcftools-1.11/plugins/af-dist.c Examining data/bcftools-1.11/plugins/allele-length.c Examining data/bcftools-1.11/plugins/check-ploidy.c Examining data/bcftools-1.11/plugins/check-sparsity.c Examining data/bcftools-1.11/plugins/color-chrs.c Examining data/bcftools-1.11/plugins/contrast.c Examining data/bcftools-1.11/plugins/counts.c Examining data/bcftools-1.11/plugins/dosage.c Examining data/bcftools-1.11/plugins/fill-AN-AC.c Examining data/bcftools-1.11/plugins/fill-from-fasta.c Examining data/bcftools-1.11/plugins/fill-tags.c Examining data/bcftools-1.11/plugins/fixploidy.c Examining data/bcftools-1.11/plugins/fixref.c Examining data/bcftools-1.11/plugins/frameshifts.c Examining data/bcftools-1.11/plugins/guess-ploidy.c Examining data/bcftools-1.11/plugins/gvcfz.c Examining data/bcftools-1.11/plugins/impute-info.c Examining data/bcftools-1.11/plugins/indel-stats.c Examining data/bcftools-1.11/plugins/isecGT.c Examining data/bcftools-1.11/plugins/mendelian.c Examining data/bcftools-1.11/plugins/missing2ref.c Examining data/bcftools-1.11/plugins/parental-origin.c Examining data/bcftools-1.11/plugins/prune.c Examining data/bcftools-1.11/plugins/remove-overlaps.c Examining data/bcftools-1.11/plugins/scatter.c Examining data/bcftools-1.11/plugins/setGT.c Examining data/bcftools-1.11/plugins/smpl-stats.c Examining data/bcftools-1.11/plugins/split-vep.c Examining data/bcftools-1.11/plugins/split.c Examining data/bcftools-1.11/plugins/tag2tag.c Examining data/bcftools-1.11/plugins/trio-dnm.c Examining data/bcftools-1.11/plugins/trio-stats.c Examining data/bcftools-1.11/plugins/trio-switch-rate.c Examining data/bcftools-1.11/plugins/variantkey-hex.c Examining data/bcftools-1.11/polysomy.c Examining data/bcftools-1.11/prob1.c Examining data/bcftools-1.11/prob1.h Examining data/bcftools-1.11/rbuf.h Examining data/bcftools-1.11/regidx.c Examining data/bcftools-1.11/regidx.h Examining data/bcftools-1.11/reheader.c Examining data/bcftools-1.11/smpl_ilist.c Examining data/bcftools-1.11/smpl_ilist.h Examining data/bcftools-1.11/tabix.c Examining data/bcftools-1.11/test/test-rbuf.c Examining data/bcftools-1.11/test/test-regidx.c Examining data/bcftools-1.11/tsv2vcf.c Examining data/bcftools-1.11/tsv2vcf.h Examining data/bcftools-1.11/variantkey.h Examining data/bcftools-1.11/vcfannotate.c Examining data/bcftools-1.11/vcfbuf.c Examining data/bcftools-1.11/vcfbuf.h Examining data/bcftools-1.11/vcfcall.c Examining data/bcftools-1.11/vcfcnv.c Examining data/bcftools-1.11/vcfconcat.c Examining data/bcftools-1.11/vcfconvert.c Examining data/bcftools-1.11/vcffilter.c Examining data/bcftools-1.11/vcfgtcheck.c Examining data/bcftools-1.11/vcfindex.c Examining data/bcftools-1.11/vcfisec.c Examining data/bcftools-1.11/vcfmerge.c Examining data/bcftools-1.11/vcfnorm.c Examining data/bcftools-1.11/vcfplugin.c Examining data/bcftools-1.11/vcfquery.c Examining data/bcftools-1.11/vcfroh.c Examining data/bcftools-1.11/vcfsom.c Examining data/bcftools-1.11/vcfsort.c Examining data/bcftools-1.11/vcfstats.c Examining data/bcftools-1.11/vcfview.c Examining data/bcftools-1.11/vcmp.c Examining data/bcftools-1.11/vcmp.h Examining data/bcftools-1.11/version.c FINAL RESULTS: data/bcftools-1.11/polysomy.c:352:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(fname, S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH); data/bcftools-1.11/vcfsort.c:298:19: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. int ret = chmod(tmp, S_IRUSR|S_IWUSR|S_IXUSR); data/bcftools-1.11/extsort.c:168:13: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). mktemp(blk->fname); data/bcftools-1.11/hex.h:58:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. return sprintf(str, "%016" PRIx64, n); data/bcftools-1.11/plugins/add-variantkey.c:79:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(rsid, "%08" PRIx32, (uint32_t)strtoul(ptr, NULL, 10)); data/bcftools-1.11/plugins/variantkey-hex.c:76:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dir, argv[1]); data/bcftools-1.11/plugins/variantkey-hex.c:78: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(path, dir); data/bcftools-1.11/plugins/variantkey-hex.c:79:5: [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(path, FILE_VKRS); data/bcftools-1.11/plugins/variantkey-hex.c:85: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(path, dir); data/bcftools-1.11/plugins/variantkey-hex.c:86:5: [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(path, FILE_RSVK); data/bcftools-1.11/plugins/variantkey-hex.c:92: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(path, dir); data/bcftools-1.11/plugins/variantkey-hex.c:93:5: [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(path, FILE_NRVK); data/bcftools-1.11/tabix.c:98:13: [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(strcpy(fn, argv[optind]), min_shift <= 0? ".tbi" : ".csi"); data/bcftools-1.11/tabix.c:98:20: [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). strcat(strcpy(fn, argv[optind]), min_shift <= 0? ".tbi" : ".csi"); data/bcftools-1.11/test/test-regidx.c:46:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/bcftools-1.11/test/test-regidx.c:54:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/bcftools-1.11/test/test-regidx.c:61:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/bcftools-1.11/test/test-regidx.c:280:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s\t%d\t%d\n",chr,start-1,end); data/bcftools-1.11/test/test-regidx.c:284:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s\t%d\t%d\n",chr,start,end); data/bcftools-1.11/test/test-regidx.c:288:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s:%d-%d\n",chr,start,end); data/bcftools-1.11/variantkey.h:152:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. return sprintf(chrom, "%" PRIu8, code); data/bcftools-1.11/variantkey.h:155:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. return sprintf(chrom, "%s", map[(code - 23)]); data/bcftools-1.11/vcfannotate.c:462: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(str, rec->d.id); data/bcftools-1.11/vcfcnv.c:325:15: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int ret = system(cmd); data/bcftools-1.11/vcfisec.c:74:13: [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. int n = vsnprintf(NULL, 0, fmt, ap) + 2; data/bcftools-1.11/vcfisec.c:79:5: [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. vsnprintf(path, n, fmt, ap); data/bcftools-1.11/vcfisec.c:110:13: [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. int n = vsnprintf(NULL, 0, fmt, ap) + 2; data/bcftools-1.11/vcfisec.c:115:5: [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. vsnprintf(str, n, fmt, ap); data/bcftools-1.11/vcfmerge.c:559:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp,"%s:%s",clash_prefix,name); data/bcftools-1.11/vcfmerge.c:2660:63: [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. for (j=maux->buf[i].beg; j<maux->buf[i].end; j++) fprintf(stderr," %s:%"PRId64,chr,(int64_t) maux->buf[i].lines[j]->pos+1); data/bcftools-1.11/vcfmerge.c:2668:37: [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. if ( maux->gvcf[i].active ) fprintf(stderr,"\tpos,end=%"PRId64",%"PRId64, (int64_t) maux->gvcf[i].line->pos+1,(int64_t) maux->gvcf[i].end+1); data/bcftools-1.11/vcfnorm.c:491:21: [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, \ data/bcftools-1.11/vcfnorm.c:513:21: [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, \ data/bcftools-1.11/vcfnorm.c:546:21: [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, \ data/bcftools-1.11/vcfnorm.c:707:21: [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, \ data/bcftools-1.11/vcfnorm.c:737:21: [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, \ data/bcftools-1.11/vcfnorm.c:783:21: [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, \ data/bcftools-1.11/vcfsom.c:93:13: [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. int n = vsnprintf(NULL, 0, fmt, ap) + 2; data/bcftools-1.11/vcfsom.c:98:5: [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. vsnprintf(str, n, fmt, ap); data/bcftools-1.11/vcfsort.c:88:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/bcftools-1.11/vcfsort.c:293:25: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). int ret = mkdir(mktemp(args->tmp_dir), 0700); data/bcftools-1.11/vcfstats.c:1382:17: [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(fmt,usr->tag,id,val,usr->vals_ts[j]+usr->vals_tv[j],usr->vals_ts[j],usr->vals_tv[j]); data/bcftools-1.11/vcfstats.c:1477:22: [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. else printf("\t"NA_STRING); data/bcftools-1.11/vcfstats.c:1593:25: [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("\t%"PRId64, stats[i].gt2gt[j][k]); data/bcftools-1.11/version.c:43:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/bcftools-1.11/version.c:53:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/bcftools-1.11/consensus.c:933:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?s:1Ii:e:H:f:o:m:c:M:p:a:",loptions,NULL)) >= 0) data/bcftools-1.11/csq.c:4135:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?hr:R:t:T:i:e:f:o:O:g:s:S:p:qc:ln:bv:",loptions,NULL)) >= 0) data/bcftools-1.11/filter.c:333:19: [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. kputs(getenv("HOMEDRIVE"), &str); data/bcftools-1.11/filter.c:334:19: [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. kputs(getenv("HOMEPATH"), &str); data/bcftools-1.11/filter.c:337:19: [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. kputs(getenv("HOME"), &str); data/bcftools-1.11/filter.c:360:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *var = getenv(path+1); data/bcftools-1.11/mpileup.c:995:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "Ag:f:r:R:q:Q:C:Bd:L:b:P:po:e:h:Im:F:EG:6O:xa:s:S:t:T:",lopts,NULL)) >= 0) { data/bcftools-1.11/peakfit.c:489:5: [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(0); // for reproducibility data/bcftools-1.11/plugins/GTisec.c:131:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?mvHh",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/GTsubset.c:98:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?s:h",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/ad-bias.c:151:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?hs:t:f:d:a:v:c",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/af-dist.c:95:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?ht:d:p:l:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/check-sparsity.c:242:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "vr:R:n:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/color-chrs.c:164:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?ht:u:p:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/contrast.c:459:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "O:o:i:e:r:R:t:T:0:1:a:f:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/dosage.c:236:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "t:?h",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/fill-from-fasta.c:107:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "c:f:?h:i:e:N",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/fill-tags.c:450:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?ht:dS:l",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/fixploidy.c:130:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?ht:s:p:d:f:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/fixref.c:191:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?hf:m:di:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/frameshifts.c:69:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "e:?h",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/guess-ploidy.c:423:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "vr:R:t:e:ig:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/gvcfz.c:328:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "vr:R:t:T:o:O:g:i:e:a",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/indel-stats.c:702:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "o:s:i:e:r:R:t:T:c:p:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/isecGT.c:89:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "o:O:r:R:t:T:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/mendelian.c:363:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?ht:T:p:l:m:cdr:R:o:O:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/missing2ref.c:73:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "mp?h",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/parental-origin.c:351:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?e:i:p:r:t:dgb:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/prune.c:289:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "vr:R:t:T:m:o:O:a:f:i:e:n:w:k",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/remove-overlaps.c:171:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "r:R:t:T:o:O:i:e:vpd",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/scatter.c:326:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "e:i:o:O:r:R:t:T:n:s:S:x:p:h?", loptions, NULL)) >= 0) data/bcftools-1.11/plugins/setGT.c:192:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?hn:t:i:e:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/smpl-stats.c:447:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "o:s:i:e:r:R:t:T:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/split-vep.c:995:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "o:O:i:e:r:R:t:T:lS:s:c:p:a:f:dA:x",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/split.c:599:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "vr:R:t:T:o:O:i:e:k:S:G:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/tag2tag.c:96:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?hrt:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/trio-dnm.c:395:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "p:P:o:O:s:i:e:r:R:t:T:m:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/trio-stats.c:729:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "P:p:o:s:i:e:r:R:t:T:a:d:",loptions,NULL)) >= 0) data/bcftools-1.11/plugins/trio-switch-rate.c:160:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?hp:",loptions,NULL)) >= 0) data/bcftools-1.11/polysomy.c:680:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?o:vt:T:r:R:s:f:p:c:im:b:n:S:",loptions,NULL)) >= 0) data/bcftools-1.11/reheader.c:691:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "s:h:o:f:",loptions,NULL)) >= 0) data/bcftools-1.11/tabix.c:38:17: [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 ((c = getopt(argc, argv, "0fap:s:b:e:S:c:m:")) >= 0) data/bcftools-1.11/test/test-regidx.c:175:18: [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. uint64_t b = random(), e = random(); data/bcftools-1.11/test/test-regidx.c:175:32: [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. uint64_t b = random(), e = random(); data/bcftools-1.11/test/test-regidx.c:408:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hvs:",loptions,NULL)) >= 0) data/bcftools-1.11/test/test-regidx.c:437:5: [3] (random) srandom: 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. srandom(seed); data/bcftools-1.11/vcfannotate.c:2821:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h:?o:O:r:R:a:x:c:i:e:S:s:I:m:kl:f",loptions,NULL)) >= 0) data/bcftools-1.11/vcfcall.c:964:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?o:O:r:R:s:S:t:T:ANMV:vcmp:C:n:P:f:ig:XYF:G:", loptions, NULL)) >= 0) data/bcftools-1.11/vcfcnv.c:1293:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?r:R:t:T:s:o:p:l:T:c:b:P:x:e:O:W:f:a:L:d:k:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfconcat.c:900:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h:?o:O:f:alq:Dd:r:R:cnv:",loptions,NULL)) >= 0) data/bcftools-1.11/vcfconvert.c:1489:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "?h:r:R:s:S:t:T:i:e:g:G:o:O:c:f:H:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcffilter.c:461:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "e:i:t:T:r:R:h?s:m:o:O:g:G:S:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfgtcheck.c:1039:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hg:p:s:S:p:P:Hr:R:at:T:G:c:u:e:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfindex.c:145:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "ctfm:sno:", loptions, NULL)) >= 0) data/bcftools-1.11/vcfisec.c:531:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hc:r:R:p:n:w:t:T:Cf:o:O:i:e:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfmerge.c:3148:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hm:f:r:R:o:O:i:l:g:F:0L:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfnorm.c:2076:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hr:R:f:w:Dd:o:O:c:m:t:T:sN",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfplugin.c:204:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *path = getenv("BCFTOOLS_PLUGINS"); data/bcftools-1.11/vcfplugin.c:276:11: [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. if ( !getenv("BCFTOOLS_PLUGINS") ) data/bcftools-1.11/vcfplugin.c:291:17: [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. getenv("BCFTOOLS_PLUGINS") data/bcftools-1.11/vcfplugin.c:590:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "-v",loptions,NULL)) >= 0) data/bcftools-1.11/vcfplugin.c:651:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?o:O:r:R:t:T:li:e:vV",loptions,NULL)) >= 0) data/bcftools-1.11/vcfquery.c:274:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hlr:R:f:a:s:S:Ht:T:c:v:i:e:o:u",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfroh.c:1152:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "h?r:R:t:T:H:a:s:S:m:M:G:Ia:e:V:b:O:o:i",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfsom.c:362:21: [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. som->w[i] = random(); data/bcftools-1.11/vcfsom.c:513:5: [3] (random) srandom: 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. srandom(args->rand_seed); data/bcftools-1.11/vcfsom.c:677:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "htcp:n:r:b:l:s:f:d:m:e",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfsort.c:333:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "m:T:O:o:h?",loptions,NULL)) >= 0) data/bcftools-1.11/vcfstats.c:1766:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "hc:r:R:e:s:S:d:i:t:T:F:f:1u:vIE:",loptions,NULL)) >= 0) { data/bcftools-1.11/vcfview.c:595:17: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "l:t:T:r:R:o:O:s:S:Gf:knv:V:m:M:auUhHc:C:Ii:e:xXpPq:Q:g:",loptions,NULL)) >= 0) data/bcftools-1.11/HMM.c:90: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(dst,out,sizeof(double)*n*n); data/bcftools-1.11/HMM.c:114: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(hmm->init.vit_prob,probs,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:122: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(hmm->init.fwd_prob,hmm->init.vit_prob,sizeof(double)*hmm->nstates); // these remain unchanged data/bcftools-1.11/HMM.c: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(hmm->init.bwd_prob,hmm->init.vit_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:124: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(hmm->state.vit_prob,hmm->init.vit_prob,sizeof(double)*hmm->nstates); // can be changed by snapshotting data/bcftools-1.11/HMM.c:125: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(hmm->state.fwd_prob,hmm->init.fwd_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:126: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(hmm->state.bwd_prob,hmm->init.bwd_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:170: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(hmm->state.vit_prob,hmm->init.vit_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:171: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(hmm->state.fwd_prob,hmm->init.fwd_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:176: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(hmm->state.vit_prob,snapshot->vit_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:177: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(hmm->state.fwd_prob,snapshot->fwd_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:185: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(hmm->state.vit_prob,hmm->init.vit_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:186: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(hmm->state.fwd_prob,hmm->init.fwd_prob,sizeof(double)*hmm->nstates); data/bcftools-1.11/HMM.c:197: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(hmm->tprob_arr,tprob,sizeof(double)*hmm->nstates*hmm->nstates); data/bcftools-1.11/HMM.c:217: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(hmm->curr_tprob, hmm->tprob_arr+n*hmm->nstates*hmm->nstates, sizeof(*hmm->curr_tprob)*hmm->nstates*hmm->nstates); data/bcftools-1.11/HMM.c:243: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(hmm->vprob, hmm->state.vit_prob, sizeof(*hmm->state.vit_prob)*nstates); data/bcftools-1.11/HMM.c:275: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(hmm->snapshot->vit_prob, hmm->vprob, sizeof(*hmm->vprob)*nstates); data/bcftools-1.11/HMM.c:308: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(hmm->fwd, hmm->state.fwd_prob, sizeof(*hmm->state.fwd_prob)*nstates); data/bcftools-1.11/HMM.c:309: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(hmm->bwd, hmm->state.bwd_prob, sizeof(*hmm->state.bwd_prob)*nstates); data/bcftools-1.11/HMM.c:337: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(hmm->snapshot->fwd_prob, fwd, sizeof(*fwd)*nstates); data/bcftools-1.11/HMM.c:391: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(hmm->fwd, hmm->state.fwd_prob, sizeof(*hmm->state.fwd_prob)*nstates); data/bcftools-1.11/HMM.c:392: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(hmm->bwd, hmm->state.bwd_prob, sizeof(*hmm->state.bwd_prob)*nstates); data/bcftools-1.11/bam2bcf_indel.c:446: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(&bca->inscns[t * bca->maxins], &inscns[(sumq[t]&0x3f) * max_ins], bca->maxins); data/bcftools-1.11/bcftools.h:58:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char iupac[4][4] = { {'A','M','R','W'},{'M','C','S','Y'},{'R','S','G','K'},{'W','Y','K','T'} }; data/bcftools-1.11/bcftools.h:76:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char iupac_mask[90] = { data/bcftools-1.11/ccall.c:186: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 tmp[4]; data/bcftools-1.11/cols.c:71: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(ptr, cols->off[i], len); data/bcftools-1.11/cols.c:75: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(ptr, str, str_len); data/bcftools-1.11/consensus.c:238:26: [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). args->fp_chain = fopen(args->chain_fname,"w"); data/bcftools-1.11/consensus.c:245:24: [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). args->fp_out = fopen(args->output_fname,"w"); data/bcftools-1.11/consensus.c:570: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 alleles[4]; data/bcftools-1.11/convert.c:590:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char iupac[4][4] = { {'A','M','R','W'},{'M','C','S','Y'},{'R','S','G','K'},{'W','Y','K','T'} }; data/bcftools-1.11/convert.c:1315:15: [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 idx = atoi((*p)+1); data/bcftools-1.11/csq.c:947: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(gene->name,ss,se-ss); data/bcftools-1.11/csq.c:1387:42: [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). args->out = args->output_fname ? fopen(args->output_fname,"w") : stdout; data/bcftools-1.11/csq.c:2283: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(child->var,rec->d.allele[0],rlen); data/bcftools-1.11/csq.c:2285: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(child->var+rlen+1,rec->d.allele[ial],alen); data/bcftools-1.11/csq.c:2332: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 tmp[3], *codon, *end; data/bcftools-1.11/csq.c:2526: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(tr->sref, tr->ref + tr->cds[0]->beg - tr->beg, N_REF_PAD); data/bcftools-1.11/csq.c:2531: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(tr->sref + len, tr->ref + N_REF_PAD + tr->cds[i]->beg - tr->beg, tr->cds[i]->len); data/bcftools-1.11/csq.c:2534: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(tr->sref + len, tr->ref + N_REF_PAD + tr->cds[tr->ncds-1]->beg - tr->beg, N_REF_PAD); data/bcftools-1.11/csq.c:3293: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(ref+i, tr->ref, len); data/bcftools-1.11/csq.c:4150: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). args->verbosity = atoi(optarg); data/bcftools-1.11/csq.c:4167:38: [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). args->ncsq_max = 2 * atoi(optarg); data/bcftools-1.11/em.c:213:33: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. for (i = 0; i < 3; ++i) memcpy(g[i], x + 1, 3 * sizeof(double)); data/bcftools-1.11/extsort.c:80: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(es->tmp_prefix,tmp_prefix,len); data/bcftools-1.11/extsort.c:81: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(es->tmp_prefix+len,"XXXXXX",6); data/bcftools-1.11/extsort.c:86: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 tmp_path[MAX_PATH]; data/bcftools-1.11/extsort.c:92:13: [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_path, "/bcftools-sort.XXXXXX"); data/bcftools-1.11/extsort.c: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(blk->fname,es->tmp_prefix,strlen(es->tmp_prefix)); data/bcftools-1.11/extsort.c:180:25: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ( (blk->fd = mkstemp(blk->fname))==-1 ) data/bcftools-1.11/filter.c:404: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(tok->str_value.s, line->d.info[i].vptr, n); data/bcftools-1.11/filter.c:688: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(dst, beg, end - beg); data/bcftools-1.11/filter.c:1106: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(rtok->pass_samples, tok->pass_samples, rtok->nsamples*sizeof(*rtok->pass_samples)); data/bcftools-1.11/filter.c:1112: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(rtok->usmpl, tok->usmpl, tok->nsamples*sizeof(*rtok->usmpl)); data/bcftools-1.11/filter.c:1255: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1322: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1385: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1460: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1538: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1610: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1641: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1789: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(rtok->usmpl, tok->usmpl, tok->nsamples); data/bcftools-1.11/filter.c:1898: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(rtok->pass_samples, tok->pass_samples, rtok->nsamples*sizeof(*rtok->pass_samples)); data/bcftools-1.11/filter.c:1903: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(rtok->usmpl, tok->usmpl, tok->nsamples*sizeof(*rtok->usmpl)); data/bcftools-1.11/filter.c:2629: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(tok->key,str+1,len-2); data/bcftools-1.11/filter.c:2641: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(tok->tag,str,len); data/bcftools-1.11/filter.c:3038: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(rmme, beg, end - beg); data/bcftools-1.11/gvcf.c:174: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(gvcf->dp,gvcf->tmp,nsmpl*sizeof(int32_t)); // tmp still contains DP from rec data/bcftools-1.11/kmin.c:80: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(x1, x, n * sizeof(double)); /* x1 = x */ data/bcftools-1.11/mcall.c:1297: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((char *)tmp_new+size*k, (char *)tmp_ori+size*j, size); data/bcftools-1.11/mcall.c:1327: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(ptr_dst+size*l, ptr_src+size*k, size); data/bcftools-1.11/mcall.c:1480: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(dst,src,size1); data/bcftools-1.11/mpileup.c: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 *ref[2]; data/bcftools-1.11/mpileup.c:729: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[MAX_PATH_LEN]; data/bcftools-1.11/mpileup.c:737: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 *fh = fopen(file_list,"r"); data/bcftools-1.11/mpileup.c:1007:32: [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). case 4 : mplp.openQ = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1021:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'd': mplp.max_depth = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1061:37: [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). case 'C': mplp.capQ_thres = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1062:33: [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). case 'q': mplp.min_mq = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1063:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'Q': mplp.min_baseQ = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1073: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). case 'e': mplp.extQ = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1074:34: [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). case 'h': mplp.tandemQ = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1077:38: [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). case 'm': mplp.min_support = atoi(optarg); break; data/bcftools-1.11/mpileup.c:1078: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). case 'L': mplp.max_indel_depth = atoi(optarg); break; data/bcftools-1.11/plugins/add-variantkey.c:73: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 vs[17]; data/bcftools-1.11/plugins/add-variantkey.c:76: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 rsid[9]; data/bcftools-1.11/plugins/color-chrs.c:467:20: [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). args->fp = fopen(str.s,"w"); data/bcftools-1.11/plugins/fill-from-fasta.c:205:19: [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 val = atoi(&fa[0]); data/bcftools-1.11/plugins/fill-tags.c:193: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(args->pop[args->npop-1].suffix+1,pop_name,strlen(pop_name)+1); data/bcftools-1.11/plugins/fill-tags.c:341: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(ftf->dst_tag, tag, expr-tag-1); data/bcftools-1.11/plugins/fill-tags.c:351: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(ftf->src_tag, expr, tmp-expr); data/bcftools-1.11/plugins/indel-stats.c:332:82: [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 *fh = !args->output_fname || !strcmp("-",args->output_fname) ? stdout : fopen(args->output_fname,"w"); data/bcftools-1.11/plugins/mendelian.c:435:50: [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). log_fh = strcmp("-",args.output_fname) ? fopen(args.output_fname,"w") : stdout; data/bcftools-1.11/plugins/prune.c: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 *ld_annot[VCFBUF_LD_N], *ld_annot_pos[VCFBUF_LD_N]; data/bcftools-1.11/plugins/setGT.c:151: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(args->binom_tag,beg,end-beg); data/bcftools-1.11/plugins/smpl-stats.c:217:82: [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 *fh = !args->output_fname || !strcmp("-",args->output_fname) ? stdout : fopen(args->output_fname,"w"); data/bcftools-1.11/plugins/split-vep.c:444: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(args->column_str+olen,",",1); data/bcftools-1.11/plugins/split-vep.c:447: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(args->column_str+olen,ptr+1,nlen); data/bcftools-1.11/plugins/split-vep.c:544:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if ( len ) memcpy(ann->tag,args->annot_prefix,len); data/bcftools-1.11/plugins/split-vep.c:545: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(ann->tag+len,ann->field,clen); data/bcftools-1.11/plugins/split.c:500: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(out->shared.s,rec->shared.s,out->shared.l); data/bcftools-1.11/plugins/trio-stats.c:341:86: [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). args->fp_out = !args->output_fname || !strcmp("-",args->output_fname) ? stdout : fopen(args->output_fname,"w"); data/bcftools-1.11/plugins/trio-stats.c:747:45: [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). case 'a': args->max_alt_trios = atoi(optarg); break; data/bcftools-1.11/plugins/variantkey-hex.c:72: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 path[1024]; data/bcftools-1.11/plugins/variantkey-hex.c:73: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 dir[1024] = "./"; data/bcftools-1.11/plugins/variantkey-hex.c:80:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp_vkrs = fopen(path, "w"); data/bcftools-1.11/plugins/variantkey-hex.c:87:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp_rsvk = fopen(path, "w"); data/bcftools-1.11/plugins/variantkey-hex.c:94:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp_nrvk = fopen(path, "w"); data/bcftools-1.11/polysomy.c:685:40: [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). case 2 : args->force_cn = atoi(optarg); break; data/bcftools-1.11/polysomy.c:686:37: [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). case 'n': args->nbins = atoi(optarg); break; data/bcftools-1.11/polysomy.c:687:38: [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). case 'S': args->smooth = atoi(optarg); break; data/bcftools-1.11/prob1.c:96: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(ma->ploidy, ploidy, n_smpl); data/bcftools-1.11/prob1.c:257: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(ma->z1, z[1], sizeof(double) * (ma->n1 * 2 + 1)); data/bcftools-1.11/prob1.c:306:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (z[0] != ma->z) memcpy(ma->z, z[0], sizeof(double) * (ma->M + 1)); data/bcftools-1.11/prob1.c:321: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(ma->z2, ma->z, sizeof(double) * (2 * (ma->n - ma->n1) + 1)); data/bcftools-1.11/rbuf.h:219: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(ptr+(rbuf)->m,ptr,sizeof(type_t)*(rbuf)->f); \ data/bcftools-1.11/regidx.c:174: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((char *)list->dat + idx->payload_size*(list->nreg-1), payload, idx->payload_size); data/bcftools-1.11/regidx.c:319: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((char *)tmp_dat+i*regidx->payload_size, data/bcftools-1.11/reheader.c:151: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 tmp_path[MAX_PATH]; data/bcftools-1.11/reheader.c:157:5: [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_path, "/bcftools-fai-header-XXXXXX"); data/bcftools-1.11/reheader.c:162:14: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(args->rm_tmpfile); data/bcftools-1.11/reheader.c:473:36: [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 out = args->output_fname ? open(args->output_fname, O_WRONLY|O_CREAT|O_TRUNC, 0666) : STDOUT_FILENO; data/bcftools-1.11/reheader.c:518:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). j = atoi(src_hrec->vals[j]); data/bcftools-1.11/tabix.c:42:40: [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). else if (c == 'm') min_shift = atoi(optarg); data/bcftools-1.11/tabix.c:43:38: [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). else if (c == 's') conf.sc = atoi(optarg); data/bcftools-1.11/tabix.c:44:38: [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). else if (c == 'b') conf.bc = atoi(optarg); data/bcftools-1.11/tabix.c:45:38: [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). else if (c == 'e') conf.ec = atoi(optarg); data/bcftools-1.11/tabix.c:47:45: [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). else if (c == 'S') conf.line_skip = atoi(optarg); data/bcftools-1.11/tabix.c:99: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). if ((fp = fopen(fn, "rb")) != 0) { data/bcftools-1.11/test/test-regidx.c:88: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(*dat,ss,se-ss+1); data/bcftools-1.11/test/test-regidx.c:298: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 line[250], *chr = "1"; data/bcftools-1.11/test/test-regidx.c:412:30: [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). case 's': seed = atoi(optarg); break; data/bcftools-1.11/variantkey.h:148:16: [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. return sprintf(chrom, "NA"); data/bcftools-1.11/variantkey.h:331:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char base[4] = {'A', 'C', 'G', 'T'}; data/bcftools-1.11/vcfannotate.c:1050: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(args->tmps,col->mm_kstr.s,col->mm_kstr.l+1); data/bcftools-1.11/vcfannotate.c:1066: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(args->tmps,tab->cols[col->icol],len+1); data/bcftools-1.11/vcfcall.c:122: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(lines[*nlines],name,len); data/bcftools-1.11/vcfcall.c:212: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 *col_ends[5], *tmp = str.s; data/bcftools-1.11/vcfcall.c:395: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(als->allele[als->n-1],ss,se-ss); data/bcftools-1.11/vcfgtcheck.c: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(args->kbs_diff->b,ds->kbs_dat,args->kbs_diff->n*sizeof(unsigned long)); data/bcftools-1.11/vcfgtcheck.c:202: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(dat->kbs_dat,args->kbs_diff->b,args->kbs_diff->n*sizeof(unsigned long)); data/bcftools-1.11/vcfgtcheck.c:212: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(args->kbs_diff->b,dat->kbs_dat,args->kbs_diff->n*sizeof(unsigned long)); data/bcftools-1.11/vcfisec.c:126: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 *fp = fopen(str,mode); data/bcftools-1.11/vcfisec.c:407: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). args->fh_sites = fopen(args->output_fname, "w"); data/bcftools-1.11/vcfmerge.c:681: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(b[i]+l,a[0]+rlb,rla-rlb+1); data/bcftools-1.11/vcfmerge.c:694: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(ai,a[i],l); data/bcftools-1.11/vcfmerge.c:695: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(ai+l,b[0]+rla,rlb-rla+1); data/bcftools-1.11/vcfmerge.c:1041: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(info->vptr - info->vptr_off, tmp_str->s, tmp_str->l); data/bcftools-1.11/vcfmerge.c:1100: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(dst->s+start_dst, src+start_src, nsrc_cpy); data/bcftools-1.11/vcfmerge.c:1314: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(out->d.info[out->n_info].vptr,inf->vptr-inf->vptr_off, inf->vptr_len+inf->vptr_off); data/bcftools-1.11/vcfmerge.c:1756: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(tgt, ma->str[i].s, ma->str[i].l); data/bcftools-1.11/vcfmerge.c:3023: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 buf[24]; snprintf(buf,sizeof buf,"%d",i+1); data/bcftools-1.11/vcfnorm.c:415: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(als[i].s,ref,npad); data/bcftools-1.11/vcfquery.c:339:32: [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). args->out = args->fn_out ? fopen(args->fn_out, "w") : stdout; data/bcftools-1.11/vcfsom.c:142: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). args->dclass = atoi(line); data/bcftools-1.11/vcfsom.c:185: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[5]; data/bcftools-1.11/vcfsom.c:506: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(args->train_dat+(ntrain-1)*args->mvals, args->vals, args->mvals*sizeof(double)); data/bcftools-1.11/vcfsom.c:549: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(args->vals, args->train_dat+i*args->mvals, args->mvals*sizeof(double)); data/bcftools-1.11/vcfsom.c:687:38: [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). case 'n': args->ntrain = atoi(optarg); break; data/bcftools-1.11/vcfsom.c:688:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'r': args->rand_seed = atoi(optarg); break; data/bcftools-1.11/vcfsom.c:691:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 's': args->nbin = atoi(optarg); break; data/bcftools-1.11/vcfsom.c:692:37: [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). case 'f': args->nfold = atoi(optarg); break; data/bcftools-1.11/vcfsom.c:694:30: [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). args->ndim = atoi(optarg); data/bcftools-1.11/vcfsort.c:278: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 tmp_path[MAX_PATH]; data/bcftools-1.11/vcfsort.c:284:5: [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_path, "/bcftools-sort.XXXXXX"); data/bcftools-1.11/vcfstats.c:360: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(usr->tag,str,tmp-str); data/bcftools-1.11/vcfstats.c:388: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(stats->usr,args->usr,args->nusr*sizeof(user_stats_t)); data/bcftools-1.11/vcfview.c:224: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 modew[8]; data/bcftools-1.11/vcfview.c:226:49: [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 (args->clevel >= 0 && args->clevel <= 9) sprintf(modew + 1, "%d", args->clevel); data/bcftools-1.11/vcfview.c:227:36: [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. if (args->output_type==FT_BCF) strcat(modew, "bu"); // uncompressed BCF data/bcftools-1.11/vcfview.c:597: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 allele_type[9] = "nref"; data/bcftools-1.11/cols.c:58: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). size_t str_len = strlen(str); data/bcftools-1.11/cols.c:59: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). size_t lst_len = strlen(cols->off[ cols->n - 1 ]); data/bcftools-1.11/cols.c:70: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). size_t len = strlen(cols->off[i]); data/bcftools-1.11/consensus.c:529:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = jalt==0 ? rec->rlen : strlen(rec->d.allele[jalt]); data/bcftools-1.11/consensus.c:619: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). alen = strlen(rec->d.allele[ialt]); data/bcftools-1.11/consensus.c:643: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). alen = strlen(rec->d.allele[ialt]); data/bcftools-1.11/consensus.c:683: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). alen = strlen(rec->d.allele[ialt]); data/bcftools-1.11/consensus.c:688: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). alen = strlen(rec->d.allele[ialt]); data/bcftools-1.11/convert.c:1119: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). strlen(convert->header->id[BCF_DT_CTG][line->rid].key), data/bcftools-1.11/convert.c:1122: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). strlen(line->d.allele[0]), data/bcftools-1.11/convert.c:1124: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). strlen(line->d.allele[1])); data/bcftools-1.11/csq.c:728:11: [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). ss += strlen(needle); data/bcftools-1.11/csq.c:1809:19: [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 ref_len = strlen(splice->vcf.ref); data/bcftools-1.11/csq.c:1810:19: [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 alt_len = strlen(splice->vcf.alt); data/bcftools-1.11/csq.c:2129: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). splice->vcf.alen = strlen(splice->vcf.alt); data/bcftools-1.11/csq.c:2279: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 rlen = strlen(rec->d.allele[0]); data/bcftools-1.11/csq.c:2280: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 alen = strlen(rec->d.allele[ial]); data/bcftools-1.11/csq.c:3309: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). assert( vcf - rec->d.allele[0] < strlen(rec->d.allele[0]) && ref - tr->ref < tr->end - tr->beg + 2*N_REF_PAD ); data/bcftools-1.11/csq.c:3379:37: [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 alen = sseq.l = strlen(sseq.s); data/bcftools-1.11/extsort.c:78:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(tmp_prefix); data/bcftools-1.11/extsort.c:90:17: [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(tmp_path) + strlen("/bcftools-sort.XXXXXX") >= MAX_PATH) data/bcftools-1.11/extsort.c:90:36: [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(tmp_path) + strlen("/bcftools-sort.XXXXXX") >= MAX_PATH) data/bcftools-1.11/extsort.c:167:46: [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). memcpy(blk->fname,es->tmp_prefix,strlen(es->tmp_prefix)); data/bcftools-1.11/extsort.c:223:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(blk->fd, blk->dat, es->dat_size); data/bcftools-1.11/filter.c:1016:19: [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 i, rlen = strlen(line->d.allele[0]); data/bcftools-1.11/filter.c:1019: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 alen = strlen(line->d.allele[i]); data/bcftools-1.11/filter.c:1718:43: [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 ( !*se ) rtok->values[i] = strlen(ss); data/bcftools-1.11/filter.c:1722: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). rtok->values[i] = strlen(ss); data/bcftools-1.11/filter.c:1735:31: [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). rtok->values[0] = strlen(tok->str_value.s); data/bcftools-1.11/filter.c:2481: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 i, len = strlen(tag_idx); data/bcftools-1.11/filter.c:2496:22: [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 (fname && strlen(fname) > 2 && fname[1] == ':') // Deal with Windows paths, such as 'C:\..' data/bcftools-1.11/filter.c:2910:25: [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 ( end - tmp.s != strlen(tmp.s) ) data/bcftools-1.11/filter.c:3192:57: [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). filters_init1(filter, rmme_list[i], strlen(rmme_list[i]), &out[nout-1]); data/bcftools-1.11/filter.c:3301: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 len = strlen(out[j].key); data/bcftools-1.11/mpileup.c:749:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(buf); data/bcftools-1.11/plugins/ad-bias.c:283:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ( args.variant_type==VCF_SNP && strlen(rec->d.allele[ibig])!=strlen(rec->d.allele[ismall]) ) continue; data/bcftools-1.11/plugins/ad-bias.c:283:77: [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 ( args.variant_type==VCF_SNP && strlen(rec->d.allele[ibig])!=strlen(rec->d.allele[ismall]) ) continue; data/bcftools-1.11/plugins/ad-bias.c:284: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). if ( args.variant_type==VCF_INDEL && strlen(rec->d.allele[ibig])==strlen(rec->d.allele[ismall]) ) continue; data/bcftools-1.11/plugins/ad-bias.c:284:79: [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 ( args.variant_type==VCF_INDEL && strlen(rec->d.allele[ibig])==strlen(rec->d.allele[ismall]) ) continue; data/bcftools-1.11/plugins/add-variantkey.c:67: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). strlen(in_hdr->id[BCF_DT_CTG][rec->rid].key), data/bcftools-1.11/plugins/add-variantkey.c:70: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). strlen(rec->d.allele[0]), data/bcftools-1.11/plugins/add-variantkey.c:72: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). strlen(rec->d.allele[1])); data/bcftools-1.11/plugins/allele-length.c:90:14: [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 rl = strlen(rec->d.allele[0]); data/bcftools-1.11/plugins/allele-length.c:91:14: [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 al = strlen(rec->d.allele[1]); data/bcftools-1.11/plugins/fill-from-fasta.c:186:19: [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 ref_len = strlen(ref); data/bcftools-1.11/plugins/fill-from-fasta.c:200:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(rec->d.allele[0], fa, fa_len); data/bcftools-1.11/plugins/fill-tags.c:192:64: [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). args->pop[args->npop-1].suffix = (char*)malloc(strlen(pop_name)+2); data/bcftools-1.11/plugins/fill-tags.c:193:66: [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). memcpy(args->pop[args->npop-1].suffix+1,pop_name,strlen(pop_name)+1); data/bcftools-1.11/plugins/gvcfz.c:154: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). beg = grp->expr + strlen(grp->expr); while ( beg >= grp->expr && isspace(*beg) ) { *beg = 0; beg--; } data/bcftools-1.11/plugins/mendelian.c:185: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). int detailed = 0, len = strlen(alias); data/bcftools-1.11/plugins/split-vep.c:393:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(args->field[args->nfield-1]); data/bcftools-1.11/plugins/split-vep.c:439:43: [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 olen = args->column_str ? strlen(args->column_str) : 0; data/bcftools-1.11/plugins/split-vep.c:440: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). int nlen = strlen(ptr) - 1; data/bcftools-1.11/plugins/split-vep.c:535:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = args->annot_prefix ? strlen(args->annot_prefix) : 0; data/bcftools-1.11/plugins/split-vep.c:542: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). int clen = strlen(args->field[j]); data/bcftools-1.11/plugins/split-vep.c:636:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(sel_csq); data/bcftools-1.11/plugins/variantkey-hex.c:105:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len_ref = strlen(rec->d.allele[0]); data/bcftools-1.11/plugins/variantkey-hex.c:106:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len_alt = strlen(rec->d.allele[1]); data/bcftools-1.11/plugins/variantkey-hex.c:109: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). strlen(in_hdr->id[BCF_DT_CTG][rec->rid].key), data/bcftools-1.11/regidx.c:228: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 len = strlen(fname); data/bcftools-1.11/reheader.c:155: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(tmp_path) + strlen("/bcftools-fai-header-XXXXXX") >= MAX_PATH) data/bcftools-1.11/reheader.c:155: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). if (strlen(tmp_path) + strlen("/bcftools-fai-header-XXXXXX") >= MAX_PATH) data/bcftools-1.11/tabix.c:87: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). int l = strlen(argv[optind]); data/bcftools-1.11/tabix.c:97: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). fn = (char*)malloc(strlen(argv[optind]) + 5); data/bcftools-1.11/vcfannotate.c:460:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(rec->d.id); data/bcftools-1.11/vcfannotate.c:1022:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(tab->cols[col->icol]); data/bcftools-1.11/vcfannotate.c:2474: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 len = strlen(args->targets_fname); data/bcftools-1.11/vcfcall.c:120:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(name); data/bcftools-1.11/vcfcall.c:817: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). int detailed = 0, len = strlen(alias); data/bcftools-1.11/vcfconvert.c:742: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(files[0]) && strcmp(files[0],".")!=0) gen_fname = strdup(files[0]); data/bcftools-1.11/vcfconvert.c:743: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(files[1]) && strcmp(files[1],".")!=0) sample_fname = strdup(files[1]); data/bcftools-1.11/vcfconvert.c:752: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). if ( gen_fname && (strlen(gen_fname)<3 || strcasecmp(".gz",gen_fname+strlen(gen_fname)-3)) ) gen_compressed = 0; data/bcftools-1.11/vcfconvert.c:752:74: [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 ( gen_fname && (strlen(gen_fname)<3 || strcasecmp(".gz",gen_fname+strlen(gen_fname)-3)) ) gen_compressed = 0; data/bcftools-1.11/vcfconvert.c:753: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). if ( sample_fname && strlen(sample_fname)>3 && strcasecmp(".gz",sample_fname+strlen(sample_fname)-3)==0 ) sample_compressed = 0; data/bcftools-1.11/vcfconvert.c:753:82: [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 ( sample_fname && strlen(sample_fname)>3 && strcasecmp(".gz",sample_fname+strlen(sample_fname)-3)==0 ) sample_compressed = 0; data/bcftools-1.11/vcfconvert.c:864: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(files[0]) && strcmp(files[0],".")!=0) hap_fname = strdup(files[0]); data/bcftools-1.11/vcfconvert.c:865: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(files[1]) && strcmp(files[1],".")!=0) legend_fname = strdup(files[1]); data/bcftools-1.11/vcfconvert.c:866: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(files[2]) && strcmp(files[2],".")!=0) sample_fname = strdup(files[2]); data/bcftools-1.11/vcfconvert.c:875: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). if ( hap_fname && (strlen(hap_fname)<3 || strcasecmp(".gz",hap_fname+strlen(hap_fname)-3)) ) hap_compressed = 0; data/bcftools-1.11/vcfconvert.c:875:74: [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 ( hap_fname && (strlen(hap_fname)<3 || strcasecmp(".gz",hap_fname+strlen(hap_fname)-3)) ) hap_compressed = 0; data/bcftools-1.11/vcfconvert.c:876: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 ( legend_fname && (strlen(legend_fname)<3 || strcasecmp(".gz",legend_fname+strlen(legend_fname)-3)) ) legend_compressed = 0; data/bcftools-1.11/vcfconvert.c:876:83: [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 ( legend_fname && (strlen(legend_fname)<3 || strcasecmp(".gz",legend_fname+strlen(legend_fname)-3)) ) legend_compressed = 0; data/bcftools-1.11/vcfconvert.c:877: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). if ( sample_fname && strlen(sample_fname)>3 && strcasecmp(".gz",sample_fname+strlen(sample_fname)-3)==0 ) sample_compressed = 0; data/bcftools-1.11/vcfconvert.c:877:82: [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 ( sample_fname && strlen(sample_fname)>3 && strcasecmp(".gz",sample_fname+strlen(sample_fname)-3)==0 ) sample_compressed = 0; data/bcftools-1.11/vcfconvert.c:1014: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(files[0]) && strcmp(files[0],".")!=0) hap_fname = strdup(files[0]); data/bcftools-1.11/vcfconvert.c:1015: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(files[1]) && strcmp(files[1],".")!=0) sample_fname = strdup(files[1]); data/bcftools-1.11/vcfconvert.c:1024: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). if ( hap_fname && (strlen(hap_fname)<3 || strcasecmp(".gz",hap_fname+strlen(hap_fname)-3)) ) hap_compressed = 0; data/bcftools-1.11/vcfconvert.c:1024:74: [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 ( hap_fname && (strlen(hap_fname)<3 || strcasecmp(".gz",hap_fname+strlen(hap_fname)-3)) ) hap_compressed = 0; data/bcftools-1.11/vcfconvert.c:1025: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). if ( sample_fname && strlen(sample_fname)>3 && strcasecmp(".gz",sample_fname+strlen(sample_fname)-3)==0 ) sample_compressed = 0; data/bcftools-1.11/vcfconvert.c:1025:82: [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 ( sample_fname && strlen(sample_fname)>3 && strcasecmp(".gz",sample_fname+strlen(sample_fname)-3)==0 ) sample_compressed = 0; data/bcftools-1.11/vcfconvert.c:1369:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(line->d.allele[0],ref,len); data/bcftools-1.11/vcfisec.c:307:14: [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(args->isec_exact)!=args->files->nreaders ) data/bcftools-1.11/vcfmerge.c:454:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp,(char*)args->maux->tmp_arr,ret); data/bcftools-1.11/vcfmerge.c:557: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 len = strlen(name) + strlen(clash_prefix) + 1; data/bcftools-1.11/vcfmerge.c:557: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). int len = strlen(name) + strlen(clash_prefix) + 1; data/bcftools-1.11/vcfmerge.c:591: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). for (j=0; j<nals; j++) lens[j] = strlen(als[j]); data/bcftools-1.11/vcfmerge.c:638: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). int rla = !a[0][1] ? 1 : strlen(a[0]); data/bcftools-1.11/vcfmerge.c:639: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). int rlb = !b[0][1] ? 1 : strlen(b[0]); data/bcftools-1.11/vcfmerge.c:659: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 len = strlen(a[i]); data/bcftools-1.11/vcfmerge.c:664: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 len = strlen(b[i]); data/bcftools-1.11/vcfmerge.c:679: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). int l = strlen(b[i]); data/bcftools-1.11/vcfmerge.c:692: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). int l = strlen(a[i]); data/bcftools-1.11/vcfmerge.c:2482:10: [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(line->d.allele[0])==line->rlen ) return 0; data/bcftools-1.11/vcfnorm.c:139: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 reflen = strlen(line->d.allele[0]); data/bcftools-1.11/vcfnorm.c:143:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(line->d.allele[i]); data/bcftools-1.11/vcfnorm.c:171:64: [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). has_non_acgtn += replace_iupac_codes(line->d.allele[i],strlen(line->d.allele[i])); data/bcftools-1.11/vcfnorm.c:190: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 len = strlen(line->d.allele[j]); data/bcftools-1.11/vcfnorm.c:207:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(line->d.allele[i]); data/bcftools-1.11/vcfnorm.c:322: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). int i, nref, reflen = strlen(line->d.allele[0]); data/bcftools-1.11/vcfnorm.c:463:22: [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 new_reflen = strlen(line->d.allele[0]); data/bcftools-1.11/vcfplugin.c:172:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dir, path, len); data/bcftools-1.11/vcfplugin.c:466: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). int plugin_ext_len = strlen(PLUGIN_EXT); data/bcftools-1.11/vcfplugin.c:476: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 len = strlen(ep->d_name); data/bcftools-1.11/vcfsort.c:282: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(tmp_path) + strlen("/bcftools-sort.XXXXXX") >= MAX_PATH) data/bcftools-1.11/vcfsort.c:282: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). if (strlen(tmp_path) + strlen("/bcftools-sort.XXXXXX") >= MAX_PATH) data/bcftools-1.11/vcfsort.c:289: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). size_t len = strlen(args->tmp_dir); data/bcftools-1.11/vcfstats.c:300:19: [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 ref_len = strlen(ref); data/bcftools-1.11/vcfview.c:179:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(type_list[n++], q, p - q); data/bcftools-1.11/vcfview.c:225:5: [1] (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 character. strcpy(modew, "w"); data/bcftools-1.11/vcfview.c:228:42: [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. else if (args->output_type & FT_BCF) strcat(modew, "b"); // compressed BCF data/bcftools-1.11/vcfview.c:229:41: [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. else if (args->output_type & FT_GZ) strcat(modew,"z"); // compressed VCF data/bcftools-1.11/vcfview.c:649:22: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if ( sscanf(optarg,"%d:%8s",&args->min_ac, allele_type)!=2 && sscanf(optarg,"%d",&args->min_ac)!=1 ) data/bcftools-1.11/vcfview.c:658:22: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if ( sscanf(optarg,"%d:%8s",&args->max_ac, allele_type)!=2 && sscanf(optarg,"%d",&args->max_ac)!=1 ) data/bcftools-1.11/vcfview.c:667:22: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if ( sscanf(optarg,"%f:%8s",&args->min_af, allele_type)!=2 && sscanf(optarg,"%f",&args->min_af)!=1 ) data/bcftools-1.11/vcfview.c:676:22: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if ( sscanf(optarg,"%f:%8s",&args->max_af, allele_type)!=2 && sscanf(optarg,"%f",&args->max_af)!=1 ) ANALYSIS SUMMARY: Hits = 413 Lines analyzed = 64689 in approximately 2.37 seconds (27254 lines/second) Physical Source Lines of Code (SLOC) = 53741 Hits@level = [0] 1795 [1] 125 [2] 172 [3] 70 [4] 44 [5] 2 Hits@level+ = [0+] 2208 [1+] 413 [2+] 288 [3+] 116 [4+] 46 [5+] 2 Hits/KSLOC@level+ = [0+] 41.0859 [1+] 7.68501 [2+] 5.35904 [3+] 2.1585 [4+] 0.855957 [5+] 0.0372155 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.