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/htslib-1.11/bcf_sr_sort.c Examining data/htslib-1.11/bcf_sr_sort.h Examining data/htslib-1.11/bgzf.c Examining data/htslib-1.11/bgzip.c Examining data/htslib-1.11/cram/cram.h Examining data/htslib-1.11/cram/cram_codecs.c Examining data/htslib-1.11/cram/cram_codecs.h Examining data/htslib-1.11/cram/cram_encode.c Examining data/htslib-1.11/cram/cram_encode.h Examining data/htslib-1.11/cram/cram_external.c Examining data/htslib-1.11/cram/cram_index.c Examining data/htslib-1.11/cram/cram_index.h Examining data/htslib-1.11/cram/cram_io.c Examining data/htslib-1.11/cram/cram_io.h Examining data/htslib-1.11/cram/cram_samtools.c Examining data/htslib-1.11/cram/cram_samtools.h Examining data/htslib-1.11/cram/cram_stats.c Examining data/htslib-1.11/cram/cram_stats.h Examining data/htslib-1.11/cram/cram_structs.h Examining data/htslib-1.11/cram/mFILE.c Examining data/htslib-1.11/cram/mFILE.h Examining data/htslib-1.11/cram/misc.h Examining data/htslib-1.11/cram/open_trace_file.c Examining data/htslib-1.11/cram/open_trace_file.h Examining data/htslib-1.11/cram/pooled_alloc.c Examining data/htslib-1.11/cram/pooled_alloc.h Examining data/htslib-1.11/cram/rANS_byte.h Examining data/htslib-1.11/cram/rANS_static.c Examining data/htslib-1.11/cram/rANS_static.h Examining data/htslib-1.11/cram/string_alloc.c Examining data/htslib-1.11/cram/string_alloc.h Examining data/htslib-1.11/cram/os.h Examining data/htslib-1.11/cram/cram_decode.c Examining data/htslib-1.11/cram/cram_decode.h Examining data/htslib-1.11/errmod.c Examining data/htslib-1.11/faidx.c Examining data/htslib-1.11/header.c Examining data/htslib-1.11/header.h Examining data/htslib-1.11/hfile.c Examining data/htslib-1.11/hfile_gcs.c Examining data/htslib-1.11/hfile_internal.h Examining data/htslib-1.11/hfile_libcurl.c Examining data/htslib-1.11/hfile_net.c Examining data/htslib-1.11/hfile_s3.c Examining data/htslib-1.11/hfile_s3_write.c Examining data/htslib-1.11/hts.c Examining data/htslib-1.11/hts_internal.h Examining data/htslib-1.11/hts_os.c Examining data/htslib-1.11/htsfile.c Examining data/htslib-1.11/htslib/bgzf.h Examining data/htslib-1.11/htslib/cram.h Examining data/htslib-1.11/htslib/faidx.h Examining data/htslib-1.11/htslib/hfile.h Examining data/htslib-1.11/htslib/hts.h Examining data/htslib-1.11/htslib/hts_defs.h Examining data/htslib-1.11/htslib/hts_endian.h Examining data/htslib-1.11/htslib/hts_log.h Examining data/htslib-1.11/htslib/hts_os.h Examining data/htslib-1.11/htslib/kbitset.h Examining data/htslib-1.11/htslib/kfunc.h Examining data/htslib-1.11/htslib/khash.h Examining data/htslib-1.11/htslib/khash_str2int.h Examining data/htslib-1.11/htslib/klist.h Examining data/htslib-1.11/htslib/knetfile.h Examining data/htslib-1.11/htslib/kroundup.h Examining data/htslib-1.11/htslib/kseq.h Examining data/htslib-1.11/htslib/ksort.h Examining data/htslib-1.11/htslib/kstring.h Examining data/htslib-1.11/htslib/regidx.h Examining data/htslib-1.11/htslib/sam.h Examining data/htslib-1.11/htslib/synced_bcf_reader.h Examining data/htslib-1.11/htslib/tbx.h Examining data/htslib-1.11/htslib/thread_pool.h Examining data/htslib-1.11/htslib/vcf.h Examining data/htslib-1.11/htslib/vcf_sweep.h Examining data/htslib-1.11/htslib/vcfutils.h Examining data/htslib-1.11/kfunc.c Examining data/htslib-1.11/knetfile.c Examining data/htslib-1.11/kstring.c Examining data/htslib-1.11/md5.c Examining data/htslib-1.11/multipart.c Examining data/htslib-1.11/os/lzma_stub.h Examining data/htslib-1.11/os/rand.c Examining data/htslib-1.11/probaln.c Examining data/htslib-1.11/realn.c Examining data/htslib-1.11/regidx.c Examining data/htslib-1.11/region.c Examining data/htslib-1.11/sam_internal.h Examining data/htslib-1.11/synced_bcf_reader.c Examining data/htslib-1.11/tabix.c Examining data/htslib-1.11/tbx.c Examining data/htslib-1.11/test/fieldarith.c Examining data/htslib-1.11/test/fuzz/hts_open_fuzzer.c Examining data/htslib-1.11/test/hfile.c Examining data/htslib-1.11/test/hts_endian.c Examining data/htslib-1.11/test/pileup.c Examining data/htslib-1.11/test/plugins-dlhts.c Examining data/htslib-1.11/test/sam.c Examining data/htslib-1.11/test/test-bcf-sr.c Examining data/htslib-1.11/test/test-bcf-translate.c Examining data/htslib-1.11/test/test-parse-reg.c Examining data/htslib-1.11/test/test-regidx.c Examining data/htslib-1.11/test/test-vcf-api.c Examining data/htslib-1.11/test/test-vcf-sweep.c Examining data/htslib-1.11/test/test_bgzf.c Examining data/htslib-1.11/test/test_index.c Examining data/htslib-1.11/test/test_kfunc.c Examining data/htslib-1.11/test/test_kstring.c Examining data/htslib-1.11/test/test_realn.c Examining data/htslib-1.11/test/test_str2int.c Examining data/htslib-1.11/test/test_view.c Examining data/htslib-1.11/test/thrash_threads1.c Examining data/htslib-1.11/test/thrash_threads2.c Examining data/htslib-1.11/test/thrash_threads3.c Examining data/htslib-1.11/test/thrash_threads4.c Examining data/htslib-1.11/test/thrash_threads5.c Examining data/htslib-1.11/test/thrash_threads6.c Examining data/htslib-1.11/test/thrash_threads7.c Examining data/htslib-1.11/textutils.c Examining data/htslib-1.11/textutils_internal.h Examining data/htslib-1.11/thread_pool.c Examining data/htslib-1.11/thread_pool_internal.h Examining data/htslib-1.11/vcf.c Examining data/htslib-1.11/vcf_sweep.c Examining data/htslib-1.11/vcfutils.c Examining data/htslib-1.11/sam.c Examining data/htslib-1.11/plugin.c FINAL RESULTS: data/htslib-1.11/cram/cram_io.c:2209:9: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, mode); data/htslib-1.11/cram/cram_io.c:2216:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, mode); data/htslib-1.11/cram/cram_io.c:2442:13: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path_tmp.s, 0444) < 0 || data/htslib-1.11/bcf_sr_sort.c:293:13: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr,"\t%"PRIhts_pos, buf->rec[j] ? buf->rec[j]->pos+1 : 0); data/htslib-1.11/bgzip.c:51:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/bgzip.c:211:17: [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, argv[optind]); data/htslib-1.11/cram/cram_io.c:84:17: [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 RP(...) fprintf (stderr, __VA_ARGS__) data/htslib-1.11/cram/cram_io.c:1770:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(fai_file, R_OK) != 0) data/htslib-1.11/cram/cram_io.c:2148:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, fn); data/htslib-1.11/cram/cram_io.c:2182:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, dir); data/htslib-1.11/cram/cram_io.c:2190:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, fn); data/htslib-1.11/cram/open_trace_file.c:245:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s", file); data/htslib-1.11/cram/open_trace_file.c:267:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path_end, file); data/htslib-1.11/cram/open_trace_file.c:279:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path_end, file); data/htslib-1.11/cram/open_trace_file.c:386:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(relative_path, relative_to); data/htslib-1.11/cram/os.h:190:9: [4] (shell) popen: 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. #define popen _popen data/htslib-1.11/faidx.c:384:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. n = sscanf(p, "%"SCNu64"%"SCNu64"%"SCNu32"%"SCNu32, &len, &seq_offset, &line_blen, &line_len); data/htslib-1.11/faidx.c:391:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. n = sscanf(p, "%"SCNu64"%"SCNu64"%"SCNu32"%"SCNu32"%"SCNu64, &len, &seq_offset, &line_blen, &line_len, &qual_offset); data/htslib-1.11/header.c:189:21: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(tmp, sizeof(tmp), "%" PRIhts_pos, data/htslib-1.11/header.c:1096:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(len, sizeof(len), "%"PRIhts_pos, hrecs->ref[tid].len); data/htslib-1.11/hfile_libcurl.c:264:41: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. curl_lock_access access, void *userptr) { data/htslib-1.11/hfile_s3.c:384:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(escaped + j, qs + i); data/htslib-1.11/hfile_s3.c:419:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(escaped + j, path + i); data/htslib-1.11/hfile_s3_write.c:103:41: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. curl_lock_access access, void *userptr) { data/htslib-1.11/hts.c:1998: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((char *)idx->meta + idx->l_meta, name); data/htslib-1.11/hts.c:2148: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(fnidx, fn); data/htslib-1.11/hts.c:3693:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(s.s, R_OK) == 0) data/htslib-1.11/hts.c:3834: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(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, csi_ext); data/htslib-1.11/hts.c:3834:32: [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(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, csi_ext); data/htslib-1.11/hts.c:3841:17: [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(fnidx_tmp + i, csi_ext); data/htslib-1.11/hts.c:3851:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, bai_ext); data/htslib-1.11/hts.c:3851:36: [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(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, bai_ext); data/htslib-1.11/hts.c:3858:21: [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(fnidx_tmp + i, bai_ext); data/htslib-1.11/hts.c:3867:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, tbi_ext); data/htslib-1.11/hts.c:3867:36: [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(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, tbi_ext); data/htslib-1.11/hts.c:3874:21: [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(fnidx_tmp + i, tbi_ext); data/htslib-1.11/hts.c:3883:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, crai_ext); data/htslib-1.11/hts.c:3883:36: [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(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, crai_ext); data/htslib-1.11/hts.c:3890:21: [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(fnidx_tmp + i, crai_ext); data/htslib-1.11/hts.c:3899:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, fai_ext); data/htslib-1.11/hts.c:3899:36: [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(fnidx_tmp, fn_tmp); strcpy(fnidx_tmp + l_fn, fai_ext); data/htslib-1.11/hts.c:4223:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, argptr); data/htslib-1.11/htsfile.c:57:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, args); data/htslib-1.11/htslib/hts_defs.h:97:24: [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 HTS_PRINTF_FMT printf data/htslib-1.11/knetfile.c:323:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fp->retr, "RETR %s\r\n", p); data/htslib-1.11/knetfile.c:325:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fp->size_cmd, "SIZE %s\r\n", p); data/htslib-1.11/knetfile.c:422:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. l += sprintf(buf + l, "GET %s HTTP/1.0\r\nHost: %s\r\n", fp->path, fp->http_host); data/htslib-1.11/kstring.c:156: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, args); // This line does not work with glibc 2.0. See `man snprintf'. data/htslib-1.11/kstring.c:162: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, args); data/htslib-1.11/sam.c:3752: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(mode_opts, mode ? mode : "r"); data/htslib-1.11/sam.c:3798: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(cp, opts); data/htslib-1.11/tabix.c:60:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/tabix.c:73:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/tabix.c:657: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(strcpy(idx_fname, fname), suffix); data/htslib-1.11/tabix.c:657:12: [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(idx_fname, fname), suffix); data/htslib-1.11/test/hfile.c:43:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, args); data/htslib-1.11/test/sam.c:65:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/htslib-1.11/test/sam.c:1462:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmpfilename, "%s.tmp", filename); data/htslib-1.11/test/test-bcf-sr.c:42:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/test/test-bcf-sr.c:116:13: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf("%s:%"PRIhts_pos, bcf_seqname_safe(bcf_sr_get_header(sr,i),rec),rec->pos+1); data/htslib-1.11/test/test-bcf-translate.c:36:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/test/test-regidx.c:50:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/test/test-regidx.c:60:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/test/test-regidx.c:69:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/test/test-regidx.c:309:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s\t%d\t%d\n",chr,start-1,end); data/htslib-1.11/test/test-regidx.c:313:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s\t%d\t%d\n",chr,start,end); data/htslib-1.11/test/test-regidx.c:317:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s:%d-%d\n",chr,start,end); data/htslib-1.11/test/test-vcf-api.c:38:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/htslib-1.11/thread_pool.c:64:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(fp, fmt, args); data/htslib-1.11/vcf.c:971:13: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int n = vsnprintf(line, sizeof(tmp), fmt, ap); data/htslib-1.11/vcf.c:981:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(line, n, fmt, ap); data/htslib-1.11/bgzip.c:157:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((c = getopt_long(argc, argv, "cdh?fb:@:s:iI:l:grt",loptions,NULL)) >= 0){ data/htslib-1.11/cram/cram_io.c:2229:12: [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. base = getenv("XDG_CACHE_HOME"); data/htslib-1.11/cram/cram_io.c:2232:12: [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. base = getenv("HOME"); data/htslib-1.11/cram/cram_io.c:2235:12: [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. base = getenv("TMPDIR"); data/htslib-1.11/cram/cram_io.c:2238:12: [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. base = getenv("TEMP"); data/htslib-1.11/cram/cram_io.c:2252:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *ref_path = getenv("REF_PATH"); data/htslib-1.11/cram/cram_io.c:2258:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *local_cache = getenv("REF_CACHE"); data/htslib-1.11/cram/open_trace_file.c:337:16: [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. path = getenv("RAWDATA"); data/htslib-1.11/cram/open_trace_file.c:412:16: [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. path = getenv("RAWDATA"); data/htslib-1.11/cram/rANS_static.c:820:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "o:d")) != -1) { data/htslib-1.11/hfile_gcs.c:77:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. access_token = getenv("GCS_OAUTH_TOKEN"); data/htslib-1.11/hfile_libcurl.c:1245:36: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* env_curl_ca_bundle = getenv("CURL_CA_BUNDLE"); data/htslib-1.11/hfile_libcurl.c:1529:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((auth = getenv("HTS_AUTH_LOCATION")) != NULL) { data/htslib-1.11/hfile_libcurl.c:1542:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((auth = getenv("HTS_ALLOW_UNENCRYPTED_AUTHORIZATION_HEADER")) != NULL data/htslib-1.11/hfile_s3.c:193:28: [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. const char *home = getenv("HOME"); data/htslib-1.11/hfile_s3.c:549:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((v = getenv("AWS_ACCESS_KEY_ID")) != NULL) kputs(v, &ad->id); data/htslib-1.11/hfile_s3.c:550:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((v = getenv("AWS_SECRET_ACCESS_KEY")) != NULL) kputs(v, &ad->secret); data/htslib-1.11/hfile_s3.c:551:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((v = getenv("AWS_SESSION_TOKEN")) != NULL) kputs(v, &ad->token); data/htslib-1.11/hfile_s3.c:552:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((v = getenv("AWS_DEFAULT_REGION")) != NULL) kputs(v, &ad->region); data/htslib-1.11/hfile_s3.c:553:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((v = getenv("HTS_S3_HOST")) != NULL) kputs(v, &ad->host); data/htslib-1.11/hfile_s3.c:555:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((v = getenv("AWS_DEFAULT_PROFILE")) != NULL) kputs(v, &profile); data/htslib-1.11/hfile_s3.c:556:23: [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. else if ((v = getenv("AWS_PROFILE")) != NULL) kputs(v, &profile); data/htslib-1.11/hfile_s3.c:561:25: [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. const char *v = getenv("AWS_SHARED_CREDENTIALS_FILE"); data/htslib-1.11/hfile_s3.c:570:25: [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. const char *v = getenv("HTS_S3_S3CFG"); data/htslib-1.11/hfile_s3.c:1211:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("HTS_S3_V2") == NULL) { // Force the v2 signature code data/htslib-1.11/hfile_s3.c:1230:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("HTS_S3_V2") == NULL) { // Force the v2 signature code data/htslib-1.11/hfile_s3_write.c:700:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((env = getenv("HTS_S3_PART_SIZE")) != NULL) { data/htslib-1.11/hts_os.c:46:54: [3] (random) erand48: 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 hts_erand48(unsigned short xseed[3]) { return erand48(xseed); } data/htslib-1.11/hts_os.c:49:35: [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 hts_drand48(void) { return drand48(); } data/htslib-1.11/hts_os.c:52:35: [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. double hts_lrand48(void) { return lrand48(); } data/htslib-1.11/htsfile.c:251:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "cChHv", options, NULL)) >= 0) data/htslib-1.11/htslib/hts_os.h:55:9: [3] (random) erand48: 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. #define erand48(X) hts_erand48((X)) data/htslib-1.11/htslib/hts_os.h:56:9: [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. #define drand48() hts_drand48() data/htslib-1.11/htslib/hts_os.h:57:9: [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. #define lrand48() hts_lrand48() data/htslib-1.11/htslib/hts_os.h:76:9: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srandom srand data/htslib-1.11/htslib/hts_os.h:76:17: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srandom srand data/htslib-1.11/htslib/hts_os.h:77:9: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define random rand data/htslib-1.11/knetfile.c:396: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/htslib-1.11/plugin.c:84:16: [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. path = getenv("HTS_PATH"); data/htslib-1.11/probaln.c:287:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "b:q:")) >= 0) { data/htslib-1.11/tabix.c:527:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "hH?0b:c:e:fm:p:s:S:lr:CR:T:D", loptions,NULL)) >= 0) data/htslib-1.11/test/pileup.c:210:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "m")) != -1) { data/htslib-1.11/test/plugins-dlhts.c:106:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "glv")) >= 0) data/htslib-1.11/test/test-bcf-sr.c:67:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "p:h", loptions, NULL)) >= 0) data/htslib-1.11/test/test-regidx.c:437:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "hvs:",loptions,NULL)) >= 0) data/htslib-1.11/test/test-regidx.c:466:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(seed); data/htslib-1.11/test/test_index.c:45:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "bctm:")) >= 0) { data/htslib-1.11/test/test_kstring.c:271:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "e:s:t:v")) != -1) { data/htslib-1.11/test/test_realn.c:56:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "aef:hi:o:r")) >= 0) { data/htslib-1.11/test/test_str2int.c:211:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "v")) != -1) { data/htslib-1.11/test/test_view.c:298:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "DSIt:i:bzCul:o:N:BZ:@:Mx:m:p:v")) >= 0) { data/htslib-1.11/thread_pool.c:1144:12: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. usleep(random() % 100000); // to coerce job completion out of order data/htslib-1.11/thread_pool.c:1185:38: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. usleep(500000 * ((job&31)==31) + random() % 10000); data/htslib-1.11/thread_pool.c:1382:12: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. usleep(random() % 10000); // fast job data/htslib-1.11/thread_pool.c:1408:12: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. usleep(random() % 100000); // slow job data/htslib-1.11/thread_pool.c:1433:12: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. usleep(random() % 10000); // fast job data/htslib-1.11/thread_pool.c:1489:5: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom(0); data/htslib-1.11/bcf_sr_sort.c:315:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, srt->charp[i], len); data/htslib-1.11/bgzf.c:95:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char comp_data[BGZF_MAX_BLOCK_SIZE]; data/htslib-1.11/bgzf.c:97:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char uncomp_data[BGZF_MAX_BLOCK_SIZE]; data/htslib-1.11/bgzf.c:320:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[32]; data/htslib-1.11/bgzf.c:516:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(_dst, "\037\213\010\4\0\0\0\0\0\377\6\0\102\103\2\0\033\0\3\0\0\0\0\0\0\0\0\0", 28); data/htslib-1.11/bgzf.c:529:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst + BLOCK_HEADER_LENGTH+5, src, slen); data/htslib-1.11/bgzf.c:556:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, g_magic, BLOCK_HEADER_LENGTH); // the last two bytes are a place holder for the length of the block data/htslib-1.11/bgzf.c:580:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst + BLOCK_HEADER_LENGTH+5, src, slen); data/htslib-1.11/bgzf.c:607:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, g_magic, BLOCK_HEADER_LENGTH); // the last two bytes are a place holder for the length of the block data/htslib-1.11/bgzf.c:852: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(fp->uncompressed_block, p->block, p->size); data/htslib-1.11/bgzf.c:906: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(p->block, fp->uncompressed_block, p->size); data/htslib-1.11/bgzf.c:1090:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cblock, header, sizeof(header)); data/htslib-1.11/bgzf.c:1128:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(compressed_block, header, BLOCK_HEADER_LENGTH); data/htslib-1.11/bgzf.c:1197:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, buffer + fp->block_offset, copy_length); data/htslib-1.11/bgzf.c:1275: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(j->comp_data, g_magic, BLOCK_HEADER_LENGTH); data/htslib-1.11/bgzf.c:1451: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(compressed_block, header, BLOCK_HEADER_LENGTH); data/htslib-1.11/bgzf.c:1793:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(j->comp_data + BLOCK_HEADER_LENGTH + 5, fp->uncompressed_block, data/htslib-1.11/bgzf.c:1801:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(j->uncomp_data, fp->uncompressed_block, j->uncomp_len); data/htslib-1.11/bgzf.c:1937:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer + fp->block_offset, input, copy_length); data/htslib-1.11/bgzf.c:1968:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer + fp->block_offset, input, copy_length); data/htslib-1.11/bgzf.c:2224:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(str->s + str->l, buf + fp->block_offset, l); data/htslib-1.11/bgzip.c:58:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[1024]; data/htslib-1.11/bgzip.c:161:27: [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 'b': start = atol(optarg); compress = 0; pstdout = 1; break; data/htslib-1.11/bgzip.c:162:26: [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 's': size = atol(optarg); pstdout = 1; break; data/htslib-1.11/bgzip.c:166:36: [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 'l': compress_level = atol(optarg); break; data/htslib-1.11/bgzip.c:169: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 '@': threads = atoi(optarg); break; data/htslib-1.11/bgzip.c:187:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char out_mode[3] = "w\0"; data/htslib-1.11/bgzip.c:188:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char out_mode_exclusive[4] = "wx\0"; data/htslib-1.11/bgzip.c:201:26: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((f_src = open(argv[optind], O_RDONLY)) < 0) { data/htslib-1.11/bgzip.c:212:17: [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(name, ".gz"); data/htslib-1.11/bgzip.c:352:25: [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). f_dst = open(name, is_forced? wrflags : wrflags|O_EXCL, 0666); data/htslib-1.11/bgzip.c:354:29: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f_dst = open(name, wrflags, 0666); data/htslib-1.11/cram/cram_codecs.c:146: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(&block->data[block->byte], bytes, len); data/htslib-1.11/cram/cram_codecs.c:371:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, cp, *out_size); data/htslib-1.11/cram/cram_codecs.c:473:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[99], *tp = tmp; data/htslib-1.11/cram/cram_codecs.c:1966:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[20], *cp = buf; data/htslib-1.11/cram/cram_decode.c:214: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(hdr->substitution_matrix, "CGTNAGTNACTNACGNACGT", 20); data/htslib-1.11/cram/cram_decode.c:1044:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hdr->md5, cp, 16); data/htslib-1.11/cram/cram_decode.c:1202:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&seq[seq_pos-1], data/htslib-1.11/cram/cram_decode.c:1233:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&seq[seq_pos-1], &s->ref[ref_pos - s->ref_start +1], data/htslib-1.11/cram/cram_decode.c:1690:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&seq[seq_pos-1], data/htslib-1.11/cram/cram_decode.c:1723:29: [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_pos-1], &s->ref[j], cr->len - (seq_pos-1)); data/htslib-1.11/cram/cram_decode.c:1727:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&seq[seq_pos-1], &s->ref[ref_pos - s->ref_start +1], data/htslib-1.11/cram/cram_decode.c:1814:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[7]; data/htslib-1.11/cram/cram_decode.c:1884:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char tag_data[3]; data/htslib-1.11/cram/cram_decode.c:1893:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tag_data, &id, 3); data/htslib-1.11/cram/cram_decode.c:1949:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char tag_data[3]; data/htslib-1.11/cram/cram_decode.c:2273:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char digest[16]; data/htslib-1.11/cram/cram_decode.c:2315:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char M[33]; data/htslib-1.11/cram/cram_decode.c:2843:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name_a[1024], *name; data/htslib-1.11/cram/cram_decode.c:2857:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(name, fd->prefix, name_len); data/htslib-1.11/cram/cram_decode.c:2920:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(aux, BLOCK_DATA(s->aux_blk) + cr->aux, cr->aux_size); data/htslib-1.11/cram/cram_decode.c:2928:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(aux, bfd->rg[cr->rg].name, len); data/htslib-1.11/cram/cram_encode.c:223: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. char smat[5], *mp = smat; data/htslib-1.11/cram/cram_encode.c:579:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cp, s->hdr->md5, 16); cp += 16; data/htslib-1.11/cram/cram_encode.c:1780:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(h->substitution_matrix, CRAM_SUBST_MATRIX, 20); data/htslib-1.11/cram/cram_encode.c:2165:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. uint32_t count = (uint32_t)((((unsigned char *)aux)[4]<< 0) + data/htslib-1.11/cram/cram_encode.c:2166:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)aux)[5]<< 8) + data/htslib-1.11/cram/cram_encode.c:2167:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)aux)[6]<<16) + data/htslib-1.11/cram/cram_encode.c:2168:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)aux)[7]<<24)); data/htslib-1.11/cram/cram_encode.c:2194:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, aux, blen); tmp += blen; aux += blen; data/htslib-1.11/cram/cram_encode.c:2504:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. uint32_t count = (uint32_t)((((unsigned char *)aux)[4]<< 0) + data/htslib-1.11/cram/cram_encode.c:2505:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)aux)[5]<< 8) + data/htslib-1.11/cram/cram_encode.c:2506:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)aux)[6]<<16) + data/htslib-1.11/cram/cram_encode.c:2507:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)aux)[7]<<24)); data/htslib-1.11/cram/cram_encode.c:3035:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(to, from, cr->len); data/htslib-1.11/cram/cram_index.c:148:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[65536]; data/htslib-1.11/cram/cram_index.c:602:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/htslib-1.11/cram/cram_index.c:628:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%d\t%"PRId64"\t%"PRId64"\t%"PRId64"\t%d\t%d\n", data/htslib-1.11/cram/cram_index.c:641:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%d\t%"PRId64"\t%"PRId64"\t%"PRId64"\t%d\t%d\n", data/htslib-1.11/cram/cram_index.c:662:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/htslib-1.11/cram/cram_index.c:673:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%d\t%"PRId64"\t%"PRId64"\t%"PRId64"\t%d\t%d\n", data/htslib-1.11/cram/cram_io.c:191:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char c[5]; data/htslib-1.11/cram/cram_io.c:256:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[5]; data/htslib-1.11/cram/cram_io.c:375:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char c[9]; data/htslib-1.11/cram/cram_io.c:494:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[5]; data/htslib-1.11/cram/cram_io.c:506:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[9]; data/htslib-1.11/cram/cram_io.c:564:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char cp[4]; data/htslib-1.11/cram/cram_io.c:997:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char dat[100], *cp = dat;; data/htslib-1.11/cram/cram_io.c:1040:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char dat[100], *cp = dat;; data/htslib-1.11/cram/cram_io.c:1767:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fai_file[PATH_MAX]; data/htslib-1.11/cram/cram_io.c:1800:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fai_fn[PATH_MAX]; data/htslib-1.11/cram/cram_io.c:1801:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[8192]; data/htslib-1.11/cram/cram_io.c:1836:13: [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(fai_fn, "%.*s.fai", PATH_MAX-5, fn); data/htslib-1.11/cram/cram_io.c:2255:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/htslib-1.11/cram/cram_io.c:2257:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cache[PATH_MAX], cache_root[PATH_MAX]; data/htslib-1.11/cram/cram_io.c:2418:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char unsigned md5_buf1[16]; data/htslib-1.11/cram/cram_io.c:2419:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char md5_buf2[33]; data/htslib-1.11/cram/cram_io.c:3249:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf_a[1024], *buf = buf_a; data/htslib-1.11/cram/cram_io.c:4004:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(header, BLOCK_END(b), header_len); data/htslib-1.11/cram/cram_io.c:4095:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(out+len, "/%.*s", PATH_MAX - 2 - len, in); data/htslib-1.11/cram/cram_io.c:4137: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. char unsigned buf[16]; data/htslib-1.11/cram/cram_io.c:4138: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. char buf2[33]; data/htslib-1.11/cram/cram_io.c:4164: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. char ref_fn[PATH_MAX]; data/htslib-1.11/cram/cram_io.c:4404:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fmode[3]= { mode[0], '\0', '\0' }; data/htslib-1.11/cram/cram_io.c:4560:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[65536]; data/htslib-1.11/cram/cram_io.c:4972:27: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const unsigned char TEMPLATE_2_1[30] = { data/htslib-1.11/cram/cram_io.c:4977:27: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const unsigned char TEMPLATE_3[38] = { data/htslib-1.11/cram/cram_io.c:4984:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[38]; // max(sizeof TEMPLATE_*) data/htslib-1.11/cram/cram_io.h:544: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(BLOCK_END(b), s, len); data/htslib-1.11/cram/cram_samtools.c:59:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char L[256] = { data/htslib-1.11/cram/cram_samtools.c:108:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (ncigar > 0) memcpy(cp, cigar, ncigar*4); data/htslib-1.11/cram/cram_samtools.c:118:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cp, qual, len); data/htslib-1.11/cram/cram_structs.h:184:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magic[4]; data/htslib-1.11/cram/cram_structs.h:187:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char file_id[20] HTS_NONSTRING; // Filename or SHA1 checksum data/htslib-1.11/cram/cram_structs.h:302:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char substitution_matrix[5][4]; data/htslib-1.11/cram/cram_structs.h:352:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char md5[16]; data/htslib-1.11/cram/cram_structs.h:741:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char L1[256]; // ACGT{*} ->0123{4} data/htslib-1.11/cram/cram_structs.h:742:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char L2[256]; // ACGTN{*}->01234{5} data/htslib-1.11/cram/cram_structs.h:743:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cram_sub_matrix[32][32]; // base substitution codes data/htslib-1.11/cram/mFILE.c:350:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, mode))) data/htslib-1.11/cram/mFILE.c:517: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(cptr, &mf->data[mf->offset], len); data/htslib-1.11/cram/mFILE.c:549: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(&mf->data[mf->offset], ptr, size * nmemb); data/htslib-1.11/cram/open_trace_file.c:385:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char relative_path[PATH_MAX+1]; data/htslib-1.11/cram/rANS_static.c:205:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char R[TOTFREQ]; data/htslib-1.11/cram/rANS_static.c:811:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char in_buf[BLK_SIZE2+257*257*3]; data/htslib-1.11/cram/rANS_static.c:823: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). order = atoi(optarg); data/htslib-1.11/cram/rANS_static.c:835: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). if (!(infp = fopen(argv[optind], "rb"))) { data/htslib-1.11/cram/rANS_static.c:843:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(outfp = fopen(argv[optind], "wb"))) { data/htslib-1.11/cram/string_alloc.c:158: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(str, instr, len); data/htslib-1.11/faidx.c:165:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[4] = { '"', c, '"', '\0' }; data/htslib-1.11/faidx.c:331:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[96]; // Must be big enough for format below. data/htslib-1.11/header.c:75:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrecs->type_order[0], "HD", 2); data/htslib-1.11/header.c:76:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrecs->type_order[1], "SQ", 2); data/htslib-1.11/header.c:77:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrecs->type_order[2], "RG", 2); data/htslib-1.11/header.c:78:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrecs->type_order[3], "PG", 2); data/htslib-1.11/header.c:79:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrecs->type_order[4], "CO", 2); data/htslib-1.11/header.c:188:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[32]; data/htslib-1.11/header.c:728:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c[2]= { ty->type >> 8, ty->type & 0xff }; data/htslib-1.11/header.c:1092:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char len[32]; data/htslib-1.11/header.c:1491:52: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. va_list ap, const char **old_name, data/htslib-1.11/header.c:1492:40: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char **new_name, data/htslib-1.11/header.c:1493:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char id_tag_out[3], data/htslib-1.11/header.c:1512: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(id_tag_out, id_tag, 3); data/htslib-1.11/header.c:1552:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char id_tag[3]; data/htslib-1.11/header.c:2233:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(end, hrecs->pg_end, nends * sizeof(*end)); data/htslib-1.11/header.c:2644:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c[2]; data/htslib-1.11/header.h:220:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char (*type_order)[3]; data/htslib-1.11/hfile.c:256:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer + copied, fp->begin, n); data/htslib-1.11/hfile.c:263:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer + copied, fp->begin, n); data/htslib-1.11/hfile.c:301:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, fp->begin, n); data/htslib-1.11/hfile.c:342:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest, fp->begin, n); data/htslib-1.11/hfile.c:410: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(fp->begin, src, remaining); data/htslib-1.11/hfile.c:621:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(filename, hfile_oflags(mode), 0666); data/htslib-1.11/hfile.c:1122:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char scheme[12]; data/htslib-1.11/hfile.c:1153:29: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return handler->open(fname, mode); data/htslib-1.11/hfile_internal.h:117:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). hFILE *(*open)(const char *filename, const char *mode) HTS_RESULT_USED; data/htslib-1.11/hfile_libcurl.c:499:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[16]; data/htslib-1.11/hfile_libcurl.c:754: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(fp->buffer.ptr.rd, ptr, n); data/htslib-1.11/hfile_libcurl.c:796:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, start, bytes); data/htslib-1.11/hfile_libcurl.c:874: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(ptr, fp->buffer.ptr.wr, n); data/htslib-1.11/hfile_libcurl.c:922: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(fp->preserved, fp->base.begin, fp->base.end - fp->base.begin); data/htslib-1.11/hfile_s3.c:54:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char date[40]; data/htslib-1.11/hfile_s3.c:55:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char date_long[17]; data/htslib-1.11/hfile_s3.c:56:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char date_short[9]; data/htslib-1.11/hfile_s3.c:59:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *headers[4]; data/htslib-1.11/hfile_s3.c:127:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[3]; data/htslib-1.11/hfile_s3.c:199:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(full_fname.s, mode); data/htslib-1.11/hfile_s3.c:203:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(fname, mode); data/htslib-1.11/hfile_s3.c:314:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char digest[DIGEST_BUFSIZ]; data/htslib-1.11/hfile_s3.c:377:13: [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(escaped + j, "%%%02X", c); data/htslib-1.11/hfile_s3.c:412:13: [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(escaped + j, "%%%02X", c); data/htslib-1.11/hfile_s3.c:635:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ad->bucket, url->s + url_path_pos, url->l - url_path_pos + 1); data/htslib-1.11/hfile_s3.c:643:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ad->bucket + 1, bucket, bucket_len); data/htslib-1.11/hfile_s3.c:644:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ad->bucket + bucket_len + 1, data/htslib-1.11/hfile_s3.c:668:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *header_list[4], **header = header_list; data/htslib-1.11/hfile_s3.c:710:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hashed[SHA256_DIGEST_BUFSIZE]; data/htslib-1.11/hfile_s3.c:716:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(out + j, "%02x", hashed[i]); data/htslib-1.11/hfile_s3.c:734:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char date_key[SHA256_DIGEST_BUFSIZE]; data/htslib-1.11/hfile_s3.c:735:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char date_region_key[SHA256_DIGEST_BUFSIZE]; data/htslib-1.11/hfile_s3.c:736:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char date_region_service_key[SHA256_DIGEST_BUFSIZE]; data/htslib-1.11/hfile_s3.c:737:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char signing_key[SHA256_DIGEST_BUFSIZE]; data/htslib-1.11/hfile_s3.c:738:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char signature[SHA256_DIGEST_BUFSIZE]; data/htslib-1.11/hfile_s3.c:760:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(signature_string + j, "%02x", signature[i]); data/htslib-1.11/hfile_s3.c:775:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cr_hash[HASH_LENGTH_SHA256]; data/htslib-1.11/hfile_s3.c:776:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char signature_string[HASH_LENGTH_SHA256]; data/htslib-1.11/hfile_s3.c:942:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char content_hash[HASH_LENGTH_SHA256]; data/htslib-1.11/hfile_s3.c:999:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char content_hash[HASH_LENGTH_SHA256]; data/htslib-1.11/hfile_s3.c:1058:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024], *region, *reg_end; data/htslib-1.11/hfile_s3.c:1120:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *header_list[4], **header = header_list; data/htslib-1.11/hfile_s3_write.c:364: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(ptr, fp->buffer.s + fp->index, read_length); data/htslib-1.11/hfile_s3_write.c:690: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(fp->au, auth, sizeof(s3_authorisation)); data/htslib-1.11/hfile_s3_write.c:701: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). int part_size = atoi(env) * 1024 * 1024; data/htslib-1.11/hts.c:74:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char seq_nt16_table[256] = { data/htslib-1.11/hts.c:149:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[2048]; data/htslib-1.11/hts.c:314:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char columns[24]; data/htslib-1.11/hts.c:315:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char s[1024]; data/htslib-1.11/hts.c:583:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char smode[101], *cp, *cp2, *mode_c; data/htslib-1.11/hts.c:720:49: [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). o->opt = CRAM_OPT_DECODE_MD, o->val.i = atoi(val); data/htslib-1.11/hts.c:724:49: [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). o->opt = CRAM_OPT_VERBOSITY, o->val.i = atoi(val); data/htslib-1.11/hts.c:728:54: [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). o->opt = CRAM_OPT_SEQS_PER_SLICE, o->val.i = atoi(val); data/htslib-1.11/hts.c:732:55: [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). o->opt = CRAM_OPT_BASES_PER_SLICE, o->val.i = atoi(val); data/htslib-1.11/hts.c:736:60: [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). o->opt = CRAM_OPT_SLICES_PER_CONTAINER, o->val.i = atoi(val); data/htslib-1.11/hts.c:740:49: [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). o->opt = CRAM_OPT_EMBED_REF, o->val.i = atoi(val); data/htslib-1.11/hts.c:744: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). o->opt = CRAM_OPT_NO_REF, o->val.i = atoi(val); data/htslib-1.11/hts.c:748:50: [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). o->opt = CRAM_OPT_IGNORE_MD5, o->val.i = atoi(val); data/htslib-1.11/hts.c:752:49: [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). o->opt = CRAM_OPT_USE_BZIP2, o->val.i = atoi(val); data/htslib-1.11/hts.c:756:48: [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). o->opt = CRAM_OPT_USE_RANS, o->val.i = atoi(val); data/htslib-1.11/hts.c:760:48: [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). o->opt = CRAM_OPT_USE_LZMA, o->val.i = atoi(val); data/htslib-1.11/hts.c:772:59: [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). o->opt = CRAM_OPT_MULTI_SEQ_PER_SLICE, o->val.i = atoi(val); data/htslib-1.11/hts.c:776:47: [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). o->opt = HTS_OPT_NTHREADS, o->val.i = atoi(val); data/htslib-1.11/hts.c:812:48: [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). o->opt = CRAM_OPT_STORE_MD, o->val.i = atoi(val); data/htslib-1.11/hts.c:816:48: [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). o->opt = CRAM_OPT_STORE_NM, o->val.i = atoi(val); data/htslib-1.11/hts.c:906:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char arg[8001]; data/htslib-1.11/hts.c:940:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fmt[8]; data/htslib-1.11/hts.c:1016:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fn_buf[512], *fn2 = fn_buf; data/htslib-1.11/hts.c:1045:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char simple_mode[101], *cp, *opts; data/htslib-1.11/hts.c:1820:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(q->list + q->n, p->list, p->n * sizeof(hts_pair64_t)); data/htslib-1.11/hts.c:2150: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. case HTS_FMT_BAI: strcat(fnidx, ".bai"); break; data/htslib-1.11/hts.c:2151: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. case HTS_FMT_CSI: strcat(fnidx, ".csi"); break; data/htslib-1.11/hts.c:2152: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. case HTS_FMT_TBI: strcat(fnidx, ".tbi"); break; data/htslib-1.11/hts.c:2301:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(idx->meta, &x[1*4], 28); data/htslib-1.11/hts.c:2340:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_meta, meta, l); data/htslib-1.11/hts_internal.h:129:45: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static inline int find_file_extension(const char *fn, char ext_out[static HTS_MAX_EXT_LEN]) data/htslib-1.11/hts_internal.h:129:55: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 inline int find_file_extension(const char *fn, char ext_out[static HTS_MAX_EXT_LEN]) data/htslib-1.11/hts_internal.h:142: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(ext_out, ext + 1, delim - ext - 1); data/htslib-1.11/htslib/hfile.h:229:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, fp->begin, n); data/htslib-1.11/htslib/hfile.h:254: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(fp->begin, text, n); data/htslib-1.11/htslib/hfile.h:286: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(fp->begin, buffer, n); data/htslib-1.11/htslib/hts.h:405:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern const unsigned char seq_nt16_table[256]; data/htslib-1.11/htslib/kseq.h:125: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/htslib-1.11/htslib/kstring.h:229: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/htslib-1.11/htslib/kstring.h:263: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/htslib-1.11/htslib/kstring.h:341:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&cp[j-=2], d, 2); data/htslib-1.11/htslib/kstring.h:368: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/htslib-1.11/htslib/sam.h:1559:45: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. uint8_t *bam_aux_get(const bam1_t *b, const char tag[2]); data/htslib-1.11/htslib/sam.h:1571:41: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char tag[2], data/htslib-1.11/htslib/sam.h:1660:37: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 bam_aux_append(bam1_t *b, const char tag[2], char type, int len, const uint8_t *data); data/htslib-1.11/htslib/sam.h:1700:41: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_str(bam1_t *b, const char tag[2], int len, const char *data); data/htslib-1.11/htslib/sam.h:1724:41: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_int(bam1_t *b, const char tag[2], int64_t val); data/htslib-1.11/htslib/sam.h:1744:43: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_float(bam1_t *b, const char tag[2], float val); data/htslib-1.11/htslib/sam.h:1783:43: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_array(bam1_t *b, const char tag[2], data/htslib-1.11/knetfile.c:186:26: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). server.sin_port = htons(atoi(port)); data/htslib-1.11/knetfile.c:261:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ftp->pasv_ip, v, 4 * sizeof(int)); data/htslib-1.11/knetfile.c:269:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host[80], port[10]; data/htslib-1.11/knetfile.c:274:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(host, "%d.%d.%d.%d", ftp->pasv_ip[0], ftp->pasv_ip[1], ftp->pasv_ip[2], ftp->pasv_ip[3]); data/htslib-1.11/knetfile.c:275:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(port, "%d", ftp->pasv_port); data/htslib-1.11/knetfile.c:352:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[32]; data/htslib-1.11/knetfile.c:354:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(tmp, "REST %lld\r\n", (long long)fp->offset); data/htslib-1.11/knetfile.c:356:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(tmp, "REST "); data/htslib-1.11/knetfile.c:358:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(tmp, "\r\n"); data/htslib-1.11/knetfile.c:423:28: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. if (fp->offset != 0) l += sprintf(buf + l, "Range: bytes=%lld-\r\n", (long long)fp->offset); data/htslib-1.11/knetfile.c:424:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. l += sprintf(buf + l, "\r\n"); data/htslib-1.11/knetfile.c:498:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(fn, O_RDONLY | O_BINARY); data/htslib-1.11/knetfile.c:500:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(fn, O_RDONLY); data/htslib-1.11/kstring.c:40: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[21], *cp = buf+20, *ep; data/htslib-1.11/kstring.c:60:12: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. int s2 = sprintf(s->s + s->l, "%g", d); data/htslib-1.11/md5.c:66: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 buffer[64]; data/htslib-1.11/md5.c:253: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(&ctx->buffer[used], data, size); data/htslib-1.11/md5.c:257: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(&ctx->buffer[used], data, available); data/htslib-1.11/md5.c:268: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(ctx->buffer, data, size); data/htslib-1.11/probaln.c:289: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 'b': b = atoi(optarg); break; data/htslib-1.11/probaln.c:290: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 'q': q = atoi(optarg); break; data/htslib-1.11/realn.c:208:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bq, qual, c->l_qseq); bq[c->l_qseq] = 0; data/htslib-1.11/regidx.c:189:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(list->dat + idx->payload_size*list->nreg, payload, idx->payload_size); data/htslib-1.11/regidx.c:349:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp_dat+i*regidx->payload_size, data/htslib-1.11/sam.c:209:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(h->text, h0->text, h->l_text); data/htslib-1.11/sam.c:424:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_data, b->data, data/htslib-1.11/sam.c:455: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(bdst->data, bsrc->data, bsrc->l_data); // copy var-len data data/htslib-1.11/sam.c:456: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(&bdst->core, &bsrc->core, sizeof(bsrc->core)); // copy the rest data/htslib-1.11/sam.c:545: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->data + cigar_st, b->data + (n_cigar4 - fake_bytes) + CG_st + 8, n_cigar4); // copy the real CIGAR to the right place; -fake_bytes for the fake CIGAR data/htslib-1.11/sam.c:785: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(rec->data, qname, new_len); data/htslib-1.11/sam.c:1452:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sn, line.s, tab-line.s); data/htslib-1.11/sam.c:1695:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[5] = { '\t', key[0], key[0] ? key[1] : '\0', ':', '\0' }; data/htslib-1.11/sam.c:1979:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char logbuf[40]; data/htslib-1.11/sam.c:1993: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->data + b->l_data, q, p-q); b->l_data += p-q; data/htslib-1.11/sam.c:1996: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->data + b->l_data, "\0\0\0\0", c->l_extranul); data/htslib-1.11/sam.c:2116:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(b->data + b->l_data, q, 2); b->l_data += 2; data/htslib-1.11/sam.c:2172:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(b->data + b->l_data, q, end - q); data/htslib-1.11/sam.c:2605:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(l->data, line.s, line_frag); data/htslib-1.11/sam.c:2647:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line.s, cp, cp_end - cp); data/htslib-1.11/sam.c:3283:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, len); data/htslib-1.11/sam.c:3290:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&v, in + i, sizeof(type_t)); \ data/htslib-1.11/sam.c:3304:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&n, in + 1, 4); data/htslib-1.11/sam.c:3320:37: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 bam_aux_append(bam1_t *b, const char tag[2], char type, int len, const uint8_t *data) data/htslib-1.11/sam.c:3335: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->data + b->l_data + 3, data, len); data/htslib-1.11/sam.c:3378:45: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. uint8_t *bam_aux_get(const bam1_t *b, const char tag[2]) data/htslib-1.11/sam.c:3430:41: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_str(bam1_t *b, const char tag[2], int len, const char *data) data/htslib-1.11/sam.c:3482:41: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_int(bam1_t *b, const char tag[2], int64_t val) data/htslib-1.11/sam.c:3536: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(s, &val, sz); data/htslib-1.11/sam.c:3548:43: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_float(bam1_t *b, const char tag[2], float val) data/htslib-1.11/sam.c:3584:43: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int bam_aux_update_array(bam1_t *b, const char tag[2], data/htslib-1.11/sam.c:3632: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(s + 6, data, new_sz); data/htslib-1.11/sam.c:3724:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char extension[HTS_MAX_EXT_LEN]; data/htslib-1.11/sam.c:3757:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char extension[HTS_MAX_EXT_LEN]; data/htslib-1.11/sam.c:3783: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. strcpy(cp, ",VERSION=2.1"); data/htslib-1.11/sam.c:3787: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. strcpy(cp, ",VERSION=3.0"); data/htslib-1.11/sam_internal.h:68:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char code2base[512] = data/htslib-1.11/sam_internal.h:91:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&seq[i*2], &code2base[(size_t)nib[i]*2], 2); data/htslib-1.11/synced_bcf_reader.c:227:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fmode[5]; data/htslib-1.11/tabix.c:410: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). FILE *hdr = fopen(header,"r"); data/htslib-1.11/tabix.c:586: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). int v = atoi(optarg); data/htslib-1.11/tabix.c:592:35: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). args.cache_megs = atoi(optarg); data/htslib-1.11/tbx.c:225:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(x, &tbx->conf, 24); data/htslib-1.11/tbx.c:239: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(meta, x, 28); data/htslib-1.11/tbx.c:242:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(meta + l, name[i], x); data/htslib-1.11/test/fuzz/hts_open_fuzzer.c:125:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(copy, data, size); data/htslib-1.11/test/hfile.c:66:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(filename, "rb"); data/htslib-1.11/test/hfile.c:100:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[40000]; data/htslib-1.11/test/hfile.c:179:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "test/hfile%d.tmp", i); data/htslib-1.11/test/hts_endian.c:150:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char str[64]; data/htslib-1.11/test/sam.c:122:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char target_id[2], int64_t target_val, data/htslib-1.11/test/sam.c:123:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char expected_type, data/htslib-1.11/test/sam.c:124:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char next_id[2], int64_t next_val, data/htslib-1.11/test/sam.c:177:49: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static int test_update_array(bam1_t *aln, const char target_id[2], data/htslib-1.11/test/sam.c:179:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char next_id[2], int64_t next_val, data/htslib-1.11/test/sam.c:691:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[sizeof(expected) + 1024]; data/htslib-1.11/test/sam.c:848:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). inf = fopen(outfname, "r"); data/htslib-1.11/test/sam.c:1317:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[sizeof(sam_text) + 1024]; data/htslib-1.11/test/sam.c:1424:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). inf = fopen(outfname, "r"); data/htslib-1.11/test/sam.c:1456:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpfilename[FILENAME_MAX], line[500]; data/htslib-1.11/test/sam.c:1460:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fin = fopen(filename, "rb"); data/htslib-1.11/test/sam.c:1463: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). fout = fopen(tmpfilename, "wb"); data/htslib-1.11/test/sam.c:1561:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(name, "w"); data/htslib-1.11/test/sam.c:1563:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char qual[101]; data/htslib-1.11/test/test-regidx.c:96:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*dat,ss,se-ss+1); data/htslib-1.11/test/test-regidx.c:327:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[250], *chr = "1"; data/htslib-1.11/test/test-regidx.c:441:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 's': seed = atoi(optarg); break; data/htslib-1.11/test/test-vcf-api.c:115: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. const char *alleles[2] = { "G", "A" }; data/htslib-1.11/test/test-vcf-api.c:537:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mode[5]; data/htslib-1.11/test/test_bgzf.c:68:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(name, mode); data/htslib-1.11/test/test_bgzf.c:122:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(name, hfile_oflags(mode), 0666); data/htslib-1.11/test/test_bgzf.c:399:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bg_buf[BUFSZ], f_buf[BUFSZ]; data/htslib-1.11/test/test_bgzf.c:432:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bg_buf[BUFSZ]; data/htslib-1.11/test/test_bgzf.c:507:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char append_mode[16]; data/htslib-1.11/test/test_bgzf.c:508:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bg_buf[BUFSZ]; data/htslib-1.11/test/test_bgzf.c:579:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf_src[BUFSZ], buf_dest[BUFSZ]; data/htslib-1.11/test/test_index.c:49: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 'm': min_shift = atoi(optarg); break; data/htslib-1.11/test/test_realn.c:49:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char modew[8] = "w"; data/htslib-1.11/test/test_str2int.c:42:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[64], *end; data/htslib-1.11/test/test_str2int.c:144:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/htslib-1.11/test/test_view.c:279:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char moder[8]; data/htslib-1.11/test/test_view.c:280:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char modew[800]; data/htslib-1.11/test/test_view.c:309:33: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'l': opts.clevel = atoi(optarg); break; data/htslib-1.11/test/test_view.c:311:33: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'N': opts.nreads = atoi(optarg); break; data/htslib-1.11/test/test_view.c:313:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'Z': opts.extra_hdr_nuls = atoi(optarg); break; data/htslib-1.11/test/test_view.c:315: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 '@': opts.nthreads = atoi(optarg); break; data/htslib-1.11/test/test_view.c:317:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'm': opts.min_shift = atoi(optarg); break; data/htslib-1.11/test/test_view.c:360:47: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. if (opts.clevel >= 0 && opts.clevel <= 9) sprintf(modew + 1, "%d", opts.clevel); data/htslib-1.11/test/test_view.c:364:46: [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. else if (opts.flag & WRITE_UNCOMPRESSED) strcat(modew, "bu"); data/htslib-1.11/test/thrash_threads3.c:34:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1000000]; data/htslib-1.11/test/thrash_threads4.c:42:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[65536]; data/htslib-1.11/test/thrash_threads5.c:36:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[N]; data/htslib-1.11/test/thrash_threads5.c:48: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). p = hts_tpool_init(atoi(argv[2])); data/htslib-1.11/test/thrash_threads6.c:44:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100000]; data/htslib-1.11/textutils.c:184: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. char buf[8]; data/htslib-1.11/textutils.c:480:13: [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(t, "..."); data/htslib-1.11/textutils.c:485:13: [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(t, "\\x%02X", (unsigned char) c); data/htslib-1.11/thread_pool.c:1501:9: [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). n = atoi(argv[2]); data/htslib-1.11/vcf.c:111: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(sdup, s, len); data/htslib-1.11/vcf.c:294: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(hrec->keys[hrec->nkeys],str,len); data/htslib-1.11/vcf.c:317:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&hrec->vals[i][1],str,len); data/htslib-1.11/vcf.c:329:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrec->vals[i],str,len); data/htslib-1.11/vcf.c:391:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrec->key,p,n); data/htslib-1.11/vcf.c:400:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hrec->value, p, q-p); data/htslib-1.11/vcf.c:456:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[320]; data/htslib-1.11/vcf.c:472:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[320]; data/htslib-1.11/vcf.c:853: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. char buffer[320]; data/htslib-1.11/vcf.c:968:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[256], *line = tmp; data/htslib-1.11/vcf.c:1313: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. const char *types[9] = { data/htslib-1.11/vcf.c:1757:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst->shared.s,src->shared.s,dst->shared.l); data/htslib-1.11/vcf.c:1765:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst->indiv.s,src->indiv.s,dst->indiv.l); data/htslib-1.11/vcf.c:1890:29: [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). e |= (kputl(atol(tab), &txt) < 0); data/htslib-1.11/vcf.c:2541: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. char buffer[8]; data/htslib-1.11/vcf.c:2957:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char extension[HTS_MAX_EXT_LEN]; data/htslib-1.11/vcf.c:4162:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, str.s, str.l); data/htslib-1.11/vcf.c:4320:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, str.s, str.l); data/htslib-1.11/vcf.c:4581:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*dst,info->vptr,info->len); data/htslib-1.11/vcf.c:4675:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp,src,fmt->n); data/htslib-1.11/vcf.c:4710:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*dst,fmt->p,n); data/htslib-1.11/vcf_sweep.c:83: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(sw->lals, rec->d.allele[0], len); data/htslib-1.11/vcfutils.c:441: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. if ( is_vector_end ) { memcpy(dat+k*size, dat+j*size, size); break; } \ data/htslib-1.11/vcfutils.c:443:33: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if ( j!=k ) memcpy(dat+k*size, dat+j*size, size); \ data/htslib-1.11/vcfutils.c:474:48: [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 ( is_vector_end ) { memcpy(dat+l_new*size, dat+l_ori*size, size); break; } \ data/htslib-1.11/vcfutils.c:476: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. if ( l_ori!=l_new ) memcpy(dat+l_new*size, dat+l_ori*size, size); \ data/htslib-1.11/vcfutils.c:745:48: [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 ( is_vector_end ) { memcpy(ptr_dst+k_dst, ptr_src+k_src, size); break; } \ data/htslib-1.11/vcfutils.c:747:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr_dst+k_dst, ptr_src+k_src, size); \ data/htslib-1.11/vcfutils.c:784:29: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr_dst+k_dst, ptr_src+k_src, size); \ data/htslib-1.11/vcfutils.c:787:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr_dst+k_dst, ptr_src+k_src, size); \ data/htslib-1.11/vcfutils.c:797:56: [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 ( is_vector_end ) { memcpy(ptr_dst+k_dst, ptr_src+k_src, size); ia = nR_ori; break; } \ data/htslib-1.11/vcfutils.c:799:33: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr_dst+k_dst, ptr_src+k_src, size); \ data/htslib-1.11/bcf_sr_sort.c:108: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). int alen = strlen(avar->str); data/htslib-1.11/bcf_sr_sort.c:109: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). int blen = strlen(bvar->str); data/htslib-1.11/bcf_sr_sort.c:314:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(srt->charp[i]); data/htslib-1.11/bgzf.c:1836:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); // FIXME: replace by condition variable data/htslib-1.11/bgzf.c:2282:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(bname) + strlen(suffix) + 1; data/htslib-1.11/bgzf.c:2282:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(bname) + strlen(suffix) + 1; data/htslib-1.11/bgzip.c:210: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). char *name = malloc(strlen(argv[optind]) + 5); data/htslib-1.11/bgzip.c:257:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = read(f_src, buffer, WINDOW_SIZE)) > 0) data/htslib-1.11/bgzip.c:261:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = read(f_src, buffer, WINDOW_SIZE)) > 0) data/htslib-1.11/bgzip.c:336: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). for (pos = strlen(name); pos > 0; --pos) data/htslib-1.11/cram/cram_codecs.c:477:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(prefix); data/htslib-1.11/cram/cram_codecs.c:632:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(prefix); data/htslib-1.11/cram/cram_codecs.c:1398:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(prefix); data/htslib-1.11/cram/cram_codecs.c:1746:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(prefix); data/htslib-1.11/cram/cram_codecs.c:1969:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(prefix); data/htslib-1.11/cram/cram_decode.c:1938:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cr->ntags = strlen((char *)TN)/3; // optimise to remove strlen data/htslib-1.11/cram/cram_decode.c:2856:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name_len = strlen(fd->prefix); data/htslib-1.11/cram/cram_index.c:631: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 (bgzf_write(fp, buf, strlen(buf)) < 0) data/htslib-1.11/cram/cram_index.c:644:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (bgzf_write(fp, buf, strlen(buf)) < 0) data/htslib-1.11/cram/cram_index.c:676:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = (bgzf_write(fp, buf, strlen(buf)) >= 0)? 0 : -4; data/htslib-1.11/cram/cram_io.c:1803: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). size_t fn_l = strlen(fn); data/htslib-1.11/cram/cram_io.c:1822: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). fn_delim += strlen(HTS_IDX_DELIM); data/htslib-1.11/cram/cram_io.c:2141:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, dir, cp-dir); data/htslib-1.11/cram/cram_io.c:2146: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). len = strlen(fn); data/htslib-1.11/cram/cram_io.c:2158:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = MIN(l, strlen(fn)); data/htslib-1.11/cram/cram_io.c:2161:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, fn, l); data/htslib-1.11/cram/cram_io.c:2180: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). len = strlen(dir); data/htslib-1.11/cram/cram_io.c:2186: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). len = strlen(fn) + ((*fn && path > start && path[-1] != '/') ? 1 : 0); data/htslib-1.11/cram/cram_io.c:3544:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); data/htslib-1.11/cram/cram_io.c:4068: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). size_t in_l = strlen(in); data/htslib-1.11/cram/cram_io.c:4074:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out, in, PATH_MAX-1); data/htslib-1.11/cram/cram_io.c:4082:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out, in, PATH_MAX-1); data/htslib-1.11/cram/cram_io.c:4089:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (len = strlen(out))+1+strlen(in) >= PATH_MAX) { data/htslib-1.11/cram/cram_io.c:4089:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (len = strlen(out))+1+strlen(in) >= PATH_MAX) { data/htslib-1.11/cram/cram_io.c:4090:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out, in, PATH_MAX-1); data/htslib-1.11/cram/cram_io.c:4406:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(mode) > 1 && (mode[1] == 'b' || mode[1] == 'c')) { data/htslib-1.11/cram/cram_io.c:4475:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(def->file_id, filename, 20); data/htslib-1.11/cram/cram_samtools.c:104:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *)cp, qname, qname_len); data/htslib-1.11/cram/open_trace_file.c:117:39: [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). newsearch = (char *)malloc((len = strlen(searchpath))+5); data/htslib-1.11/cram/open_trace_file.c:230:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(dirname); data/htslib-1.11/cram/open_trace_file.c:231: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). size_t lenf = strlen(file); data/htslib-1.11/cram/open_trace_file.c:254:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path_end, dirname, (endp+1)-dirname); data/htslib-1.11/cram/open_trace_file.c:260:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path_end, dirname, cp-dirname); data/htslib-1.11/cram/open_trace_file.c:263:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path_end, file, l); data/htslib-1.11/cram/open_trace_file.c:264:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). path_end += MIN(strlen(file), l); data/htslib-1.11/cram/open_trace_file.c:265:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file += MIN(strlen(file), l); data/htslib-1.11/cram/open_trace_file.c:268: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). path_end += strlen(file); data/htslib-1.11/cram/open_trace_file.c:269: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). file += strlen(file); data/htslib-1.11/cram/open_trace_file.c:274:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path_end, dirname, len); data/htslib-1.11/cram/open_trace_file.c:275:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). path_end += MIN(strlen(dirname), len); data/htslib-1.11/cram/open_trace_file.c:346:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (ele = newsearch; *ele; ele += strlen(ele)+1) { data/htslib-1.11/cram/open_trace_file.c:416:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (ele = newsearch; *ele; ele += strlen(ele)+1) { data/htslib-1.11/cram/string_alloc.c:150:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return string_ndup(a_str, instr, strlen(instr)); data/htslib-1.11/faidx.c:929:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fai_tmp += strlen(HTS_IDX_DELIM); data/htslib-1.11/header.c:595:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). h_tag->len = 3 + strlen(val); data/htslib-1.11/header.c:601:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). h_tag->len = strlen(key); data/htslib-1.11/header.c:630:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). h_tag->len = 3 + strlen(val); data/htslib-1.11/header.c:636:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). h_tag->len = strlen(key); data/htslib-1.11/header.c:766:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(hdr); data/htslib-1.11/header.c:2140: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). name_len = strlen(name); data/htslib-1.11/header.c:2525:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tag->len = 3 + strlen(v); data/htslib-1.11/hfile.c:184:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = fp->backend->read(fp, fp->end, fp->limit - fp->end); data/htslib-1.11/hfile.c:317:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = fp->backend->read(fp, dest, nbytes); data/htslib-1.11/hfile.c:536:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). : read(fp->fd, buffer, nbytes); data/htslib-1.11/hfile.c:807:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = hts_base64_decoded_length(strlen(data)); data/htslib-1.11/hfile.c:813: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). size = strlen(data) + 1; data/htslib-1.11/hfile_internal.h:69:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t (*read)(hFILE *fp, void *buffer, size_t nbytes) HTS_RESULT_USED; data/htslib-1.11/hfile_s3.c:364:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). length = strlen(qs); data/htslib-1.11/hfile_s3.c:397:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). length = strlen(path); data/htslib-1.11/hfile_s3.c:465: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). new_region += strlen("x-amz-bucket-region: "); data/htslib-1.11/hfile_s3.c:482:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). kputsn(ad->bucket, strlen(ad->bucket), url); data/htslib-1.11/hfile_s3.c:753:101: [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). s3_sign_sha256(secret_access_key.s, secret_access_key.l, (const unsigned char *)ad->date_short, strlen(ad->date_short), date_key, &len); data/htslib-1.11/hfile_s3_write.c:176:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). start += strlen(start_tag); data/htslib-1.11/hts.c:589:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(smode, mode, 99); data/htslib-1.11/hts.c:915:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg, str_start, len < 8000 ? len : 8000); data/htslib-1.11/hts.c:1018:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t fn2_len = strlen(prefix) + strlen(fn) + 1; data/htslib-1.11/hts.c:1018:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t fn2_len = strlen(prefix) + strlen(fn) + 1; data/htslib-1.11/hts.c:1055:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(simple_mode, mode, cp-mode <= 100 ? cp-mode : 100); data/htslib-1.11/hts.c:1059:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(simple_mode, mode, 100); data/htslib-1.11/hts.c:1509:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s[n++], q, p - q); data/htslib-1.11/hts.c:1561:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s[n++], q, p - q); data/htslib-1.11/hts.c:1586:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(fname); data/htslib-1.11/hts.c:1991:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uint32_t len = strlen(name)+1; data/htslib-1.11/hts.c:2145:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *fnidx = (char*)calloc(1, strlen(fn) + 5); data/htslib-1.11/hts.c:3059:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t s_len = strlen(s); data/htslib-1.11/hts.c:3215:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return s + strlen(s); data/htslib-1.11/hts.c:3772:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *local_len = strlen(fn); data/htslib-1.11/hts.c:3808:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (i = strlen(fn) - 1; i >= 0; --i) data/htslib-1.11/hts.c:3827: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). l_fn = strlen(fn_tmp); l_ext = 5; data/htslib-1.11/hts.c:3963:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fnidx += strlen(HTS_IDX_DELIM); data/htslib-1.11/hts_internal.h:133:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!delim) delim = fn + strlen(fn); data/htslib-1.11/htslib/hfile.h:252: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). size_t nbytes = strlen(text), n = fp->limit - fp->begin; data/htslib-1.11/htslib/knetfile.h:37:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define netread(fd, ptr, len) read(fd, ptr, len) data/htslib-1.11/htslib/kstring.h:238: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/htslib-1.11/knetfile.c:247:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(cmd); data/htslib-1.11/knetfile.c:321:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fp->host, fn + 6, l); data/htslib-1.11/knetfile.c:322:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fp->retr = (char*)calloc(strlen(p) + 8, 1); data/htslib-1.11/knetfile.c:324:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fp->size_cmd = (char*)calloc(strlen(p) + 8, 1); data/htslib-1.11/knetfile.c:391:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fp->http_host, fn + 7, l); data/htslib-1.11/knetfile.c:544:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). curr = read(fp->fd, (void*)((char*)buf + l), rest); data/htslib-1.11/kstring.c:137: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). int sl = strlen(cp); data/htslib-1.11/kstring.c:211:6: [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 = strlen(s); data/htslib-1.11/kstring.c:263: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). s->l += strlen(s->s + s->l); data/htslib-1.11/kstring.c:384: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). return (char*)kmemmem(str, strlen(str), pat, strlen(pat), _prep); data/htslib-1.11/kstring.c:384:47: [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 (char*)kmemmem(str, strlen(str), pat, strlen(pat), _prep); data/htslib-1.11/kstring.c:389: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). return (char*)kmemmem(str, n, pat, strlen(pat), _prep); data/htslib-1.11/multipart.c:84:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strlen(p->url) > 120)? "..." : ""); data/htslib-1.11/multipart.c:98:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fp->currentfp->backend->read(fp->currentfp, buffer, nbytes) data/htslib-1.11/plugin.c:77:54: [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). else itr->suffix = PLUGIN_EXT, itr->suffix_len = strlen(PLUGIN_EXT); data/htslib-1.11/plugin.c:109:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t d_name_len = strlen(e->d_name); data/htslib-1.11/probaln.c:301:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l_ref = strlen((char*)ref); l_query = strlen((char*)query); data/htslib-1.11/probaln.c:301: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). l_ref = strlen((char*)ref); l_query = strlen((char*)query); data/htslib-1.11/realn.c:98:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (b->core.l_qseq != strlen((const char *) tg + 1)) { data/htslib-1.11/regidx.c:251:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(fname); data/htslib-1.11/sam.c:376:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name_len = strlen(p) + 1; data/htslib-1.11/sam.c:773:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t new_len = strlen(qname) + 1; data/htslib-1.11/sam.c:1355:21: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sn, q, r - q); data/htslib-1.11/sam.c:1435:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fai_fn = fn_delim + strlen(HTS_IDX_DELIM); data/htslib-1.11/sam.c:1706:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && strlen(val) == end - beg - 4) data/htslib-1.11/sam.c:1717: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 (new_l_text > SIZE_MAX - strlen(SAM_FORMAT_VERSION) - 9) data/htslib-1.11/sam.c:1719: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). new_l_text += strlen(SAM_FORMAT_VERSION) + 8; data/htslib-1.11/sam.c:1721:41: [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 (new_l_text > SIZE_MAX - strlen(val) - 5) data/htslib-1.11/sam.c:1723:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). new_l_text += strlen(val) + 4; data/htslib-1.11/sam.c:1737:41: [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 (new_l_text > SIZE_MAX - strlen(val) - 5) data/htslib-1.11/sam.c:1739:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). new_l_text += strlen(val) + 4; data/htslib-1.11/sam.c:2167:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!end) end = q + strlen(q); data/htslib-1.11/sam.c:2349:21: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); data/htslib-1.11/sam.c:2369:21: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); data/htslib-1.11/sam.c:3433:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t ln = len >= 0 ? len : strlen(data) + 1; data/htslib-1.11/sam.c:3728:46: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "bam") == 0) strcpy(mode, "b"); data/htslib-1.11/sam.c:3729:47: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "cram") == 0) strcpy(mode, "c"); data/htslib-1.11/sam.c:3730:46: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "sam") == 0) strcpy(mode, ""); data/htslib-1.11/sam.c:3731:49: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "sam.gz") == 0) strcpy(mode, "z"); data/htslib-1.11/sam.c:3744:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *mode_opts = malloc((format ? strlen(format) : 1) + data/htslib-1.11/sam.c:3745:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (mode ? strlen(mode) : 1) + 12); data/htslib-1.11/sam.c:3753:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cp = mode_opts + strlen(mode_opts); data/htslib-1.11/sam.c:3774:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). format_len = strlen(format); data/htslib-1.11/sam.c:3803:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define STRNCMP(a,b,n) (strncasecmp((a),(b),(n)) || strlen(a)!=(n)) data/htslib-1.11/synced_bcf_reader.c:228:5: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(fmode, "r"); data/htslib-1.11/synced_bcf_reader.c:1073:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(regions); data/htslib-1.11/tabix.c:97:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int l = strlen(fname); data/htslib-1.11/tabix.c:655:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *idx_fname = calloc(strlen(fname) + 6, 1); data/htslib-1.11/tbx.c:231:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l += strlen(kh_key(d, k)) + 1; // +1 to include '\0' data/htslib-1.11/tbx.c:241:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int x = strlen(name[i]) + 1; data/htslib-1.11/tbx.c:422:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (; p - nm < l_nm; p += strlen(p) + 1) { data/htslib-1.11/test/hfile.c:141:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(buffer); data/htslib-1.11/test/sam.c:298: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). bam_aux_update_str(aln,"XZ",strlen(NEW_HELLO)+1,NEW_HELLO); data/htslib-1.11/test/sam.c:304: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). bam_aux_update_str(aln,"XZ",strlen(NEW_HELLO2), NEW_HELLO2); data/htslib-1.11/test/sam.c:469: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). bam_aux_update_str(aln,"oo",strlen(hose) + 1,hose); data/htslib-1.11/test/sam.c:476: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). bam_aux_update_str(aln,"Za",strlen(HELLO),HELLO); data/htslib-1.11/test/sam.c:480: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). bam_aux_update_str(aln,"Zb",strlen(NEW_HELLO2)+1,NEW_HELLO2); data/htslib-1.11/test/sam.c:1547:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (n_neg + strlen(BAM_CIGAR_STR) != 256) data/htslib-1.11/test/test-vcf-api.c:232: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). char *gz_fname = (char*) malloc(strlen(fname)+4); data/htslib-1.11/test/test-vcf-api.c:234: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). snprintf(gz_fname,strlen(fname)+4,"%s.gz",fname); data/htslib-1.11/test/test-vcf-api.c:539:5: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(mode, "r"); data/htslib-1.11/test/test_bgzf.c:351: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). size_t len = (strlen(src) + strlen(bgzf_suffix) + strlen(idx_suffix) data/htslib-1.11/test/test_bgzf.c:351:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = (strlen(src) + strlen(bgzf_suffix) + strlen(idx_suffix) data/htslib-1.11/test/test_bgzf.c:351:55: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = (strlen(src) + strlen(bgzf_suffix) + strlen(idx_suffix) data/htslib-1.11/test/test_bgzf.c:352: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). + strlen(tmp_suffix) + 8); data/htslib-1.11/test/test_view.c:349:5: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(moder, "r"); data/htslib-1.11/test/test_view.c:350:32: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if (opts.flag & READ_CRAM) strcat(moder, "c"); data/htslib-1.11/test/test_view.c:351:50: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. else if ((opts.flag & READ_COMPRESSED) == 0) strcat(moder, "b"); data/htslib-1.11/test/test_view.c:359:5: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(modew, "w"); data/htslib-1.11/test/test_view.c:361:33: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if (opts.flag & WRITE_CRAM) strcat(modew, "c"); data/htslib-1.11/test/test_view.c:362:45: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. else if (opts.flag & WRITE_BINARY_COMP) strcat(modew, "b"); data/htslib-1.11/test/test_view.c:363:44: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. else if (opts.flag & WRITE_COMPRESSED) strcat(modew, "z"); data/htslib-1.11/test/thrash_threads4.c:57:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(N); data/htslib-1.11/test/thrash_threads4.c:61:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(N); data/htslib-1.11/test/thrash_threads6.c:94:17: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(N); data/htslib-1.11/test/thrash_threads7.c:45:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(*usecs); data/htslib-1.11/textutils.c:427: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). nbytes += strlen(argv[i]); data/htslib-1.11/thread_pool.c:1144:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(random() % 100000); // to coerce job completion out of order data/htslib-1.11/thread_pool.c:1185:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(500000 * ((job&31)==31) + random() % 10000); data/htslib-1.11/thread_pool.c:1231:17: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); data/htslib-1.11/thread_pool.c:1382:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(random() % 10000); // fast job data/htslib-1.11/thread_pool.c:1408:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(random() % 100000); // slow job data/htslib-1.11/thread_pool.c:1433:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(random() % 10000); // fast job data/htslib-1.11/vcf.c:97:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (len == 0) len = strlen(s); data/htslib-1.11/vcf.c:1547:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return bcf_enc_vchar(str, strlen(line->d.id), line->d.id); data/htslib-1.11/vcf.c:1557:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (bcf_enc_vchar(str, strlen(line->d.allele[i]), line->d.allele[i]) < 0) data/htslib-1.11/vcf.c:1560:55: [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 ( !line->rlen && line->n_allele ) line->rlen = strlen(line->d.allele[0]); data/htslib-1.11/vcf.c:1642:63: [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 ( !line->rlen && line->n_allele ) line->rlen = strlen(line->d.allele[0]); data/htslib-1.11/vcf.c:1842:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (bcf_hrec_add_key(hrec, "ID", strlen("ID")) < 0) goto fail; data/htslib-1.11/vcf.c:1843:53: [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 (bcf_hrec_set_val(hrec, hrec->nkeys-1, name, strlen(name), 0) < 0) data/htslib-1.11/vcf.c:2961:46: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "bcf") == 0) strcpy(mode, "b"); data/htslib-1.11/vcf.c:2962:46: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "vcf") == 0) strcpy(mode, ""); data/htslib-1.11/vcf.c:2963:87: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. else if (strcasecmp(format, "vcf.gz") == 0 || strcasecmp(format, "vcf.bgz") == 0) strcpy(mode, "z"); data/htslib-1.11/vcf.c:4092: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). line->rlen = line->n_allele ? strlen(line->d.allele[0]) : 0; data/htslib-1.11/vcf.c:4136:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bcf_enc_vchar(&str, strlen((char*)values), (char*)values); data/htslib-1.11/vcf.c:4200:47: [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). line->rlen = line->n_allele ? strlen(line->d.allele[0]) : 0; data/htslib-1.11/vcf.c:4217:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(values[i]); data/htslib-1.11/vcf.c:4427:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line->rlen = strlen(line->d.allele[0]); data/htslib-1.11/vcf.c:4501:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(id); data/htslib-1.11/vcf.c:4511:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp.l = strlen(line->d.id); ANALYSIS SUMMARY: Hits = 703 Lines analyzed = 78285 in approximately 2.56 seconds (30549 lines/second) Physical Source Lines of Code (SLOC) = 53240 Hits@level = [0] 481 [1] 194 [2] 381 [3] 57 [4] 68 [5] 3 Hits@level+ = [0+] 1184 [1+] 703 [2+] 509 [3+] 128 [4+] 71 [5+] 3 Hits/KSLOC@level+ = [0+] 22.2389 [1+] 13.2044 [2+] 9.56048 [3+] 2.40421 [4+] 1.33358 [5+] 0.0563486 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.