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/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_aux.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_endian.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_plbuf.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_plbuf.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_opts.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_opts.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_utils.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/samtools.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/version.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/R_init_Rhtslib.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bcf_sr_sort.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bcf_sr_sort.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/config.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_external.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_stats.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_stats.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/files.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/mFILE.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/mFILE.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/misc.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/os.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/pooled_alloc.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/pooled_alloc.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_byte.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/string_alloc.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/string_alloc.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/errmod.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/faidx.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_gcs.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_internal.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_net.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts_internal.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts_os.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htsfile.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/bgzf.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/cram.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/faidx.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hfile.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_defs.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_endian.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_log.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kbitset.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kfunc.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/khash.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/khash_str2int.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/klist.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/knetfile.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kseq.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/ksort.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/regidx.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/sam.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/synced_bcf_reader.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/tbx.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/thread_pool.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/vcf.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/vcf_sweep.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/vcfutils.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kfunc.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/md5.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/multipart.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/os/lzma_stub.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/os/rand.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/plugin.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/probaln.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/realn.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/regidx.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/synced_bcf_reader.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/fieldarith.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hfile.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hts_endian.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-bcf-sr.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-bcf-translate.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-regidx.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-vcf-api.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-vcf-sweep.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads1.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads2.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads3.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads4.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads5.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads6.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/textutils.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/textutils_internal.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool_internal.h Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf_sweep.c Examining data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c FINAL RESULTS: data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1965:2: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1972: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2216:15: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (0 == chmod(path_tmp, 0444)) data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1941:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s.%.4d.bam", w->prefix, w->index); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2191:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fns[i], "%s.%.4d.bam", prefix, i); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2229:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fnout, "%s.bam", prefix); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.c:134: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(fn_list, fn_ref), ".fai"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.c:135:9: [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(fn_list, R_OK) == -1) { // fn_list is unreadable data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.c:136: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(fn_ref, R_OK) == -1) { data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_opts.c:69:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ref, "reference=%s", optarg); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_utils.c:41: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/r-bioc-rhtslib-1.22.0+dfsg/inst/include/samtools.h:32:56: [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 CHECK_PRINTF(fmt,args) __attribute__ ((format (printf, fmt, args))) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:166: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1590:6: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1917:6: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1943: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1947: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2178:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path_tmp, "%s.tmp_%d_%u_%u", path, pid, thrid, t); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/misc.h:94:60: [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 __PRINTF_FORMAT__(a,b) __attribute__ ((format (printf, a, b))) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:176:19: [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). cp += strlen(strcpy(cp, file)); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:224:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s", file); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:246:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path_end, file); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:258:6: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:362:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(relative_path, relative_to); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/os.h:198: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:249: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1694: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2828: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); strcpy(fnidx + l_fn, ext); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2828:24: [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); strcpy(fnidx + l_fn, ext); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2834: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(fnidx + i, ext); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2960: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htsfile.c:53:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, args); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_defs.h:87: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_log.h:72:12: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. HTS_FORMAT(printf, 3, 4); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:316: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:318: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:415: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:165: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:178: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); /* H.P. */ data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1928: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1969: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:56: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:506: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:506: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hfile.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, args); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c:52: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c:332:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmpfilename, "%s.tmp", filename); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-bcf-sr.c:40: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-regidx.c:39: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:59:12: [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. return vfprintf(fp, fmt, args); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:780:13: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int n = vsnprintf(NULL, 0, fmt, ap) + 2; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:785:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(line, n, fmt, ap); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:540: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, "h:o:b:")) >= 0) { data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:370:43: [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. ksprintf(dest, "%s-%0lX", prefix, lrand48()); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1537:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "h:nru1R:f@:l:cps:b:O:t:", lopts, NULL)) >= 0) { data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2282:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "l:m:no:O:T:@:t:", lopts, NULL)) >= 0) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:118: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:gr",loptions,NULL)) >= 0){ data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1985: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1988: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1991: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1994: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2021: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2026: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:314: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. path = getenv("RAWDATA"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:388: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. path = getenv("RAWDATA"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c:801: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_gcs.c:76: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:1152: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:1366: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:1379: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:154: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:358: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:359: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:360: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:362: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:363: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:368: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts_os.c:34: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts_os.c:35: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts_os.c:36: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htsfile.c:200: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, "chHv?", options, NULL)) >= 0) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h:37: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h:38: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h:39: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h:55: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h:55: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts_os.h:56: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:389: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/probaln.c:260: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:398: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:", loptions,NULL)) >= 0) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-bcf-sr.c:64: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:64: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:bCl:o:N:BZ:@:M")) >= 0) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1007: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1048: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1245: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1271: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1296: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1352: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/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.c:123: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. static char LB_text[1024]; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.c:235: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(cigar, new_cigar, l * 4); // set CIGAR data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.h:523:62: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 uint8_t *bam_aux_get_core(bam1_t *b, const char tag[2]) { return bam_aux_get(b, tag); } // an alias of bam_aux_get() data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_aux.c:69: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(name, str, name_lim - str); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:305: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 vers[100]; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:306:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(vers, "%d.%d", vers_maj, vers_min); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:486: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(ebuf,ebuf+len,diff); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:487: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(ebuf+diff,buf,len); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:493: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(ebuf,buf+len,es); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:567:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(infns+infns_size, fns_read, nfns * sizeof(char*)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:584: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(infns + infns_size, argv + optind, nargv_fns * sizeof(char*)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.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(target_iter, pattern, 4); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:83: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(target_iter, pattern, size%4); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:96:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char g_sort_tag[2] = {0,0}; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:893: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(*text, ks_str(ks), ks_len(ks)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1297: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, reg, name_lim - reg); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1487: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[12]; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1488:5: [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(mode, "wb"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1547:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'l': level = atoi(optarg); break; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1550:33: [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': random_seed = atol(optarg); break; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1559: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(fn+fn_size, fn_read, nfiles * sizeof(char*)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1583:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(argv[optind], "rb"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1596: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(fn+fn_size, argv + (optind+1), nargcfiles * sizeof(char*)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1603:5: [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(mode, "wb"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1605:21: [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 (level >= 0) sprintf(strchr(mode, '\0'), "%d", level < 9? level : 9); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2130: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. buf[k].bam_record->data = (uint8_t *)((char *)buf[k].bam_record + sizeof(bam1_t)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2131: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(buf[k].bam_record->data, b->data, b->l_data); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2296:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'l': level = atoi(optarg); break; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2326:5: [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(modeout, "wb"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2328:21: [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 (level >= 0) sprintf(strchr(modeout, '\0'), "%d", level < 9? level : 9); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2346: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 dummy[4]; data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.c:134:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(strcpy(fn_list, fn_ref), ".fai"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:43:48: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void *sam_header2key_val(void *iter, const char type[2], const char key_tag[2], const char value_tag[2], const char **key, const char **value); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:43:68: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void *sam_header2key_val(void *iter, const char type[2], const char key_tag[2], const char value_tag[2], const char **key, const char **value); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:43:91: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void *sam_header2key_val(void *iter, const char type[2], const char key_tag[2], const char value_tag[2], const char **key, const char **value); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h: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 **sam_header2list(const void *_dict, char type[2], char key_tag[2], int *_n); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:44:47: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char **sam_header2list(const void *_dict, char type[2], char key_tag[2], int *_n); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:44:61: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 **sam_header2list(const void *_dict, char type[2], char key_tag[2], int *_n); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:61:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char **sam_header2tbl_n(const void *dict, const char type[2], const char *tags[], int *n); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:61: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. char **sam_header2tbl_n(const void *dict, const char type[2], const char *tags[], int *n); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:63:44: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void *sam_header2tbl(const void *dict, char type[2], char key_tag[2], char value_tag[2]); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:63:58: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void *sam_header2tbl(const void *dict, char type[2], char key_tag[2], char value_tag[2]); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_header.h:63:75: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void *sam_header2tbl(const void *dict, char type[2], char key_tag[2], char value_tag[2]); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_opts.c:76: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). ga->nthreads = atoi(optarg); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bcf_sr_sort.c:324: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:88: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:90: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:174: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:390: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:562: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:616: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:787: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:848: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:897: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1062: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1328: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->uncomp_data, fp->uncompressed_block, j->uncomp_len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1433: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1459: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1662: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:122: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:123: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:129: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:156: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:167: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:299: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:301: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:145: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:360: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(out, cp, *out_size); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:452: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:1776: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:188: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1147: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(hdr->md5, cp, 16); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1296: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(&seq[seq_pos-1], data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1324: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(&seq[seq_pos-1], &s->ref[ref_pos - s->ref_start +1], data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1766: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(&seq[seq_pos-1], data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1795: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(&seq[seq_pos-1], &s->ref[ref_pos - s->ref_start +1], data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1884: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[7]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1929: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 tag_data[3]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1992: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 tag_data[3]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2330: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 digest[16]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2370:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2830: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2843:6: [2] (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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2906: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(aux, BLOCK_DATA(s->aux_blk) + cr->aux, cr->aux_size); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2914: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(aux, bfd->rg[cr->rg].name, len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:203: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 smat[5], *mp = smat; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:549: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(cp, s->hdr->md5, 16); cp += 16; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:1657: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(h->substitution_matrix, CRAM_SUBST_MATRIX, 20); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2018:46: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. uint32_t count = (uint32_t)((((unsigned char *)aux)[4]<< 0) + data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2019: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 *)aux)[5]<< 8) + data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2020: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 *)aux)[6]<<16) + data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2021: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 *)aux)[7]<<24)); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2047:6: [2] (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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2323:46: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. uint32_t count = (uint32_t)((((unsigned char *)aux)[4]<< 0) + data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2324: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 *)aux)[5]<< 8) + data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2325: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 *)aux)[6]<<16) + data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2326: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 *)aux)[7]<<24)); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_encode.c:2852:6: [2] (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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:141: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:516: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:530:6: [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%d\t%d\t%"PRId64"\t%d\t%d\n", data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:543: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(buf, "%d\t%d\t%d\t%"PRId64"\t%d\t%d\n", data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:605:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:623: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(buf, "%d\t%d\t%d\t%"PRId64"\t%d\t%d\n", data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:250: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:369: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:468: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:521: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:848: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:891: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 dat[100], *cp = dat;; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1587: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 fai_file[PATH_MAX]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1621: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1622: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1655:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fai_fn, "%.*s.fai", PATH_MAX-5, r->fn); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1662:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(fp = fopen(fai_fn, "r"))) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2024: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], path_tmp[PATH_MAX]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2025: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2190: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 unsigned md5_buf1[16]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2191: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 md5_buf2[33]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2978: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3617: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(header, BLOCK_END(b), header_len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3682: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(out+len, "/%.*s", PATH_MAX - len, in); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3724: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 unsigned buf[16]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3725: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 buf2[33]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3751: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 ref_fn[PATH_MAX]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3985: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:4132: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:4495: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:4500: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:4507: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.h:523: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(BLOCK_END((b)), (s), (l)); \ data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.c:57: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.c:113: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.c:123: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(cp, qual, len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.c:136: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(header->text, ks_str(&h->text), header->l_text); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:183: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:186: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]; // Filename or SHA1 checksum data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:298:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char substitution_matrix[5][4]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:349: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:725: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:726: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_structs.h:727: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 substituion codes data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/mFILE.c:337: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/mFILE.c:504: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/mFILE.c:536: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:167: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[8192], *cp; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:361: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 relative_path[PATH_MAX+1]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c:203: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c:792: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c:804:14: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c:816:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(infp = fopen(argv[optind], "rb"))) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/rANS_static.c:824:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(outfp = fopen(argv[optind], "wb"))) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:55: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 c[2]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:125: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). sh->ref[nref].len = atoi(tag->str+3); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:827:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:1167: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(sh->ID_buf, "%.1000s.%d", name, sh->ID_cnt++); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:1201: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(end, sh->pg_end, nends * sizeof(*end)); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.h:213: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_buf[1024]; // temporary buffer data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/faidx.c:181: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:244: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:251: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:289: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.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(dest, fp->begin, n); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:393: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:603: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.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 scheme[12]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:1027: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_internal.h:111: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:484: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:725: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_libcurl.c:806: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:47: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.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 *headers[3]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:89: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:160: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:164: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:266: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_s3.c:313: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:62: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:132: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[512]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:200: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[32]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:395: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[102], *cp, *cp2, *mode_c; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:502: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:506: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:510: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:514: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:518: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:522: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:526: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:530: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:534: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:538: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:542: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:554: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:558: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:673: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:707: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:779: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1440: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1696: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1697: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1698: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1837: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1875: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2539: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 tmp_a[1024], *tmp = tmp_a; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2766:25: [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 ((local_fp = fopen((char*)p, "rb")) != 0) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2774:25: [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 ((local_fp = fopen(p, "w")) == 0) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hfile.h:203: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hfile.h:228: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hfile.h:253: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hts.h:310: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kseq.h:130: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h:148: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h:180: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h:187:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h:202:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h:216: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/sam.h:409: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/sam.h:480: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/sam.h:498: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:179: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:254: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:262: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:267: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:268: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:345: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:347: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:349: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:351: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:416: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:417: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:491: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:493: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:38: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:58: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/md5.c:65: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/md5.c:252: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/md5.c:256: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/md5.c:267: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/probaln.c:262: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/probaln.c:263: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/realn.c:147: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); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/regidx.c:151:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char*)list->payload + idx->payload_size*(list->nregs-1), idx->payload, idx->payload_size); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:89: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(h->text, h0->text, h->l_text); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:123: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[4]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:230: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[4]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:313: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(data, bsrc->data, bsrc->l_data); // copy var-len data data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:399: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1015:23: [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). kputl(atol(tab), &str); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1104: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1624: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1631: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1645: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1661: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1684: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1727: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1778: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1956: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1960: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:301: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c:189: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c:201: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c:204: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hfile.c:65: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hfile.c:99: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hfile.c:178: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hts_endian.c:147: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c:326: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c:330: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, "r"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c:333: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, "w"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-regidx.c:66: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:65: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:119: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:347: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:380: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:455: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:456: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:527: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:51: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.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 modew[800]; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:73:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'l': clevel = atoi(optarg); flag |= WRITE_COMPRESSED; break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:75:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). case 'N': nreads = atoi(optarg); break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:77: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 'Z': extra_hdr_nuls = atoi(optarg); break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:79: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 '@': nthreads = atoi(optarg); break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:133:37: [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 (clevel >= 0 && clevel <= 9) sprintf(modew + 1, "%d", clevel); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads3.c:33: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads4.c:41: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads5.c:35: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads5.c:47: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads6.c:43: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/textutils.c:181: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1364: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:61:16: [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. case '\n': strcpy(buffer, "\\n"); break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:62:16: [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. case '\r': strcpy(buffer, "\\r"); break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:63:16: [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. case '\t': strcpy(buffer, "\\t"); break; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:67: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, "\\%c", c); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:70:27: [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 (isprint_c(c)) sprintf(buffer, "%c", c); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:71:14: [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. else sprintf(buffer, "\\x%02X", (unsigned char) c); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:237: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[n-1],str,len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:250: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:257: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.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(hrec->key,p,n); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:309: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1026: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(v, x + 2, 16); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1086: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1483: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1491: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1529: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 + 2, v, 16); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1570:48: [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). kputs(",length=", &txt); kputl(atol(tab), &txt); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:2083: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:2208:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). v->pos = atoi(p) - 1; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3334: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3474: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3720: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3788: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3823: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf_sweep.c:80: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:434: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:436: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:467: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:469: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:738: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:740: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:777: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:780: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:790: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcfutils.c:792: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/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.c:119: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). if (strncmp(rg, ID, strlen(rg)) != 0 || ID[strlen(rg)] != '\t') data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.c:119:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp(rg, ID, strlen(rg)) != 0 || ID[strlen(rg)] != '\t') data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam.c:126:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(LB_text, LB, MIN(cp-LB, 1023)); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:160:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(id, &cp[j], l-j); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_cat.c:242:17: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(&new_h->text[new_h->l_text - (line_end - line)], data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:232:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!line_end) line_end = line_start + strlen(line_start); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:755: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). if (!end) end = id + strlen(id); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1027:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bam_aux_append(b, "RG", 'Z', strlen(translate_rg) + 1, data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1057:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bam_aux_append(b, "PG", 'Z', strlen(translate_pg) + 1, data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1207:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int l = strlen(fn[i]); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1216:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(RG[i], s + j, l); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1489:30: [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 (flag & MERGE_UNCOMP) strcat(mode, "0"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1490:35: [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 (flag & MERGE_LEVEL1) strcat(mode, "1"); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:1939: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). name = (char*)calloc(strlen(w->prefix) + 20, 1); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2065:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(g_sort_tag, sort_by_tag, 2); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2189: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). fns[i] = (char*)calloc(strlen(prefix) + 20, 1); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/bam_sort.c:2227: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). char *fnout = calloc(strlen(prefix) + 4 + 1, 1); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam.c:133: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). fn_list = calloc(strlen(fn_ref) + 5, 1); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_opts.c:68: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 *ref = malloc(10 + strlen(optarg) + 1); data/r-bioc-rhtslib-1.22.0+dfsg/inst/include/sam_utils.c:84:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sv, v, len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bcf_sr_sort.c:119: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bcf_sr_sort.c:120: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bcf_sr_sort.c:323: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1349: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1720: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzf.c:1720: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:165: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:212: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:216: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:280: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(argv[optind]); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/bgzip.c:298: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). name[strlen(name) - 3] = '\0'; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:456: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). size_t l = strlen(prefix); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:588: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). size_t l = strlen(prefix); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:1238: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). size_t l = strlen(prefix); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:1565: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). size_t l = strlen(prefix); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_codecs.c:1779: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). size_t l = strlen(prefix); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:1981: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_decode.c:2842: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). name_len = strlen(fd->prefix); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:533: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 (bgzf_write(fp, buf, strlen(buf)) < 0) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:546:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (bgzf_write(fp, buf, strlen(buf)) < 0) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_index.c:627: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). ret = (bgzf_write(fp, buf, strlen(buf)) >= 0)? 0 : -4; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1624: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1913:2: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1918: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). path += strlen(fn); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1919: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). fn += strlen(fn); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1926: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). l = MIN(l, strlen(fn)); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1928:3: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:1944: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). path += strlen(dir); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:2071:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, path2, PATH_MAX); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3166:2: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3664: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3669:2: [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); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3676: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). (len = strlen(out))+1+strlen(in) >= PATH_MAX) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3676: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). (len = strlen(out))+1+strlen(in) >= PATH_MAX) { data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3677:6: [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); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:3987: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_io.c:4055:2: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/cram_samtools.c:109: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:107: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:169: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). int maxlen = 8190 - strlen(file), len; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:176: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). cp += strlen(strcpy(cp, file)); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:211: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:212: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:233:3: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:239:6: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:242:3: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:243: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). path_end += MIN(strlen(file), l); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:244: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). file += MIN(strlen(file), l); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.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). path_end += strlen(file); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:248: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). file += strlen(file); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:253:2: [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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:254: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). path_end += MIN(strlen(dirname), len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:323: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/open_trace_file.c:392: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:122:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sh->ref[nref].name, tag->str+3, tag->len-3); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:165:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sh->rg[nrg].name, tag->str+3, tag->len-3); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:167: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). sh->rg[nrg].name_len = strlen(sh->rg[nrg].name); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:208:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sh->pg[npg].name, tag->str+3, tag->len-3); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:210: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). sh->pg[npg].name_len = strlen(sh->pg[npg].name); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:289:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(lines); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/sam_header.c:1248: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). nbytes += strlen(argv[i]); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/string_alloc.c:143: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/cram/string_alloc.c:151:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(str, instr, len); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/faidx.c:468: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_end = l = strlen(str); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:174: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:304: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:518: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:788: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile.c:794: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hfile_internal.h:63: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:400:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(smode, mode, 100); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:682: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:789: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:793: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1166:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s[n-1], q, p - q); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1206: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1219: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:1691: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2513: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2543:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp, reg, q - reg); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2762: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). for (p = fn + strlen(fn) - 1; p >= fn; --p) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2824: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); l_ext = strlen(ext); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2824: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). l_fn = strlen(fn); l_ext = strlen(ext); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/hts.c:2842: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(local_fn); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/hfile.h:226: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/knetfile.h:35: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/htslib/kstring.h:156: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:240: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:314: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:315: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:317: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:384: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/knetfile.c:537: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:135: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:229: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:279: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:362: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:362: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/kstring.c:367: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/multipart.c:83: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/multipart.c:97: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/probaln.c:274: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/probaln.c:274: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/regidx.c:176: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:233:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buf, "BAM\1", 4); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:254: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:889: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1115: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1125: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 (h->l_text > UINT32_MAX - strlen(SAM_FORMAT_VERSION) - 9) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1127: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). h->l_text += strlen(SAM_FORMAT_VERSION) + 8; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1129: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). if (h->l_text > UINT32_MAX - strlen(val) - 5) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1131: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->l_text += strlen(val) + 4; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1145: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). if (h->l_text > UINT32_MAX - strlen(val) - 5) data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1147: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->l_text += strlen(val) + 4; data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1905:42: [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 (strcmp(format, "bam") == 0) strcpy(mode, "b"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1906:43: [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 (strcmp(format, "cram") == 0) strcpy(mode, "c"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1907:42: [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 (strcmp(format, "sam") == 0) strcpy(mode, ""); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1920: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1921: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1929: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1947: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/sam.c:1974: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/synced_bcf_reader.c:956: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:72: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tabix.c:505: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) + 5, 1); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c:194: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c:203: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/tbx.c:321: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/hfile.c:140: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/sam.c:155: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-vcf-api.c:173: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test-vcf-api.c:174: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:299: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:299: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:299: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_bgzf.c:300: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:104: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:105:27: [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 (flag & READ_CRAM) strcat(moder, "c"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:106: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 ((flag & READ_COMPRESSED) == 0) strcat(moder, "b"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:132: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:134:28: [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 (flag & WRITE_CRAM) strcat(modew, "c"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/test_view.c:135:39: [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 (flag & WRITE_COMPRESSED) strcat(modew, "b"); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads4.c:56: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads4.c:60: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/test/thrash_threads6.c:93: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1007: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1048: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1094: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1245: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1271: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/thread_pool.c:1296: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:130:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s, p, q - p); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1282:69: [1] (buffer) strlen: Does not handle 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->d.id && strcmp(line->d.id, ".") ) bcf_enc_vchar(str, strlen(line->d.id), line->d.id); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1290: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). bcf_enc_vchar(str, strlen(line->d.allele[i]), line->d.allele[i]); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1291: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1368: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1602: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). bcf_hrec_add_key(hrec, "ID", strlen("ID")); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:1603:69: [1] (buffer) strlen: Does not handle 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_hrec_set_val(hrec, hrec->nkeys-1, (char*) names[i], strlen(names[i]), 0); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3290: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3318: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3372: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3572:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line->rlen = end_info ? end_info->v1.i : strlen(line->d.allele[0]); data/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3640: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/r-bioc-rhtslib-1.22.0+dfsg/src/htslib-1.7/vcf.c:3650: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 = 615 Lines analyzed = 63919 in approximately 1.81 seconds (35292 lines/second) Physical Source Lines of Code (SLOC) = 43014 Hits@level = [0] 383 [1] 186 [2] 328 [3] 47 [4] 51 [5] 3 Hits@level+ = [0+] 998 [1+] 615 [2+] 429 [3+] 101 [4+] 54 [5+] 3 Hits/KSLOC@level+ = [0+] 23.2017 [1+] 14.2977 [2+] 9.9735 [3+] 2.34807 [4+] 1.25541 [5+] 0.0697447 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.