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/dwgsim-0.1.12/src/contigs.c Examining data/dwgsim-0.1.12/src/contigs.h Examining data/dwgsim-0.1.12/src/dwgsim.c Examining data/dwgsim-0.1.12/src/dwgsim.h Examining data/dwgsim-0.1.12/src/dwgsim_eval.c Examining data/dwgsim-0.1.12/src/dwgsim_eval.h Examining data/dwgsim-0.1.12/src/dwgsim_opt.c Examining data/dwgsim-0.1.12/src/dwgsim_opt.h Examining data/dwgsim-0.1.12/src/mut.c Examining data/dwgsim-0.1.12/src/mut.h Examining data/dwgsim-0.1.12/src/mut_bed.c Examining data/dwgsim-0.1.12/src/mut_bed.h Examining data/dwgsim-0.1.12/src/mut_input.c Examining data/dwgsim-0.1.12/src/mut_input.h Examining data/dwgsim-0.1.12/src/mut_txt.c Examining data/dwgsim-0.1.12/src/mut_txt.h Examining data/dwgsim-0.1.12/src/mut_vcf.c Examining data/dwgsim-0.1.12/src/mut_vcf.h Examining data/dwgsim-0.1.12/src/regions_bed.c Examining data/dwgsim-0.1.12/src/regions_bed.h FINAL RESULTS: data/dwgsim-0.1.12/src/dwgsim.c:470:17: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while(0 < fscanf(opt->fp_fai, "%s\t%d\t%d\t%d\t%d", name, &l, &dummy_int[0], &dummy_int[1], &dummy_int[2])) { data/dwgsim-0.1.12/src/dwgsim.c:1067: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(fn_fai, argv[optind+0]); strcat(fn_fai, ".fai"); data/dwgsim-0.1.12/src/dwgsim.c:1069: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(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".mutations.txt"); data/dwgsim-0.1.12/src/dwgsim.c:1071: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(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".mutations.vcf"); data/dwgsim-0.1.12/src/dwgsim.c:1074:7: [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(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".bfast.fastq"); data/dwgsim-0.1.12/src/dwgsim.c:1076:7: [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(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".bwa.read1.fastq"); data/dwgsim-0.1.12/src/dwgsim.c:1078:7: [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(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".bwa.read2.fastq"); data/dwgsim-0.1.12/src/dwgsim_eval.c:318:12: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(14 != sscanf(name, "%s %d %d %1d %1d %1d %1d %d %d %d %d %d %d %s", data/dwgsim-0.1.12/src/dwgsim_eval.c:691:7: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, format, data/dwgsim-0.1.12/src/mut_bed.c:55:13: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while(0 < fscanf(fp, "%s\t%u\t%u\t%s\t%s", name, &start, &end, bases, type)) { data/dwgsim-0.1.12/src/mut_txt.c:54:13: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while(0 < fscanf(fp, "%s\t%u\t%c\t%s\t%d", name, &pos, &ref, mut, &is_hap)) { data/dwgsim-0.1.12/src/mut_vcf.c:88:21: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(EOF == sscanf(buffer+s, "%s\t%u\t%s\t%s\t%s", name, &pos, id, ref, alt)) { data/dwgsim-0.1.12/src/regions_bed.c:54:13: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while(0 < fscanf(fp, "%s\t%u\t%u", name, &start, &end)) { data/dwgsim-0.1.12/src/dwgsim.c:163:22: [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. v1 = 2.0 * drand48() - 1.0; data/dwgsim-0.1.12/src/dwgsim.c:164:22: [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. v2 = 2.0 * drand48() - 1.0; data/dwgsim-0.1.12/src/dwgsim.c:181:10: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if(drand48() < prob) r++; data/dwgsim-0.1.12/src/dwgsim.c:263:17: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. else if(drand48() < e[_j]->start + e[_j]->by*i) { \ data/dwgsim-0.1.12/src/dwgsim.c:264:30: [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. c = (c + (mut_t)(drand48() * 3.0 + 1)) & 3; \ data/dwgsim-0.1.12/src/dwgsim.c:313:17: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. while(drand48() < e) { // how many bases should we insert/delete data/dwgsim-0.1.12/src/dwgsim.c:317:18: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if(drand48() < 0.5) { // insert data/dwgsim-0.1.12/src/dwgsim.c:362:33: [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. k = (int)(drand48() * j); data/dwgsim-0.1.12/src/dwgsim.c:384:17: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. while(drand48() < e) { data/dwgsim-0.1.12/src/dwgsim.c:633: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. if(opt->rand_read < drand48()) { data/dwgsim-0.1.12/src/dwgsim.c:645:53: [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. pos = (int)((l - d + 1) * drand48()); data/dwgsim-0.1.12/src/dwgsim.c:661:53: [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. pos = (int)((l - d + 1) * drand48()); data/dwgsim-0.1.12/src/dwgsim.c:683:46: [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. mutseq_t *currseq = mutseq[drand48()<opt->mut_freq?0:1]; // haplotype from which the reads are generated data/dwgsim-0.1.12/src/dwgsim.c:701:23: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (drand48() < 0.5) { // which strand ? data/dwgsim-0.1.12/src/dwgsim.c:930:49: [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. tmp_seq[j][i] = (int)(drand48() * 4.0) & 3; data/dwgsim-0.1.12/src/dwgsim_eval.c:122: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(0 <= (c = getopt(argc, argv, "a:d:e:g:m:n:q:s:bchimpzSP:"))) { data/dwgsim-0.1.12/src/dwgsim_opt.c:195:15: [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, "id:s:N:C:1:2:e:E:r:F:R:X:I:c:S:n:y:BHf:z:Mm:b:v:x:P:q:Q:h")) >= 0) { data/dwgsim-0.1.12/src/dwgsim_opt.c:370:38: [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. tmp_seq[k] = (int)(drand48() * 4.0) & 3; data/dwgsim-0.1.12/src/mut.c:292:82: [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. } while (num_ins < ins_long_length_max && (num_ins < opt->indel_min || drand48() < opt->indel_extend)); data/dwgsim-0.1.12/src/mut.c:301:26: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (opt->is_hap || drand48() < 0.333333) { // hom-ins data/dwgsim-0.1.12/src/mut.c:303:18: [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. } else if (drand48() < 0.5) { data/dwgsim-0.1.12/src/mut.c:314:42: [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. ins = (ins << 2) | (mut_t)(drand48() * 4.0); data/dwgsim-0.1.12/src/mut.c:348:30: [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. b = ((uint8_t)(drand48() * 4.0)) << (bit_index << 1); data/dwgsim-0.1.12/src/mut.c:606:55: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (deletion_length < opt->indel_min || drand48() < opt->indel_extend) { data/dwgsim-0.1.12/src/mut.c:613:24: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (c < 4 && drand48() < opt->mut_rate) { // mutation data/dwgsim-0.1.12/src/mut.c:614:19: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (drand48() >= opt->indel_frac) { // substitution data/dwgsim-0.1.12/src/mut.c:615:30: [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 r = drand48(); data/dwgsim-0.1.12/src/mut.c:617:38: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (opt->is_hap || drand48() < 0.333333) { // hom data/dwgsim-0.1.12/src/mut.c:620:27: [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. ret[drand48()<0.5?0:1]->s[i] = SUBSTITUTE|c; data/dwgsim-0.1.12/src/mut.c:623:23: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (drand48() < 0.5) { // deletion data/dwgsim-0.1.12/src/mut.c:624:42: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (opt->is_hap || drand48() < 0.3333333) { // hom-del data/dwgsim-0.1.12/src/mut.c:628:38: [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. deleting = drand48()<0.5?1:2; data/dwgsim-0.1.12/src/mut.c:657:38: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (opt->is_hap || drand48() < 0.333333) { data/dwgsim-0.1.12/src/mut.c:662: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. which_hap = drand48()<0.5?0:1; data/dwgsim-0.1.12/src/mut.c:671:42: [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 r = drand48(); data/dwgsim-0.1.12/src/dwgsim.c:250:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fp = fopen(fn, mode)) == 0) { data/dwgsim-0.1.12/src/dwgsim.c:426: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 name[1024], *qstr; data/dwgsim-0.1.12/src/dwgsim.c:1058: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 fn_fai[1024]="\0"; data/dwgsim-0.1.12/src/dwgsim.c:1059: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 fn_tmp[1024]="\0"; data/dwgsim-0.1.12/src/dwgsim.c:1067:35: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcpy(fn_fai, argv[optind+0]); strcat(fn_fai, ".fai"); data/dwgsim-0.1.12/src/dwgsim.c:1068:17: [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). opt->fp_fai = fopen(fn_fai, "r"); // NB: depends on returning NULL; data/dwgsim-0.1.12/src/dwgsim.c:1069:35: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcpy(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".mutations.txt"); data/dwgsim-0.1.12/src/dwgsim.c:1071:35: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcpy(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".mutations.vcf"); data/dwgsim-0.1.12/src/dwgsim.c:1074:39: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcpy(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".bfast.fastq"); data/dwgsim-0.1.12/src/dwgsim.c:1076:39: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcpy(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".bwa.read1.fastq"); data/dwgsim-0.1.12/src/dwgsim.c:1078:39: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcpy(fn_tmp, argv[optind+1]); strcat(fn_tmp, ".bwa.read2.fastq"); data/dwgsim-0.1.12/src/dwgsim_eval.c:124: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 'a': args.a = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:127: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 'd': args.d = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:128: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 'g': args.g = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:131: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': args.n = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:132: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 'q': args.q = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:136: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 's': args.s = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:137: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 'e': args.e = atoi(optarg); break; data/dwgsim-0.1.12/src/dwgsim_eval.c:286: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 chr_name[1028]="\0"; data/dwgsim-0.1.12/src/dwgsim_eval.c:287:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char read_num[1028]="\0"; data/dwgsim-0.1.12/src/dwgsim_eval.c:597: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 format[1024]="\0"; data/dwgsim-0.1.12/src/dwgsim_eval.c:609: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(format, "%.2d "); data/dwgsim-0.1.12/src/dwgsim_eval.c:611:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(format + (int)strlen(format), "%%%dd ", max); data/dwgsim-0.1.12/src/dwgsim_eval.c:613: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(format + (int)strlen(format), "%.3e %.3e %.3e %.3e %.3e %.3e\n"); data/dwgsim-0.1.12/src/dwgsim_opt.c:185:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). return atoi(optarg); data/dwgsim-0.1.12/src/mut_bed.c:41: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 name[1024]; data/dwgsim-0.1.12/src/mut_bed.c:43: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 type[1024]; data/dwgsim-0.1.12/src/mut_bed.c:44: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 bases[1024]; data/dwgsim-0.1.12/src/mut_txt.c:44: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 name[1024]; data/dwgsim-0.1.12/src/mut_txt.c:46: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, mut[1024]; data/dwgsim-0.1.12/src/mut_vcf.c:47: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 name[1024]; // 1. #CHROM data/dwgsim-0.1.12/src/mut_vcf.c:49: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 id[1024]; // 3. ID data/dwgsim-0.1.12/src/mut_vcf.c:50: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[1024]; // 4. REF data/dwgsim-0.1.12/src/mut_vcf.c:51: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 alt[1025]; // 5. ALT data/dwgsim-0.1.12/src/mut_vcf.c:55: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 buffer[BUFFER_L]; data/dwgsim-0.1.12/src/regions_bed.c:41: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 name[1024]; data/dwgsim-0.1.12/src/dwgsim.c:189: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). for(i=0;i<strlen(str);i++) { data/dwgsim-0.1.12/src/dwgsim.c:526: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(name_len_max < strlen(name)) { data/dwgsim-0.1.12/src/dwgsim.c:527: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). name_len_max = strlen(name); data/dwgsim-0.1.12/src/dwgsim.c:530:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i=0;i<name_len_max-strlen(name);i++) { data/dwgsim-0.1.12/src/dwgsim_eval.c:309: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). j = strlen(name); data/dwgsim-0.1.12/src/dwgsim_eval.c:310: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). tmp = strlen(args->P); data/dwgsim-0.1.12/src/dwgsim_eval.c:336: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). i = strlen(name); data/dwgsim-0.1.12/src/dwgsim_eval.c:337: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 = strlen(header->target_name[j]); data/dwgsim-0.1.12/src/dwgsim_eval.c:611: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). sprintf(format + (int)strlen(format), "%%%dd ", max); data/dwgsim-0.1.12/src/dwgsim_eval.c:613: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). strcat(format + (int)strlen(format), "%.3e %.3e %.3e %.3e %.3e %.3e\n"); data/dwgsim-0.1.12/src/dwgsim_opt.c:151: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). for(i=0;i<strlen(str);i++) { data/dwgsim-0.1.12/src/dwgsim_opt.c:156:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(i<strlen(str)-1) { data/dwgsim-0.1.12/src/dwgsim_opt.c:169: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). int32_t len = strlen(optarg); data/dwgsim-0.1.12/src/dwgsim_opt.c:289:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(NULL != opt->fixed_quality && 1 != strlen(opt->fixed_quality)) { data/dwgsim-0.1.12/src/dwgsim_opt.c:334: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). opt->flow_order_len = strlen((char*)opt->flow_order); data/dwgsim-0.1.12/src/mut.c:55:23: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!feof(fp) && fgetc(fp) != '>'); data/dwgsim-0.1.12/src/mut.c:58:28: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!feof(fp) && (c = fgetc(fp)) != ' ' && c != '\t' && c != '\n') data/dwgsim-0.1.12/src/mut.c:64:37: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!feof(fp) && ((c = fgetc(fp)) == ' ' || c == '\t')); data/dwgsim-0.1.12/src/mut.c:67:40: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!feof(fp) && (c = fgetc(fp)) != '\n') data/dwgsim-0.1.12/src/mut.c:72:45: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). } else if (c != '\n') while (!feof(fp) && fgetc(fp) != '\n'); data/dwgsim-0.1.12/src/mut.c:74:28: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!feof(fp) && (c = fgetc(fp)) != '>') { data/dwgsim-0.1.12/src/mut.c:295: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). num_ins = strlen(bases); // ignores num_ins data/dwgsim-0.1.12/src/mut_bed.c:76:59: [1] (buffer) strlen: Does not handle 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 if(0 != strcmp("*", bases) && (end - start) != strlen(bases)) { data/dwgsim-0.1.12/src/mut_vcf.c:142: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). ref_l = strlen(ref); data/dwgsim-0.1.12/src/mut_vcf.c:143:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). alt_l = strlen(alt); data/dwgsim-0.1.12/src/regions_bed.c:107:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(EOF != (b = fgetc(fp))) { ANALYSIS SUMMARY: Hits = 110 Lines analyzed = 4373 in approximately 0.20 seconds (21794 lines/second) Physical Source Lines of Code (SLOC) = 3505 Hits@level = [0] 242 [1] 26 [2] 36 [3] 35 [4] 13 [5] 0 Hits@level+ = [0+] 352 [1+] 110 [2+] 84 [3+] 48 [4+] 13 [5+] 0 Hits/KSLOC@level+ = [0+] 100.428 [1+] 31.3837 [2+] 23.9658 [3+] 13.6947 [4+] 3.70899 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.