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-snpstats-1.40.0+dfsg/src/Rmissing.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/Runcertain.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/bind.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/count_gt.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/covwin.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/covwin.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/force_hom.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/fst.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/gsl_poly.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/hash_index.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/hash_index.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/hphase.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/hphase.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/imputation.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/imputation.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/in.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/input.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/invert.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/invert.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/ipf.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/ipf.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/ld.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/misc.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/mla.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/mla.h Examining data/r-bioc-snpstats-1.40.0+dfsg/src/mvphenotype.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/outdata.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/single_snp_tests.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/snp_summary.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/snpmpy.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/solve_cubic.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/structure.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/subset.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/switch.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/tdt.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/testBig.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/uncertain.c Examining data/r-bioc-snpstats-1.40.0+dfsg/src/uncertain.h FINAL RESULTS: data/r-bioc-snpstats-1.40.0+dfsg/src/hash_index.c:80:25: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). if ((this_node) && strcpy(this_node->name, name)) { data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:31:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sort_command, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:34:15: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int error = system(sort_command); data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:47:7: [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. if (fscanf(infile, " %s %s %s %lf", chip_in, snp_in, gt_in, &thr_in)!=4) data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:54:21: [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. int scanned = fscanf(infile, " %s %s %s %lf", data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:65:18: [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. int scanned = fscanf(infile, " %s %s %s %lf", data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:1298: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 setname[MAX_NAME_LENGTH]; data/r-bioc-snpstats-1.40.0+dfsg/src/hash_index.h:27: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[MAX_ID]; data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:24: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. void insnp(char *filename, char *tmpdir, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:24:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void insnp(char *filename, char *tmpdir, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:25: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. int *nchip, char **chip_id, int *nsnps, char **snp_id, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:25: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. int *nchip, char **chip_id, int *nsnps, char **snp_id, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:26: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 *codes[3], double *threshold, char *gtypes, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:26:40: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *codes[3], double *threshold, char *gtypes, data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:29: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 sort_command[160]; data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:36:18: [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 *infile = fopen(filename, "r"); data/r-bioc-snpstats-1.40.0+dfsg/src/in.c:45: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 chip_in[MAX_ID], snp_in[MAX_ID], gt_in[MAX_GT]; data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:339: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 field[MAX_FLD]; data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:403:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sampid[MAX_FLD], snpid[MAX_FLD]; data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:404:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 gtype1[MAX_FLD], gtype2[MAX_FLD]; data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:405:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 cscore[MAX_FLD]; data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:786: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 front[MAX_FLD], back[MAX_FLD]; data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:807: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[MAX_FLD]; data/r-bioc-snpstats-1.40.0+dfsg/src/ld.c:30: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 *statnames[7] = {"LLR", "OR", "Q", "Covar", "D.prime", "R.squared", "R"}; data/r-bioc-snpstats-1.40.0+dfsg/src/outdata.c:26: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). outfile = fopen(*file, "a"); data/r-bioc-snpstats-1.40.0+dfsg/src/outdata.c:28: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). outfile = fopen(*file, "w"); data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:33: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. const unsigned char recode[4] = {'\x01', '\x00', '\x02', '\x03'}; data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:38: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). FILE *in = fopen(file, "rb"); data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:41: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. unsigned char start[3]; data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:139: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 *out = fopen(file, "wb"); data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:150:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char recode[4] = {0x01, 0x00, 0x02, 0x03}; data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c:121: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[BUFFERSIZE]; data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c:123: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(id, "SNP%d", i+1); data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c:145: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[BUFFERSIZE]; data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c:260: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[BUFFERSIZE]; data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c:263: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(id, "Sample%d", i+1); data/r-bioc-snpstats-1.40.0+dfsg/src/read_uncertain.c:284: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[BUFFERSIZE]; data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:75:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char gcode(unsigned char acodes[2], char a1, char a2, char miss, int ifX, int male) { data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:75:30: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 gcode(unsigned char acodes[2], char a1, char a2, char miss, int ifX, int male) { data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:143:18: [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 *infile = fopen(fname, "r"); data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:213: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 fid[MAX_ID], fmid[MAX_ID]; data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:340: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(fmid,"%d", j+1); data/r-bioc-snpstats-1.40.0+dfsg/src/subset.c:115:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(r+ij, x+uv1, N); data/r-bioc-snpstats-1.40.0+dfsg/src/testBig.c:30: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[16]; data/r-bioc-snpstats-1.40.0+dfsg/src/testBig.c:31: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(name, "Subject%d", i+1); data/r-bioc-snpstats-1.40.0+dfsg/src/testBig.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 name[16]; data/r-bioc-snpstats-1.40.0+dfsg/src/testBig.c:36: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(name, "Snp%d", i+1); data/r-bioc-snpstats-1.40.0+dfsg/src/uncertain.c:9: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 lup0[253] = data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:45:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(classY)>5) { data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:457:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(classZ)>5) { data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:1029:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(classY)>5) { data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:1386:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(classZ)>5) { data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:1622:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(setname, srname, max_name_length); data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:1625:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(setname); data/r-bioc-snpstats-1.40.0+dfsg/src/glm_test_R.c:1631:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(setname+len, srname, space-2); data/r-bioc-snpstats-1.40.0+dfsg/src/hash_index.c:78: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 ((strlen(name) < MAX_ID) && (index_lookup(db, name) < 0) && (value >=0)) { data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:242: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(c)>1) data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:254: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(c)>1) data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:365: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 lfn = strlen(filename); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:429:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sampid, field, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:432:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(snpid, field, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:435:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cscore, field, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:438:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(gtype1, field, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:440:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(gtype1, field, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:442:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(gtype2, field, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:588: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). switch (strlen(gtype1)) { data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:736:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int la = strlen(a), lb = strlen(b); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:736:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int la = strlen(a), lb = strlen(b); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:787:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(front, CHAR(STRING_ELT(x, 0)), MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:788:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(back, front, MAX_FLD-1); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:789: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). lenf = lenb = strlen(front); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:810: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 lenx = strlen(xi); data/r-bioc-snpstats-1.40.0+dfsg/src/input.c:814:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(id, xi+lenf, ncp); data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:24:2: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fgetc(in); data/r-bioc-snpstats-1.40.0+dfsg/src/plink.c:97:30: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). byte = (unsigned char) fgetc(in); data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:22:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ci = fgetc(f); data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:55:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(f); data/r-bioc-snpstats-1.40.0+dfsg/src/readped.c:217:9: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (fscanf(infile, " %70s", fid) != 1) data/r-bioc-snpstats-1.40.0+dfsg/src/single_snp_tests.c:78:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(classS)>5) { data/r-bioc-snpstats-1.40.0+dfsg/src/tdt.c:68:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(classS)>5) { ANALYSIS SUMMARY: Hits = 80 Lines analyzed = 11587 in approximately 0.34 seconds (33591 lines/second) Physical Source Lines of Code (SLOC) = 9246 Hits@level = [0] 10 [1] 32 [2] 42 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 90 [1+] 80 [2+] 48 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 9.73394 [1+] 8.65239 [2+] 5.19143 [3+] 0.648929 [4+] 0.648929 [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.