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/hmmer2-2.3.2+dfsg/src/debug.c Examining data/hmmer2-2.3.2+dfsg/src/hmmconvert.c Examining data/hmmer2-2.3.2+dfsg/src/display.c Examining data/hmmer2-2.3.2+dfsg/src/histogram.c Examining data/hmmer2-2.3.2+dfsg/src/pvm.c Examining data/hmmer2-2.3.2+dfsg/src/fast_algorithms.c Examining data/hmmer2-2.3.2+dfsg/src/hmmalign.c Examining data/hmmer2-2.3.2+dfsg/src/structs.h Examining data/hmmer2-2.3.2+dfsg/src/emulation.c Examining data/hmmer2-2.3.2+dfsg/src/tophits.c Examining data/hmmer2-2.3.2+dfsg/src/masks.c Examining data/hmmer2-2.3.2+dfsg/src/threads.c Examining data/hmmer2-2.3.2+dfsg/src/hmmpostal.c Examining data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c Examining data/hmmer2-2.3.2+dfsg/src/hmmindex.c Examining data/hmmer2-2.3.2+dfsg/src/emit.c Examining data/hmmer2-2.3.2+dfsg/src/hmmsearch.c Examining data/hmmer2-2.3.2+dfsg/src/hmmbuild.c Examining data/hmmer2-2.3.2+dfsg/src/trace.c Examining data/hmmer2-2.3.2+dfsg/src/misc.c Examining data/hmmer2-2.3.2+dfsg/src/weetest.c Examining data/hmmer2-2.3.2+dfsg/src/modelmakers.c Examining data/hmmer2-2.3.2+dfsg/src/alphabet.c Examining data/hmmer2-2.3.2+dfsg/src/states.c Examining data/hmmer2-2.3.2+dfsg/src/hmmemit.c Examining data/hmmer2-2.3.2+dfsg/src/core_algorithms.c Examining data/hmmer2-2.3.2+dfsg/src/hmmio.c Examining data/hmmer2-2.3.2+dfsg/src/globals.h Examining data/hmmer2-2.3.2+dfsg/src/hmmsearch-pvm.c Examining data/hmmer2-2.3.2+dfsg/src/hmmcalibrate-pvm.c Examining data/hmmer2-2.3.2+dfsg/src/hmmpfam.c Examining data/hmmer2-2.3.2+dfsg/src/plan7.c Examining data/hmmer2-2.3.2+dfsg/src/plan9.c Examining data/hmmer2-2.3.2+dfsg/src/hmmfetch.c Examining data/hmmer2-2.3.2+dfsg/src/camJul97.c Examining data/hmmer2-2.3.2+dfsg/src/hmmpfam-pvm.c Examining data/hmmer2-2.3.2+dfsg/src/postprob.c Examining data/hmmer2-2.3.2+dfsg/src/postprob.h Examining data/hmmer2-2.3.2+dfsg/src/prior.c Examining data/hmmer2-2.3.2+dfsg/src/funcs.h Examining data/hmmer2-2.3.2+dfsg/src/mathsupport.c Examining data/hmmer2-2.3.2+dfsg/testsuite/fitting_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/masks_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/weeviterbi_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/trace_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/parsingviterbi_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/tophits_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/alignalign_test.c Examining data/hmmer2-2.3.2+dfsg/testsuite/viterbi_exercise.c FINAL RESULTS: data/hmmer2-2.3.2+dfsg/src/histogram.c:262:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "<%4d %6d %6s|", i+1, lowcount, "-"); data/hmmer2-2.3.2+dfsg/src/histogram.c:273:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, ">%4d %6d %6s|", i, highcount, "-"); data/hmmer2-2.3.2+dfsg/src/histogram.c:288:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%5d %6d %6s|", i, h->histogram[idx], "-"); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:255: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(tmpfile, hmmfile); data/hmmer2-2.3.2+dfsg/src/hmmemit.c:180: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(sqinfo.name, hmm->name); data/hmmer2-2.3.2+dfsg/src/hmmemit.c:241:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sqinfo.name, "%s-%d", hmm->name, i+1); data/hmmer2-2.3.2+dfsg/src/hmmindex.c:95:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ssifile, "%s%s", hmmfile, ".ssi"); data/hmmer2-2.3.2+dfsg/src/hmmio.c:181:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ssifile, "%s.ssi", hmmfile); data/hmmer2-2.3.2+dfsg/src/hmmio.c:192:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ssifile, "%s.ssi", full); data/hmmer2-2.3.2+dfsg/src/hmmio.c:625:6: [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(hmm->comlog, buffer+6); data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:390:8: [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(safedesc, desc); data/hmmer2-2.3.2+dfsg/src/hmmsearch.c:423:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(safedesc, desc); data/hmmer2-2.3.2+dfsg/src/plan7.c:307:7: [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(hmm->comlog, argv[i]); data/hmmer2-2.3.2+dfsg/src/plan7.c:1041: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(plan7->rf, hmm->ref); data/hmmer2-2.3.2+dfsg/src/plan7.c:1045: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(plan7->cs, hmm->cs); data/hmmer2-2.3.2+dfsg/src/states.c:248:31: [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 (hmm2->flags & HMM_REF) strcpy(hmm1->ref, hmm2->ref); data/hmmer2-2.3.2+dfsg/src/states.c:249:31: [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 (hmm2->flags & HMM_CS) strcpy(hmm1->cs, hmm2->cs); data/hmmer2-2.3.2+dfsg/src/trace.c:530:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msa->au, "HMMER %s", PACKAGE_VERSION); data/hmmer2-2.3.2+dfsg/src/threads.c:86:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((env = getenv("HMMER_NCPU")) != NULL) data/hmmer2-2.3.2+dfsg/src/alphabet.c:124: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(Alphabet, "ACDEFGHIKLMNPQRSTVWYUBZX"); data/hmmer2-2.3.2+dfsg/src/alphabet.c:141: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(Alphabet, "ACGTUNRYMKSWHBVDX"); data/hmmer2-2.3.2+dfsg/src/camJul97.c:118:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. MakeIslandHMM(char **aseqs, AINFO *ainfo, int idx, data/hmmer2-2.3.2+dfsg/src/camJul97.c:260: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 buf[2048]; data/hmmer2-2.3.2+dfsg/src/camJul97.c:270: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). nq = atoi(buf); data/hmmer2-2.3.2+dfsg/src/camJul97.c:327: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 buf[2048]; data/hmmer2-2.3.2+dfsg/src/camJul97.c:351:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). idx = atoi(sqd_parse[1]); data/hmmer2-2.3.2+dfsg/src/display.c:354: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 src_str[6]; /* buffer for source state label */ data/hmmer2-2.3.2+dfsg/src/display.c:355: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 dest_str[6]; /* buffer for destination state label */ data/hmmer2-2.3.2+dfsg/src/display.c:411:15: [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. case STM: sprintf (src_str, "M%d", ksrc); break; data/hmmer2-2.3.2+dfsg/src/display.c:412:15: [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. case STD: sprintf (src_str, "D%d", ksrc); break; data/hmmer2-2.3.2+dfsg/src/display.c:413:15: [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. case STI: sprintf (src_str, "I%d", ksrc); break; data/hmmer2-2.3.2+dfsg/src/display.c:426:15: [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. case STM: sprintf (dest_str, "M%d", kdest); break; data/hmmer2-2.3.2+dfsg/src/display.c:427:15: [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. case STD: sprintf (dest_str, "D%d", kdest); break; data/hmmer2-2.3.2+dfsg/src/display.c:428:15: [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. case STI: sprintf (dest_str, "I%d", kdest); break; data/hmmer2-2.3.2+dfsg/src/globals.h:23:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Alphabet[MAXCODE+1]; /* ACGT, for instance */ data/hmmer2-2.3.2+dfsg/src/globals.h:27:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Degenerate[MAXCODE][MAXABET]; /* 1/0 arrays, for whether IUPAC code includes a residue */ data/hmmer2-2.3.2+dfsg/src/histogram.c:195: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[81]; /* output line buffer */ data/hmmer2-2.3.2+dfsg/src/histogram.c:285: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(buffer, "%5d %6d %6d|", data/hmmer2-2.3.2+dfsg/src/hmmalign.c:239:33: [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 (outfile != NULL && (ofp = fopen(outfile, "w")) != NULL) data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:153: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 fpopts[3]; /* options to open a file with, e.g. "ab" */ data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:242:65: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--pbswitch")== 0) pbswitch = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:296: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 ((hmmfp = fopen(hmmfile, fpopts)) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:303: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 ((cfp = fopen(cfile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:309: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). if ((alignfp = fopen(align_ofile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:141:12: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char *tmpfile; /* temporary calibrated HMM file */ data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:203:67: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (strcmp(optname, "--cpu") == 0) num_threads = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:204:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--fixed") == 0) fixedlen = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:207:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--num") == 0) nsample = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:210:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--seed") == 0) seed = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:241: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 ((hfp = fopen(histfile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:255:10: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). strcpy(tmpfile, hmmfile); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:256: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(tmpfile, ".xxx"); /* could be more inventive here... */ data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:256:10: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). strcat(tmpfile, ".xxx"); /* could be more inventive here... */ data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:257:18: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if (FileExists(tmpfile)) data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:258:69: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). Die("temporary file %s already exists; please delete it first", tmpfile); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:363:18: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if (FileExists(tmpfile)) data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:364:61: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). Die("Ouch. Temporary file %s appeared during the run.", tmpfile); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:365: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(tmpfile, mode)) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:365:22: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if ((outfp = fopen(tmpfile, mode)) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:366:68: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). Die("Ouch. Temporary file %s couldn't be opened for writing.", tmpfile); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:406:14: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if (rename(tmpfile, hmmfile) != 0) PANIC; data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:408:8: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). free(tmpfile); data/hmmer2-2.3.2+dfsg/src/hmmconvert.c:161: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(outfile, mode)) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmemit.c:97:61: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-n") == 0) nseq = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmemit.c:100:61: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--seed") == 0) seed = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmemit.c:131: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(ofile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmemit.c:181:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(sqinfo.desc, "profile HMM generated consensus sequence [hmmemit]"); data/hmmer2-2.3.2+dfsg/src/hmmemit.c:206: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(sqinfo[i].name, "seq%d", i+1); data/hmmer2-2.3.2+dfsg/src/hmmfetch.c:104:12: [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). nhmm = atoi(key); data/hmmer2-2.3.2+dfsg/src/hmmio.c:158: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 buf[512]; data/hmmer2-2.3.2+dfsg/src/hmmio.c:178:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((hmmfp->f = fopen(hmmfile, "r")) != NULL) data/hmmer2-2.3.2+dfsg/src/hmmio.c:569: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[512]; data/hmmer2-2.3.2+dfsg/src/hmmio.c:590:52: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strncmp(buffer, "LENG ", 5) == 0) M = atoi(buffer+6); data/hmmer2-2.3.2+dfsg/src/hmmio.c:591: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). else if (strncmp(buffer, "NSEQ ", 5) == 0) hmm->nseq = atoi(buffer+6); data/hmmer2-2.3.2+dfsg/src/hmmio.c:694:64: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strncmp(buffer, "CKSUM", 5) == 0) hmm->checksum = atoi(buffer+6); data/hmmer2-2.3.2+dfsg/src/hmmio.c:724: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). if (atoi(s) != k) goto FAILURE; data/hmmer2-2.3.2+dfsg/src/hmmio.c:731:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). hmm->map[k] = atoi(s); data/hmmer2-2.3.2+dfsg/src/hmmio.c:971: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[512]; data/hmmer2-2.3.2+dfsg/src/hmmio.c:985:68: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((s = Getword(fp, sqdARG_INT)) == NULL) goto FAILURE; M = atoi(s); /* model length */ data/hmmer2-2.3.2+dfsg/src/hmmio.c:1147: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[512]; data/hmmer2-2.3.2+dfsg/src/hmmio.c:1272: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. static char buffer[8]; data/hmmer2-2.3.2+dfsg/src/hmmio.c:1275: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(buffer, "%6d", Prob2Score(p, null)); data/hmmer2-2.3.2+dfsg/src/hmmio.c:1287:40: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). return (*s == '*') ? 0. : Score2Prob(atoi(s), null); data/hmmer2-2.3.2+dfsg/src/hmmio.c:1447: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 abet[20]; /* alphabet (read but ignored) */ data/hmmer2-2.3.2+dfsg/src/hmmio.c:1588: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[512]; data/hmmer2-2.3.2+dfsg/src/hmmio.c:1600:7: [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). M = atoi(s); data/hmmer2-2.3.2+dfsg/src/hmmio.c:1605:11: [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). asize = atoi(s); data/hmmer2-2.3.2+dfsg/src/hmmio.c:1650:11: [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). k = atoi(s); data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:238:66: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-A") == 0) Alimit = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:241:66: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-Z") == 0) thresh.Z = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:244:66: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--cpu") == 0) num_threads = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:705: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 slavename[32]; /* name of HMM that slave actually did */ data/hmmer2-2.3.2+dfsg/src/hmmpostal.c:553:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fp = fopen(align_ofile, "w")) == NULL) { data/hmmer2-2.3.2+dfsg/src/hmmpostal.c:623: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). if ((fp = fopen(hmmfile, "a")) == NULL) { data/hmmer2-2.3.2+dfsg/src/hmmpostal.c:631: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). if ((fp = fopen(hmmfile, "w")) == NULL) { data/hmmer2-2.3.2+dfsg/src/hmmpostal.c:710: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(cfile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/src/hmmsearch.c:229:66: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (strcmp(optname, "-A") == 0) Alimit = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmsearch.c:232:66: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-Z") == 0) thresh.Z = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/hmmsearch.c:234:66: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "--cpu") == 0) num_threads = atoi(optarg); data/hmmer2-2.3.2+dfsg/src/misc.c:78: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. static char buffer[512]; data/hmmer2-2.3.2+dfsg/src/prior.c:104: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(prifile, "r")) == NULL) data/hmmer2-2.3.2+dfsg/src/prior.c:140:15: [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). pri->tnum = atoi(Getword(fp, sqdARG_INT)); data/hmmer2-2.3.2+dfsg/src/prior.c:158:15: [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). pri->mnum = atoi(Getword(fp, sqdARG_INT)); data/hmmer2-2.3.2+dfsg/src/prior.c:177:15: [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). pri->inum = atoi(Getword(fp, sqdARG_INT)); data/hmmer2-2.3.2+dfsg/src/prior.c:234: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(pamfile, "r")) == NULL && data/hmmer2-2.3.2+dfsg/src/prior.c:301: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(rndfile, "r")) == NULL) data/hmmer2-2.3.2+dfsg/src/states.c:251: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(hmm1->xray, hmm2->xray, NINPUTS * (hmm2->M+2) * sizeof(float)); data/hmmer2-2.3.2+dfsg/src/states.c:252: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(hmm1->null, hmm2->null, sizeof(float) * Alphabet_size); data/hmmer2-2.3.2+dfsg/src/structs.h:54:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char Alphabet[MAXCODE+1]; /* "ACDEFGHIKLMNPQRSTVWYBZX" for example */ data/hmmer2-2.3.2+dfsg/src/structs.h:58:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char Degenerate[MAXCODE][MAXABET]; data/hmmer2-2.3.2+dfsg/src/threads.c:87:11: [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). num = atoi(env); data/hmmer2-2.3.2+dfsg/src/trace.c:811: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[ALILENGTH+1]; /* output line buffer */ data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c:125:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (strcmp(optname, "-e") == 0) { nevd = atoi(optarg); } data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c:128:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-g") == 0) { ngauss = atoi(optarg); } data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c:129:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-n") == 0) { ntrials = atoi(optarg); } data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c:130:63: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). else if (strcmp(optname, "-s") == 0) { seed = atoi(optarg); } data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c:174:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((xmgrfp = fopen(xmgrfile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/testsuite/evd_test.c:177: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). if ((logfp = fopen(logfile, "w")) == NULL) data/hmmer2-2.3.2+dfsg/testsuite/fitting_test.c:33:8: [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[3]); /* # of histograms */ data/hmmer2-2.3.2+dfsg/testsuite/fitting_test.c:34:12: [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). do_evd = atoi(argv[4]); /* 1 to sample EVD; 0 to sample Gaussian */ data/hmmer2-2.3.2+dfsg/testsuite/fitting_test.c:35: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). set = atoi(argv[5]); /* 1 to set instead of fit the dist */ data/hmmer2-2.3.2+dfsg/testsuite/fitting_test.c:36:13: [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). fit_evd = atoi(argv[6]); /* 1 to fit EVD; 0 to fit Gaussian */ data/hmmer2-2.3.2+dfsg/testsuite/fitting_test.c:37:15: [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). show_hist = atoi(argv[7]); /* 1 to show histogram */ data/hmmer2-2.3.2+dfsg/testsuite/tophits_test.c:71:57: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (strcmp(optname, "-s") == 0) { seed = atoi(optarg); } data/hmmer2-2.3.2+dfsg/testsuite/viterbi_exercise.c:128:4: [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(sqinfo.name, "seq%d", i+1); data/hmmer2-2.3.2+dfsg/src/alphabet.c:419:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DegenCount[strchr(Alphabet,iupac)-Alphabet] = strlen(syms); data/hmmer2-2.3.2+dfsg/src/display.c:414:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STS: sprintf (src_str, "S"); break; data/hmmer2-2.3.2+dfsg/src/display.c:415:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STN: sprintf (src_str, "N"); break; data/hmmer2-2.3.2+dfsg/src/display.c:416:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STB: sprintf (src_str, "B"); break; data/hmmer2-2.3.2+dfsg/src/display.c:417:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STE: sprintf (src_str, "E"); break; data/hmmer2-2.3.2+dfsg/src/display.c:418:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STC: sprintf (src_str, "C"); break; data/hmmer2-2.3.2+dfsg/src/display.c:419:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STJ: sprintf (src_str, "J"); break; data/hmmer2-2.3.2+dfsg/src/display.c:420:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STT: sprintf (src_str, "T"); break; data/hmmer2-2.3.2+dfsg/src/display.c:429:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STS: sprintf (dest_str, "S"); break; data/hmmer2-2.3.2+dfsg/src/display.c:430:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STN: sprintf (dest_str, "N"); break; data/hmmer2-2.3.2+dfsg/src/display.c:431:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STB: sprintf (dest_str, "B"); break; data/hmmer2-2.3.2+dfsg/src/display.c:432:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STE: sprintf (dest_str, "E"); break; data/hmmer2-2.3.2+dfsg/src/display.c:433:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STC: sprintf (dest_str, "C"); break; data/hmmer2-2.3.2+dfsg/src/display.c:434:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STJ: sprintf (dest_str, "J"); break; data/hmmer2-2.3.2+dfsg/src/display.c:435:15: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. case STT: sprintf (dest_str, "T"); break; data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:293:18: [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. if (do_append) strcpy(fpopts, "a"); data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:294:18: [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 strcpy(fpopts, "w"); data/hmmer2-2.3.2+dfsg/src/hmmbuild.c:295:18: [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 (do_binary) strcat(fpopts, "b"); data/hmmer2-2.3.2+dfsg/src/hmmcalibrate.c:254: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). tmpfile = MallocOrDie(strlen(hmmfile) + 5); data/hmmer2-2.3.2+dfsg/src/hmmindex.c:94: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). ssifile = MallocOrDie(strlen(hmmfile) + 5); data/hmmer2-2.3.2+dfsg/src/hmmio.c:180:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssifile = MallocOrDie(sizeof(char) * (strlen(hmmfile) + 5)); data/hmmer2-2.3.2+dfsg/src/hmmio.c:191:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssifile = MallocOrDie(sizeof(char) * (strlen(full) + strlen(hmmfile) + 5)); data/hmmer2-2.3.2+dfsg/src/hmmio.c:191:60: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssifile = MallocOrDie(sizeof(char) * (strlen(full) + strlen(hmmfile) + 5)); data/hmmer2-2.3.2+dfsg/src/hmmio.c:623: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). (strlen(hmm->comlog) + 1 + strlen(buffer+6))); data/hmmer2-2.3.2+dfsg/src/hmmio.c:623: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). (strlen(hmm->comlog) + 1 + strlen(buffer+6))); data/hmmer2-2.3.2+dfsg/src/hmmio.c:624:6: [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. strcat(hmm->comlog, "\n"); data/hmmer2-2.3.2+dfsg/src/hmmio.c:1338: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(s) + 1; data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:387: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). if (desc != NULL && strlen(desc) < 80) data/hmmer2-2.3.2+dfsg/src/hmmpfam.c:734: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). arglen = strlen(hmmfile); data/hmmer2-2.3.2+dfsg/src/hmmsearch.c:420:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (desc != NULL && strlen(desc) < 80) data/hmmer2-2.3.2+dfsg/src/misc.c:92: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(sptr) == 0) { data/hmmer2-2.3.2+dfsg/src/plan7.c:289: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). len += strlen(argv[i]); data/hmmer2-2.3.2+dfsg/src/plan7.c:294: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). len += strlen(hmm->comlog); data/hmmer2-2.3.2+dfsg/src/plan7.c:304:3: [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. strcat(hmm->comlog, "\n"); data/hmmer2-2.3.2+dfsg/src/plan7.c:308:23: [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 (i < argc-1) strcat(hmm->comlog, " "); data/hmmer2-2.3.2+dfsg/src/pvm.c:263: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 = (s == NULL) ? -1 : strlen(s); data/hmmer2-2.3.2+dfsg/src/tophits.c:261: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(h->unsrt[i].name); data/hmmer2-2.3.2+dfsg/src/tophits.c:342: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). memused += strlen(h->unsrt[i].name) + 1; data/hmmer2-2.3.2+dfsg/src/tophits.c:344: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). memused += strlen(h->unsrt[i].acc) + 1; data/hmmer2-2.3.2+dfsg/src/tophits.c:346: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). memused += strlen(h->unsrt[i].desc) + 1; data/hmmer2-2.3.2+dfsg/src/tophits.c:359: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). memused += strlen(h->unsrt[i].ali->query) + 1; data/hmmer2-2.3.2+dfsg/src/tophits.c:361: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). memused += strlen(h->unsrt[i].ali->target) + 1; data/hmmer2-2.3.2+dfsg/src/trace.c:529: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). msa->au = MallocOrDie(sizeof(char) * (strlen(PACKAGE_VERSION)+7)); data/hmmer2-2.3.2+dfsg/src/trace.c:826:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, ali->csline+pos, ALILENGTH); data/hmmer2-2.3.2+dfsg/src/trace.c:830:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, ali->rfline+pos, ALILENGTH); data/hmmer2-2.3.2+dfsg/src/trace.c:834:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, ali->model+pos, ALILENGTH); data/hmmer2-2.3.2+dfsg/src/trace.c:838:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, ali->mline+pos, ALILENGTH); data/hmmer2-2.3.2+dfsg/src/trace.c:842:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, ali->aseq+pos, ALILENGTH); data/hmmer2-2.3.2+dfsg/testsuite/alignalign_test.c:177: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). rlen = strlen(rseq[idx]); data/hmmer2-2.3.2+dfsg/testsuite/masks_test.c:96:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = (int) strlen(seq); ANALYSIS SUMMARY: Hits = 175 Lines analyzed = 26550 in approximately 0.96 seconds (27563 lines/second) Physical Source Lines of Code (SLOC) = 15731 Hits@level = [0] 442 [1] 50 [2] 106 [3] 1 [4] 18 [5] 0 Hits@level+ = [0+] 617 [1+] 175 [2+] 125 [3+] 19 [4+] 18 [5+] 0 Hits/KSLOC@level+ = [0+] 39.2219 [1+] 11.1245 [2+] 7.94609 [3+] 1.20781 [4+] 1.14424 [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.