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/coils-2002/ncoils.c
Examining data/coils-2002/ncoils.h
Examining data/coils-2002/read_matrix.c

FINAL RESULTS:

data/coils-2002/ncoils.c:174:11:  [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(&seq[seqlen],buff); 
data/coils-2002/read_matrix.c:57:4:  [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.
			sscanf(buff,"%s %d %f %f %f %f %f",
data/coils-2002/read_matrix.c:74:5:  [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.
				sscanf(buff,"%s%f%f%f%f%f%f%f",
data/coils-2002/ncoils.c:63:10:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if((env=getenv("COILSDIR"))==NULL) env = __PKGDATADIR__;
data/coils-2002/ncoils.c:43:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char heptfile[HEPTFILELENGTH];
data/coils-2002/ncoils.c:71: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(&heptfile[strlen(heptfile)],"/new.mat");
data/coils-2002/ncoils.c:112:10:  [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((MAT=fopen(heptfile,"r"))==NULL) {
data/coils-2002/read_matrix.c:32:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buff[1000],junk[1000];
data/coils-2002/ncoils.c:70:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(&heptfile[0],env,HEPTFILELENGTH-1-8); // -1 for terminal 0, 8 for "/new.mat"
data/coils-2002/ncoils.c:71: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).
	strcpy(&heptfile[strlen(heptfile)],"/new.mat");
data/coils-2002/ncoils.c:78:14:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
             strncpy(&heptfile[0],argv[i+1],HEPTFILELENGTH-1);
data/coils-2002/ncoils.c:118: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).
	   for(i=0; i<strlen(AAs); ++i) if(AAs[i]!='_') {
data/coils-2002/ncoils.c:148: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).
		for(i=0; i<strlen(buff); ++i) if(buff[i]=='\n' || buff[i]=='\r') buff[i]='\0';
data/coils-2002/ncoils.c:169:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			seq=(char*)realloc(seq,(seqlen+strlen(buff)+1)*sizeof(char));
data/coils-2002/ncoils.c:175:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                        seqlen=strlen(seq);
data/coils-2002/ncoils.c:225:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len=strlen(seq);
data/coils-2002/read_matrix.c:36: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).
	aa_len = strlen(AAs);

ANALYSIS SUMMARY:

Hits = 17
Lines analyzed = 444 in approximately 0.12 seconds (3767 lines/second)
Physical Source Lines of Code (SLOC) = 338
Hits@level = [0]  40 [1]   9 [2]   4 [3]   1 [4]   3 [5]   0
Hits@level+ = [0+]  57 [1+]  17 [2+]   8 [3+]   4 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 168.639 [1+] 50.2959 [2+] 23.6686 [3+] 11.8343 [4+] 8.87574 [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.