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/bwa-0.7.17/QSufSort.c
Examining data/bwa-0.7.17/QSufSort.h
Examining data/bwa-0.7.17/bamlite.c
Examining data/bwa-0.7.17/bamlite.h
Examining data/bwa-0.7.17/bntseq.h
Examining data/bwa-0.7.17/bwa.c
Examining data/bwa-0.7.17/bwa.h
Examining data/bwa-0.7.17/bwamem.c
Examining data/bwa-0.7.17/bwamem_extra.c
Examining data/bwa-0.7.17/bwamem_pair.c
Examining data/bwa-0.7.17/bwape.c
Examining data/bwa-0.7.17/bwase.c
Examining data/bwa-0.7.17/bwase.h
Examining data/bwa-0.7.17/bwaseqio.c
Examining data/bwa-0.7.17/bwashm.c
Examining data/bwa-0.7.17/bwt.c
Examining data/bwa-0.7.17/bwt.h
Examining data/bwa-0.7.17/bwt_gen.c
Examining data/bwa-0.7.17/bwt_lite.c
Examining data/bwa-0.7.17/bwt_lite.h
Examining data/bwa-0.7.17/bwtaln.c
Examining data/bwa-0.7.17/bwtaln.h
Examining data/bwa-0.7.17/bwtgap.c
Examining data/bwa-0.7.17/bwtgap.h
Examining data/bwa-0.7.17/bwtindex.c
Examining data/bwa-0.7.17/bwtsw2.h
Examining data/bwa-0.7.17/bwtsw2_aux.c
Examining data/bwa-0.7.17/bwtsw2_chain.c
Examining data/bwa-0.7.17/bwtsw2_core.c
Examining data/bwa-0.7.17/bwtsw2_main.c
Examining data/bwa-0.7.17/bwtsw2_pair.c
Examining data/bwa-0.7.17/example.c
Examining data/bwa-0.7.17/fastmap.c
Examining data/bwa-0.7.17/is.c
Examining data/bwa-0.7.17/kbtree.h
Examining data/bwa-0.7.17/khash.h
Examining data/bwa-0.7.17/kopen.c
Examining data/bwa-0.7.17/kseq.h
Examining data/bwa-0.7.17/ksort.h
Examining data/bwa-0.7.17/kstring.c
Examining data/bwa-0.7.17/kstring.h
Examining data/bwa-0.7.17/ksw.h
Examining data/bwa-0.7.17/kthread.c
Examining data/bwa-0.7.17/kvec.h
Examining data/bwa-0.7.17/main.c
Examining data/bwa-0.7.17/malloc_wrap.c
Examining data/bwa-0.7.17/malloc_wrap.h
Examining data/bwa-0.7.17/maxk.c
Examining data/bwa-0.7.17/pemerge.c
Examining data/bwa-0.7.17/rle.c
Examining data/bwa-0.7.17/rope.c
Examining data/bwa-0.7.17/rope.h
Examining data/bwa-0.7.17/utils.c
Examining data/bwa-0.7.17/utils.h
Examining data/bwa-0.7.17/debian/include/simde/check.h
Examining data/bwa-0.7.17/debian/include/simde/hedley.h
Examining data/bwa-0.7.17/debian/include/simde/simde-arch.h
Examining data/bwa-0.7.17/debian/include/simde/simde-common.h
Examining data/bwa-0.7.17/debian/include/simde/x86/mmx.h
Examining data/bwa-0.7.17/debian/include/simde/x86/sse.h
Examining data/bwa-0.7.17/debian/include/simde/x86/sse2.h
Examining data/bwa-0.7.17/bntseq.c
Examining data/bwa-0.7.17/ksw.c
Examining data/bwa-0.7.17/bwamem.h
Examining data/bwa-0.7.17/rle.h

FINAL RESULTS:

data/bwa-0.7.17/bntseq.c:72:3:  [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, prefix); strcat(str, ".ann");
data/bwa-0.7.17/bntseq.c:86:3:  [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, prefix); strcat(str, ".amb");
data/bwa-0.7.17/bntseq.c:119:14:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
			scanres = fscanf(fp, "%u%s", &p->gi, str);
data/bwa-0.7.17/bntseq.c:150:14:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
			scanres = fscanf(fp, "%lld%d%s", &xx, &p->len, str);
data/bwa-0.7.17/bntseq.c:174: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).
	strcat(strcpy(ann_filename, prefix), ".ann");
data/bwa-0.7.17/bntseq.c:175: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).
	strcat(strcpy(amb_filename, prefix), ".amb");
data/bwa-0.7.17/bntseq.c:176: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).
	strcat(strcpy(pac_filename, prefix), ".pac");
data/bwa-0.7.17/bntseq.c:179:25:  [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).
	if ((fp = fopen(strcat(strcpy(alt_filename, prefix), ".alt"), "r")) != 0) { // read .alt file if present
data/bwa-0.7.17/bntseq.c:303:2:  [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(name, prefix); strcat(name, ".pac");
data/bwa-0.7.17/bwa.c:225:2:  [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(prefix, hint);
data/bwa-0.7.17/bwa.c:254: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).
	strcat(strcpy(tmp, prefix), ".bwt"); // FM-index
data/bwa-0.7.17/bwa.c:256: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).
	strcat(strcpy(tmp, prefix), ".sa");  // partial suffix array (SA)
data/bwa-0.7.17/bwa.c:460:3:  [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(hdr + len, s);
data/bwa-0.7.17/bwape.c:274:3:  [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, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwape.c:275:3:  [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, prefix); strcat(str, ".sa"); bwt_restore_sa(str, bwt);
data/bwa-0.7.17/bwape.c:665:4:  [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, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwape.c:666:4:  [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, prefix); strcat(str, ".sa"); bwt_restore_sa(str, bwt);
data/bwa-0.7.17/bwape.c:704: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(p[0]->bc, p[1]->bc);
data/bwa-0.7.17/bwape.c:705: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(p[1]->bc, p[0]->bc);
data/bwa-0.7.17/bwase.c:150:2:  [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, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwase.c:151:2:  [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, prefix); strcat(str, ".sa"); bwt_restore_sa(str, bwt);
data/bwa-0.7.17/bwashm.c:55:2:  [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(path, "/bwaidx-"), name);
data/bwa-0.7.17/bwashm.c:111:2:  [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(path, "/bwaidx-"), name);
data/bwa-0.7.17/bwashm.c:170:3:  [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(path, "/bwaidx-"), p);
data/bwa-0.7.17/bwtaln.c:173:3:  [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, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwtindex.c:248:3:  [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(prefix, argv[optind]);
data/bwa-0.7.17/bwtindex.c:278:3:  [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, prefix); strcat(str, ".pac");
data/bwa-0.7.17/bwtindex.c:279:3:  [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(str2, prefix); strcat(str2, ".bwt");
data/bwa-0.7.17/bwtindex.c:293:3:  [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, prefix); strcat(str, ".bwt");
data/bwa-0.7.17/bwtindex.c:312:3:  [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, prefix); strcat(str, ".bwt");
data/bwa-0.7.17/bwtindex.c:313:3:  [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(str3, prefix); strcat(str3, ".sa");
data/bwa-0.7.17/debian/include/simde/check.h:45:38:  [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.
#  define simde_errorf(format, ...) (fprintf(stderr, format, __VA_ARGS__), abort())
data/bwa-0.7.17/debian/include/simde/hedley.h:876:79:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#  define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check))
data/bwa-0.7.17/kopen.c:195:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(retr, "RETR %s\r\n", p);
data/bwa-0.7.17/kopen.c:307:6:  [4] (shell) execvp:
  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.
					execvp(argv[0], argv);
data/bwa-0.7.17/kopen.c:309:12:  [4] (shell) execl:
  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.
				} else execl("/bin/sh", "sh", "-c", p + 1, NULL);
data/bwa-0.7.17/kstring.c:14:6:  [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.
	l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap);
data/bwa-0.7.17/kstring.c:21:7:  [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.
		l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap);
data/bwa-0.7.17/utils.c:95:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, args);
data/bwa-0.7.17/utils.c:106:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, args);
data/bwa-0.7.17/utils.c:181:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	done = vfprintf(stdout, format, arg);
data/bwa-0.7.17/utils.c:193:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	done = vfprintf(stream, format, arg);
data/bwa-0.7.17/utils.h:77:27:  [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.
        ATTRIBUTE((format(printf, 2, 3)));
data/bwa-0.7.17/utils.h:79:27:  [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.
        ATTRIBUTE((format(printf, 1, 2)));
data/bwa-0.7.17/bntseq.c:267:20:  [3] (random) lrand48:
  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.
			if (c >= 4) c = lrand48()&3;
data/bwa-0.7.17/bntseq.c:340:14:  [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, "f")) >= 0) {
data/bwa-0.7.17/bwamem_extra.c:85:39:  [3] (random) lrand48:
  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.
	mem_mark_primary_se(opt, ar.n, ar.a, lrand48());
data/bwa-0.7.17/bwape.c:740:14:  [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, "a:o:sPn:N:c:f:Ar:")) >= 0) {
data/bwa-0.7.17/bwase.c:36:8:  [3] (random) drand48:
  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.
			if (drand48() * (p->l - p->k + 1 + cnt) > (double)cnt) {
data/bwa-0.7.17/bwase.c:40:51:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
				s->sa = p->k + (bwtint_t)((p->l - p->k + 1) * drand48());
data/bwa-0.7.17/bwase.c:81:26:  [3] (random) drand48:
  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.
					double p = 1.0, x = drand48();
data/bwa-0.7.17/bwase.c:583:14:  [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, "hn:f:r:")) >= 0) {
data/bwa-0.7.17/bwashm.c:183:14:  [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, "ldf:")) >= 0) {
data/bwa-0.7.17/bwtaln.c:237:14:  [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, "n:o:e:i:d:l:k:LR:m:t:NM:O:E:q:f:b012IYB:")) >= 0) {
data/bwa-0.7.17/bwtindex.c:133:14:  [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, "d")) >= 0) {
data/bwa-0.7.17/bwtindex.c:193:14:  [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, "i:")) >= 0) {
data/bwa-0.7.17/bwtindex.c:214:14:  [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, "6a:p:b:")) >= 0) {
data/bwa-0.7.17/bwtsw2_aux.c:587:28:  [3] (random) drand48:
  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.
			if (c >= 4) { c = (int)(drand48() * 4); ++k; } // FIXME: ambiguous bases are not properly handled
data/bwa-0.7.17/bwtsw2_aux.c:629:26:  [3] (random) drand48:
  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.
			if (c >= 4) c = (int)(drand48() * 4);
data/bwa-0.7.17/bwtsw2_core.c:358:17:  [3] (random) drand48:
  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.
		j = (int)(i * drand48());
data/bwa-0.7.17/bwtsw2_main.c:19:14:  [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, "q:r:a:b:t:T:w:d:z:m:s:c:N:Hf:MI:SG:C")) >= 0) {
data/bwa-0.7.17/fastmap.c:133:14:  [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, "51qpaMCSPVYjk:c:v:s:r:t:R:A:B:O:E:U:w:L:d:T:Q:D:m:I:N:o:f:W:x:G:h:y:K:X:H:")) >= 0) {
data/bwa-0.7.17/fastmap.c:384:14:  [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, "w:l:pi:I:L:")) >= 0) {
data/bwa-0.7.17/kopen.c:93:10:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	proxy = getenv("http_proxy");
data/bwa-0.7.17/ksw.c:654:14:  [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, "a:b:q:r:ft:1")) >= 0) {
data/bwa-0.7.17/maxk.c:22:14:  [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, "s")) >= 0) {
data/bwa-0.7.17/pemerge.c:227:14:  [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, "muQ:t:T:")) >= 0) {
data/bwa-0.7.17/bamlite.c:81:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[4];
data/bwa-0.7.17/bntseq.c:47:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char nst_nt4_table[256] = {
data/bwa-0.7.17/bntseq.c:68:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char str[1024];
data/bwa-0.7.17/bntseq.c:72:24:  [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.
		strcpy(str, prefix); strcat(str, ".ann");
data/bwa-0.7.17/bntseq.c:86:24:  [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.
		strcpy(str, prefix); strcat(str, ".amb");
data/bwa-0.7.17/bntseq.c:100:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char str[8192];
data/bwa-0.7.17/bntseq.c:171:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char ann_filename[1024], amb_filename[1024], pac_filename[1024], alt_filename[1024];
data/bwa-0.7.17/bntseq.c:174:2:  [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(strcpy(ann_filename, prefix), ".ann");
data/bwa-0.7.17/bntseq.c:175:2:  [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(strcpy(amb_filename, prefix), ".amb");
data/bwa-0.7.17/bntseq.c:176:2:  [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(strcpy(pac_filename, prefix), ".pac");
data/bwa-0.7.17/bntseq.c:179:12:  [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(strcat(strcpy(alt_filename, prefix), ".alt"), "r")) != 0) { // read .alt file if present
data/bwa-0.7.17/bntseq.c:179:18:  [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 ((fp = fopen(strcat(strcpy(alt_filename, prefix), ".alt"), "r")) != 0) { // read .alt file if present
data/bwa-0.7.17/bntseq.c:180:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char str[1024];
data/bwa-0.7.17/bntseq.c:285:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char name[1024];
data/bwa-0.7.17/bntseq.c:303:24:  [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.
	strcpy(name, prefix); strcat(name, ".pac");
data/bwa-0.7.17/bntseq.h:66:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern unsigned char nst_nt4_table[256];
data/bwa-0.7.17/bwa.c:17:1:  [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 bwa_rg_id[256];
data/bwa-0.7.17/bwa.c:38:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(s, str->s, str->l);
data/bwa-0.7.17/bwa.c:226:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy(prefix + l_hint, ".64.bwt");
data/bwa-0.7.17/bwa.c:227:12:  [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(prefix, "rb")) != 0) {
data/bwa-0.7.17/bwa.c:232:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(prefix + l_hint, ".bwt");
data/bwa-0.7.17/bwa.c:233:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fp = fopen(prefix, "rb")) == 0) {
data/bwa-0.7.17/bwa.c:254:2:  [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(strcpy(tmp, prefix), ".bwt"); // FM-index
data/bwa-0.7.17/bwa.c:256:2:  [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(strcpy(tmp, prefix), ".sa");  // partial suffix array (SA)
data/bwa-0.7.17/bwa.c:316:43:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	x = sizeof(bwt_t); idx->bwt = malloc(x); memcpy(idx->bwt, mem + k, x); k += x;
data/bwa-0.7.17/bwa.c:321:46:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	x = sizeof(bntseq_t); idx->bns = malloc(x); memcpy(idx->bns, mem + k, x); k += x;
data/bwa-0.7.17/bwa.c:323:73:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	x = idx->bns->n_seqs  * sizeof(bntann1_t); idx->bns->anns = malloc(x); memcpy(idx->bns->anns, mem + k, x); k += x;
data/bwa-0.7.17/bwa.c:345:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(mem, idx->bwt, sizeof(bwt_t)); k = sizeof(bwt_t) + x;
data/bwa-0.7.17/bwa.c:346:68:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	x = idx->bwt->n_sa * sizeof(bwtint_t); mem = realloc(mem, k + x); memcpy(mem + k, idx->bwt->sa, x); k += x;
data/bwa-0.7.17/bwa.c:355: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.
	x = sizeof(bntseq_t); memcpy(mem + k, idx->bns, x); k += x;
data/bwa-0.7.17/bwa.c:356:45:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	x = idx->bns->n_holes * sizeof(bntamb1_t); memcpy(mem + k, idx->bns->ambs, x); k += x;
data/bwa-0.7.17/bwa.c:358:44:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	x = idx->bns->n_seqs * sizeof(bntann1_t); memcpy(mem + k, idx->bns->anns, x); k += x;
data/bwa-0.7.17/bwa.c:360:43:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		x = strlen(idx->bns->anns[i].name) + 1; memcpy(mem + k, idx->bns->anns[i].name, x); k += x;
data/bwa-0.7.17/bwa.c:361:43:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		x = strlen(idx->bns->anns[i].anno) + 1; memcpy(mem + k, idx->bns->anns[i].anno, x); k += x;
data/bwa-0.7.17/bwa.c:369:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(mem + k, idx->pac, x); k += x;
data/bwa-0.7.17/bwa.h:36:8:  [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.
extern char bwa_rg_id[256];
data/bwa-0.7.17/bwamem.c:1227: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.
		if (pes0) memcpy(pes, pes0, 4 * sizeof(mem_pestat_t)); // if pes0 != NULL, set the insert-size distribution as pes0
data/bwa-0.7.17/bwamem_extra.c:83:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(seq, seq_, l_seq); // makes a copy of seq_
data/bwa-0.7.17/bwamem_pair.c:287:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char **XA[2];
data/bwa-0.7.17/bwape.c:260:51:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int bwa_cal_pac_pos_pe(const bntseq_t *bns, const char *prefix, bwt_t *const _bwt, int n_seqs, bwa_seq_t *seqs[2], FILE *fp_sa[2], isize_info_t *ii,
data/bwa-0.7.17/bwape.c:264:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char str[1024];
data/bwa-0.7.17/bwape.c:274:24:  [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.
		strcpy(str, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwape.c:275:24:  [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.
		strcpy(str, prefix); strcat(str, ".sa"); bwt_restore_sa(str, bwt);
data/bwa-0.7.17/bwape.c:624:32:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
void bwa_sai2sam_pe_core(const char *prefix, char *const fn_sa[2], char *const fn_fa[2], pe_opt_t *popt, const char *rg_line)
data/bwa-0.7.17/bwape.c:624:46:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
void bwa_sai2sam_pe_core(const char *prefix, char *const fn_sa[2], char *const fn_fa[2], pe_opt_t *popt, const char *rg_line)
data/bwa-0.7.17/bwape.c:624:68:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
void bwa_sai2sam_pe_core(const char *prefix, char *const fn_sa[2], char *const fn_fa[2], pe_opt_t *popt, const char *rg_line)
data/bwa-0.7.17/bwape.c:637:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char str[1024], magic[2][4];
data/bwa-0.7.17/bwape.c:665:25:  [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.
			strcpy(str, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwape.c:666:25:  [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.
			strcpy(str, prefix); strcat(str, ".sa"); bwt_restore_sa(str, bwt);
data/bwa-0.7.17/bwape.c:745: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 'a': popt->max_isize = atoi(optarg); break;
data/bwa-0.7.17/bwape.c:746:29:  [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 'o': popt->max_occ = atoi(optarg); break;
data/bwa-0.7.17/bwape.c:749:29:  [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': popt->n_multi = atoi(optarg); break;
data/bwa-0.7.17/bwape.c:750:29:  [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': popt->N_multi = atoi(optarg); break;
data/bwa-0.7.17/bwase.c:147:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char str[1024];
data/bwa-0.7.17/bwase.c:150:23:  [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.
	strcpy(str, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwase.c:151:23:  [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.
	strcpy(str, prefix); strcat(str, ".sa"); bwt_restore_sa(str, bwt);
data/bwa-0.7.17/bwase.c:367:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buffer[4096];
data/bwa-0.7.17/bwase.c:519:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char magic[4];
data/bwa-0.7.17/bwase.c:589: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).
		case 'n': n_occ = atoi(optarg); break;
data/bwa-0.7.17/bwaseqio.c:14:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern unsigned char nst_nt4_table[256];
data/bwa-0.7.17/bwaseqio.c:130: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(p->rseq, p->seq, p->len);
data/bwa-0.7.17/bwaseqio.c:203: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(p->rseq, p->seq, p->len);
data/bwa-0.7.17/bwashm.c:18:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[PATH_MAX + 1], *tmpfn = (char*)_tmpfn;
data/bwa-0.7.17/bwashm.c:41:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fp = fopen(tmpfn, "wb")) != 0) {
data/bwa-0.7.17/bwashm.c:55:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcat(strcpy(path, "/bwaidx-"), name);
data/bwa-0.7.17/bwashm.c:63:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(shm + cnt[1], &idx->l_mem, 8);
data/bwa-0.7.17/bwashm.c:64:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(shm + cnt[1] + 8, name, l - 8);
data/bwa-0.7.17/bwashm.c:70:8:  [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 = fopen(tmpfn, "rb");
data/bwa-0.7.17/bwashm.c:79: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(shm_idx, idx->mem, idx->l_mem);
data/bwa-0.7.17/bwashm.c:92:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char *p, path[PATH_MAX + 1];
data/bwa-0.7.17/bwashm.c:105: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(&l_mem, p, 8); p += 8;
data/bwa-0.7.17/bwashm.c:111:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcat(strcpy(path, "/bwaidx-"), name);
data/bwa-0.7.17/bwashm.c:150: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(&l_mem, p, 8); p += 8;
data/bwa-0.7.17/bwashm.c:162:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[PATH_MAX + 1];
data/bwa-0.7.17/bwashm.c:169: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(&l_mem, p, 8); p += 8;
data/bwa-0.7.17/bwashm.c:170:10:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcat(strcpy(path, "/bwaidx-"), p);
data/bwa-0.7.17/bwt.c:179:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(cnt, p, 4 * sizeof(bwtint_t));
data/bwa-0.7.17/bwt.c:203: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(cntk, p, 4 * sizeof(bwtint_t));
data/bwa-0.7.17/bwt.c:216: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(cntl, cntk, 4 * sizeof(bwtint_t));
data/bwa-0.7.17/bwt.c:423:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char skipped[256];
data/bwa-0.7.17/bwt_gen.c:1449:22:  [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).
	packedFile = (FILE*)fopen(inputFileName, "rb");
data/bwa-0.7.17/bwt_gen.c:1572:19:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	bwtFile = (FILE*)fopen(bwtFileName, "wb");
data/bwa-0.7.17/bwt_lite.c:43: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(b->occ + (i/16) * 4, c, 16);
data/bwa-0.7.17/bwt_lite.c:46: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(b->L2+1, c, 16);
data/bwa-0.7.17/bwt_lite.c:80:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(cnt, bwt->occ + (k>>4<<2), 16);
data/bwa-0.7.17/bwtaln.c:173:24:  [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.
		strcpy(str, prefix); strcat(str, ".bwt");  bwt = bwt_restore_bwt(str);
data/bwa-0.7.17/bwtaln.c:241:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			else opt->max_diff = atoi(optarg), opt->fnr = -1.0;
data/bwa-0.7.17/bwtaln.c:243:29:  [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 'o': opt->max_gapo = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:244: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).
		case 'e': opte = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:245:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'M': opt->s_mm = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:246:27:  [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 'O': opt->s_gapo = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:247:27:  [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': opt->s_gape = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:248: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 'd': opt->max_del_occ = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:249: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).
		case 'i': opt->indel_end_skip = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:250:29:  [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': opt->seed_len = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:251: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 'k': opt->max_seed_diff = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:252: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 'm': opt->max_entries = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:253: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 't': opt->n_threads = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:255:29:  [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': opt->max_top2 = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:256: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 'q': opt->trim_qual = atoi(optarg); break;
data/bwa-0.7.17/bwtaln.c:265:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'B': opt->mode |= atoi(optarg) << 24; break;
data/bwa-0.7.17/bwtaln.h:88:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char bc[BWA_MAX_BCLEN+1]; // null terminated; up to BWA_MAX_BCLEN bases
data/bwa-0.7.17/bwtindex.c:162:4:  [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(buf + k, c, sizeof(bwtint_t) * 4);
data/bwa-0.7.17/bwtindex.c:169:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(buf + k, c, sizeof(bwtint_t) * 4);
data/bwa-0.7.17/bwtindex.c:195:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'i': sa_intv = atoi(optarg); break;
data/bwa-0.7.17/bwtindex.c:249:14:  [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 (is_64) strcat(prefix, ".64");
data/bwa-0.7.17/bwtindex.c:278:24:  [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.
		strcpy(str, prefix); strcat(str, ".pac");
data/bwa-0.7.17/bwtindex.c:279:25:  [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.
		strcpy(str2, prefix); strcat(str2, ".bwt");
data/bwa-0.7.17/bwtindex.c:293:24:  [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.
		strcpy(str, prefix); strcat(str, ".bwt");
data/bwa-0.7.17/bwtindex.c:312:24:  [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.
		strcpy(str, prefix); strcat(str, ".bwt");
data/bwa-0.7.17/bwtindex.c:313:25:  [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.
		strcpy(str3, prefix); strcat(str3, ".sa");
data/bwa-0.7.17/bwtsw2_aux.c:30:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern unsigned char nst_nt4_table[256];
data/bwa-0.7.17/bwtsw2_aux.c:32:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char nt_comp_table[256] = {
data/bwa-0.7.17/bwtsw2_aux.c:86: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(p->hits, b->hits, p->n * sizeof(bsw2hit_t));
data/bwa-0.7.17/bwtsw2_aux.c:387:4:  [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(cigar, cn, 4 * nc);
data/bwa-0.7.17/bwtsw2_aux.c:392:4:  [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(cigar, cn + nc, 4 * (j - nc));
data/bwa-0.7.17/bwtsw2_core.c:201:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(u->array + u->n, v->array, v->n * sizeof(bsw2cell_t));
data/bwa-0.7.17/bwtsw2_main.c:21:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'q': opt->q = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:22:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'r': opt->r = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:23:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'a': opt->a = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:24:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'b': opt->b = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:25:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'w': opt->bw = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:26:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'T': opt->t = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:27: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 't': opt->n_threads = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:28:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'z': opt->z = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:29:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 's': opt->is = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:32:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'N': opt->t_seeds = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:36:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		case 'I': opt->max_ins = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_main.c:39: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 'G': opt->max_chain_gap = atoi(optarg); break;
data/bwa-0.7.17/bwtsw2_pair.c:103:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern unsigned char nst_nt4_table[256];
data/bwa-0.7.17/bwtsw2_pair.c:105:136:  [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.
void bsw2_pair1(const bsw2opt_t *opt, int64_t l_pac, const uint8_t *pac, const bsw2pestat_t *st, const bsw2hit_t *h, int l_mseq, const char *mseq, bsw2hit_t *a, int8_t g_mat[25])
data/bwa-0.7.17/debian/include/simde/hedley.h:1277:25:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
             ((struct { char v[sizeof(void) * 2]; } *) 1) \
data/bwa-0.7.17/debian/include/simde/x86/sse.h:1532: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(&r, mem_addr, sizeof(r.f32));
data/bwa-0.7.17/debian/include/simde/x86/sse.h:2893: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:2092: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(&r, mem_addr, sizeof(simde_float64));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:2172: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(&r, mem_addr, sizeof(simde_float64));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:3974: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4006: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(mem_addr, &a, sizeof(a.f64[0]));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4022: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4093: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4108: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(mem_addr, v, sizeof(v));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4110: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4124: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/debian/include/simde/x86/sse2.h:4138: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(mem_addr, &a, sizeof(a));
data/bwa-0.7.17/fastmap.c:17:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern unsigned char nst_nt4_table[256];
data/bwa-0.7.17/fastmap.c:134: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).
		if (c == 'k') opt->min_seed_len = atoi(optarg), opt0.min_seed_len = 1;
data/bwa-0.7.17/fastmap.c:137: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).
		else if (c == 'w') opt->w = atoi(optarg), opt0.w = 1;
data/bwa-0.7.17/fastmap.c:138: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).
		else if (c == 'A') opt->a = atoi(optarg), opt0.a = 1;
data/bwa-0.7.17/fastmap.c:139: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).
		else if (c == 'B') opt->b = atoi(optarg), opt0.b = 1;
data/bwa-0.7.17/fastmap.c:140: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).
		else if (c == 'T') opt->T = atoi(optarg), opt0.T = 1;
data/bwa-0.7.17/fastmap.c:141: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).
		else if (c == 'U') opt->pen_unpaired = atoi(optarg), opt0.pen_unpaired = 1;
data/bwa-0.7.17/fastmap.c:142:39:  [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 == 't') opt->n_threads = atoi(optarg), opt->n_threads = opt->n_threads > 1? opt->n_threads : 1;
data/bwa-0.7.17/fastmap.c:152: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).
		else if (c == 'c') opt->max_occ = atoi(optarg), opt0.max_occ = 1;
data/bwa-0.7.17/fastmap.c:153: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).
		else if (c == 'd') opt->zdrop = atoi(optarg), opt0.zdrop = 1;
data/bwa-0.7.17/fastmap.c:154: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).
		else if (c == 'v') bwa_verbose = atoi(optarg);
data/bwa-0.7.17/fastmap.c:158: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') opt->max_matesw = atoi(optarg), opt0.max_matesw = 1;
data/bwa-0.7.17/fastmap.c:159: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).
		else if (c == 's') opt->split_width = atoi(optarg), opt0.split_width = 1;
data/bwa-0.7.17/fastmap.c:160:43:  [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 == 'G') opt->max_chain_gap = atoi(optarg), opt0.max_chain_gap = 1;
data/bwa-0.7.17/fastmap.c:161:46:  [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 == 'N') opt->max_chain_extend = atoi(optarg), opt0.max_chain_extend = 1;
data/bwa-0.7.17/fastmap.c:163:46:  [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 == 'W') opt->min_chain_weight = atoi(optarg), opt0.min_chain_weight = 1;
data/bwa-0.7.17/fastmap.c:164:42:  [2] (integer) atol:
  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 == 'y') opt->max_mem_intv = atol(optarg), opt0.max_mem_intv = 1;
data/bwa-0.7.17/fastmap.c:166: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).
		else if (c == 'K') fixed_chunk_size = atoi(optarg);
data/bwa-0.7.17/fastmap.c:176:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			opt->mapQ_coef_len = atoi(optarg);
data/bwa-0.7.17/fastmap.c:198: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).
				if ((fp = fopen(optarg, "r")) != 0) {
data/bwa-0.7.17/fastmap.c:387:27:  [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 'w': min_iwidth = atoi(optarg); break;
data/bwa-0.7.17/fastmap.c:388:24:  [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': min_len = atoi(optarg); break;
data/bwa-0.7.17/fastmap.c:389:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			case 'i': min_intv = atoi(optarg); break;
data/bwa-0.7.17/fastmap.c:390:25:  [2] (integer) atol:
  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 'I': max_intv = atol(optarg); break;
data/bwa-0.7.17/fastmap.c:391:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			case 'L': max_len  = atoi(optarg); break;
data/bwa-0.7.17/is.c:34:74:  [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.
#define chr(i) (cs == sizeof(int) ? ((const int *)T)[i]:((const unsigned char *)T)[i])
data/bwa-0.7.17/kbtree.h:183: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(__KB_KEY(key_t, z), __KB_KEY(key_t, y) + b->t, sizeof(key_t) * (b->t - 1)); \
data/bwa-0.7.17/kbtree.h:184:23:  [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 (y->is_internal) memcpy(__KB_PTR(b, z), __KB_PTR(b, y) + b->t, sizeof(void*) * b->t); \
data/bwa-0.7.17/kopen.c:182:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char host2[80], port2[10];
data/bwa-0.7.17/kopen.c:212:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(pasv_ip, v, 4 * sizeof(int));
data/bwa-0.7.17/kopen.c:215:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(host2, "%d.%d.%d.%d", pasv_ip[0], pasv_ip[1], pasv_ip[2], pasv_ip[3]);
data/bwa-0.7.17/kopen.c:216:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(port2, "%d", pasv_port);
data/bwa-0.7.17/kopen.c:295:10:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
			pid = vfork();
data/bwa-0.7.17/kopen.c:320:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			*_fd = open(fn, O_RDONLY | O_BINARY);
data/bwa-0.7.17/kopen.c:322:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			*_fd = open(fn, O_RDONLY);
data/bwa-0.7.17/kopen.c:354:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char buf[BUF_SIZE];
data/bwa-0.7.17/kseq.h:128:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(str->s + str->l, ks->buf + ks->begin, i - ks->begin); \
data/bwa-0.7.17/kstring.h:39:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(s->s + s->l, p, l);
data/bwa-0.7.17/kstring.h:64:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[16];
data/bwa-0.7.17/kstring.h:81:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[16];
data/bwa-0.7.17/kstring.h:98:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[32];
data/bwa-0.7.17/ksw.c:625:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char seq_nt4_table[256] = {
data/bwa-0.7.17/ksw.c:656: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).
			case 'a': sa = atoi(optarg); break;
data/bwa-0.7.17/ksw.c:657: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).
			case 'b': sb = atoi(optarg); break;
data/bwa-0.7.17/ksw.c:658: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).
			case 'q': gapo = atoi(optarg); break;
data/bwa-0.7.17/ksw.c:659: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).
			case 'r': gape = atoi(optarg); break;
data/bwa-0.7.17/ksw.c:660:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			case 't': minsc = atoi(optarg); break;
data/bwa-0.7.17/kvec.h:72: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((v1).a, (v0).a, sizeof(type) * (v0).n);		\
data/bwa-0.7.17/pemerge.c:22:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char *err_msg[MAX_ERR+1] = {
data/bwa-0.7.17/pemerge.c:112:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(seq,  s[0], x[0].l_seq); memcpy(seq  + x[0].l_seq, &s[1][l], x[1].l_seq - l);
data/bwa-0.7.17/pemerge.c:112:34:  [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(seq,  s[0], x[0].l_seq); memcpy(seq  + x[0].l_seq, &s[1][l], x[1].l_seq - l);
data/bwa-0.7.17/pemerge.c:113:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(qual, q[0], x[0].l_seq); memcpy(qual + x[0].l_seq, &q[1][l], x[1].l_seq - l);
data/bwa-0.7.17/pemerge.c:113:34:  [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(qual, q[0], x[0].l_seq); memcpy(qual + x[0].l_seq, &q[1][l], x[1].l_seq - l);
data/bwa-0.7.17/pemerge.c:230: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).
		else if (c == 'Q') opt->q_thres = atoi(optarg);
data/bwa-0.7.17/pemerge.c:231:39:  [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 == 't') opt->n_threads = atoi(optarg);
data/bwa-0.7.17/pemerge.c:232: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).
		else if (c == 'T') min_ovlp = atoi(optarg);
data/bwa-0.7.17/rle.c:32:4:  [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(cnt, bc, 48);
data/bwa-0.7.17/rle.c:35:4:  [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(cnt, bc, 48);
data/bwa-0.7.17/rle.c:42:4:  [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(cnt, ec, 48);
data/bwa-0.7.17/rle.c:60: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(bc, cnt, 48);
data/bwa-0.7.17/rle.c:85: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(p, tmp, n_bytes2);
data/bwa-0.7.17/rle.c:104:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(new_block + 2, q, end - q);
data/bwa-0.7.17/rle.c:178: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(cnt, ec, 48);
data/bwa-0.7.17/rope.c:85: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(v->c, rope->c, 48);
data/bwa-0.7.17/rope.c:101: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(q, p + p->n, sizeof(rpnode_t) * (rope->max_nodes>>1));
data/bwa-0.7.17/rope.c:187: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(cy, cx, 48);
data/bwa-0.7.17/utils.c:61:12:  [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, mode)) == 0) {
data/bwa-0.7.17/bntseq.c:123:45:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while (q - str < sizeof(str) - 1 && (c = fgetc(fp)) != '\n' && c != EOF) *q++ = c;
data/bwa-0.7.17/bntseq.c:124:38:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while (c != '\n' && c != EOF) c = fgetc(fp);
data/bwa-0.7.17/bntseq.c:190:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = fgetc(fp)) != EOF) {
data/bwa-0.7.17/bntseq.c:198:39:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				while (c != '\n' && c != EOF) c = fgetc(fp);
data/bwa-0.7.17/bwa.c:223: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).
	l_hint = strlen(hint);
data/bwa-0.7.17/bwa.c:253: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).
	tmp = calloc(strlen(prefix) + 5, 1);
data/bwa-0.7.17/bwa.c:325:51:  [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).
		idx->bns->anns[i].name = (char*)(mem + k); k += strlen(idx->bns->anns[i].name) + 1;
data/bwa-0.7.17/bwa.c:326:51:  [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).
		idx->bns->anns[i].anno = (char*)(mem + k); k += strlen(idx->bns->anns[i].anno) + 1;
data/bwa-0.7.17/bwa.c:353: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).
		tmp += strlen(idx->bns->anns[i].name) + strlen(idx->bns->anns[i].anno) + 2;
data/bwa-0.7.17/bwa.c:353: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).
		tmp += strlen(idx->bns->anns[i].name) + strlen(idx->bns->anns[i].anno) + 2;
data/bwa-0.7.17/bwa.c:360:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		x = strlen(idx->bns->anns[i].name) + 1; memcpy(mem + k, idx->bns->anns[i].name, x); k += x;
data/bwa-0.7.17/bwa.c:361:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		x = strlen(idx->bns->anns[i].anno) + 1; memcpy(mem + k, idx->bns->anns[i].anno, x); k += x;
data/bwa-0.7.17/bwa.c:457: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).
		len = strlen(hdr);
data/bwa-0.7.17/bwa.c:458: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).
		hdr = realloc(hdr, len + strlen(s) + 2);
data/bwa-0.7.17/bwamem.c:843: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).
	l_name = strlen(s->name);
data/bwa-0.7.17/bwamem.c:1123: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).
	l_MD = strlen((char*)(a.cigar + a.n_cigar)) + 1;
data/bwa-0.7.17/bwaseqio.c:208:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			int t = strlen(p->name);
data/bwa-0.7.17/bwashm.c:21: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).
	for (name = hint + strlen(hint) - 1; name >= hint && *name != '/'; --name);
data/bwa-0.7.17/bwashm.c:61: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).
	l = 8 + strlen(name) + 1;
data/bwa-0.7.17/bwashm.c:98: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).
	for (name = hint + strlen(hint) - 1; name >= hint && *name != '/'; --name);
data/bwa-0.7.17/bwashm.c:107:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		p += strlen(p) + 1;
data/bwa-0.7.17/bwashm.c:128: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).
	for (name = hint + strlen(hint) - 1; name >= hint && *name != '/'; --name);
data/bwa-0.7.17/bwashm.c:135:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		p += strlen(p) + 9;
data/bwa-0.7.17/bwashm.c:152:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		p += strlen(p) + 1;
data/bwa-0.7.17/bwashm.c:172:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		p += strlen(p) + 1;
data/bwa-0.7.17/bwtaln.c:172: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).
		char *str = (char*)calloc(strlen(prefix) + 10, 1);
data/bwa-0.7.17/bwtindex.c:247: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).
		prefix = malloc(strlen(argv[optind]) + 4);
data/bwa-0.7.17/bwtindex.c:264: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).
	str  = (char*)calloc(strlen(prefix) + 10, 1);
data/bwa-0.7.17/bwtindex.c:265: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).
	str2 = (char*)calloc(strlen(prefix) + 10, 1);
data/bwa-0.7.17/bwtindex.c:266: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).
	str3 = (char*)calloc(strlen(prefix) + 10, 1);
data/bwa-0.7.17/bwtsw2_aux.c:532:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			int l = strlen(ks->comment);
data/bwa-0.7.17/fastmap.c:202: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).
						i = strlen(buf);
data/bwa-0.7.17/kopen.c:88:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(http_host, fn + 7, l);
data/bwa-0.7.17/kopen.c:120:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (l < bufsz && (bytes = read(fd, buf + l, 1)) > 0) { // read HTTP header; FIXME: bad efficiency
data/bwa-0.7.17/kopen.c:154:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (read(aux->ctrl_fd, &c, 1)) { // FIXME: this is *VERY BAD* for unbuffered I/O
data/bwa-0.7.17/kopen.c:175: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).
	if (write_bytes(aux->ctrl_fd, cmd, strlen(cmd)) != 0) return -1;
data/bwa-0.7.17/kopen.c:193:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(host, fn + 6, l);
data/bwa-0.7.17/kopen.c:194: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).
	retr = calloc(strlen(p) + 8, 1);
data/bwa-0.7.17/kopen.c:236:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	end = strlen(cmd);
data/bwa-0.7.17/kopen.c:248:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(argv[0], cmd + beg, end - beg);
data/bwa-0.7.17/kstring.h:47: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).
	return kputsn(p, strlen(p), s);
data/bwa-0.7.17/malloc_wrap.c:53: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).
				func, strlen(s), file, line, strerror(errno));

ANALYSIS SUMMARY:

Hits = 320
Lines analyzed = 28464 in approximately 0.91 seconds (31296 lines/second)
Physical Source Lines of Code (SLOC) = 24004
Hits@level = [0] 369 [1]  42 [2] 211 [3]  23 [4]  44 [5]   0
Hits@level+ = [0+] 689 [1+] 320 [2+] 278 [3+]  67 [4+]  44 [5+]   0
Hits/KSLOC@level+ = [0+] 28.7035 [1+] 13.3311 [2+] 11.5814 [3+] 2.7912 [4+] 1.83303 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.