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/anfo-0.98/src/align.h
Examining data/anfo-0.98/src/align_fwd.h
Examining data/anfo-0.98/src/compress_stream.h
Examining data/anfo-0.98/src/concurrent_stream.h
Examining data/anfo-0.98/src/ducttape.h
Examining data/anfo-0.98/src/index.h
Examining data/anfo-0.98/src/logdom.h
Examining data/anfo-0.98/src/misc_streams.h
Examining data/anfo-0.98/src/output_streams.h
Examining data/anfo-0.98/src/sequence.h
Examining data/anfo-0.98/src/trim.h
Examining data/anfo-0.98/src/align.cc
Examining data/anfo-0.98/src/anfo_common.cc
Examining data/anfo-0.98/src/concurrent_stream.cc
Examining data/anfo-0.98/src/ducttape.cc
Examining data/anfo-0.98/src/index.cc
Examining data/anfo-0.98/src/misc_streams.cc
Examining data/anfo-0.98/src/output_streams.cc
Examining data/anfo-0.98/src/sequence.cc
Examining data/anfo-0.98/src/stream.cc
Examining data/anfo-0.98/src/util.cc
Examining data/anfo-0.98/src/anfo-elk.cc
Examining data/anfo-0.98/src/fastlz.h
Examining data/anfo-0.98/src/fastlz.c
Examining data/anfo-0.98/src/anfo.cc
Examining data/anfo-0.98/src/dnaindex.cc
Examining data/anfo-0.98/src/fa2dna.cc
Examining data/anfo-0.98/src/file-info.cc
Examining data/anfo-0.98/src/index-test.cc
Examining data/anfo-0.98/src/anfo-tool.cc
Examining data/anfo-0.98/src/anfo_common.h
Examining data/anfo-0.98/src/conffile.h
Examining data/anfo-0.98/src/stream.h
Examining data/anfo-0.98/src/util.h

FINAL RESULTS:

data/anfo-0.98/src/anfo.cc:172:26:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if( !clobber && 0 == access( output_file, F_OK ) ) return 0 ;
data/anfo-0.98/src/anfo.cc:253:12:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if( 0 == access( of.c_str(), F_OK ) ) {
data/anfo-0.98/src/conffile.h:63:12:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	else if( !access( "anfo.cfg", F_OK ) ) return parse_text_config( "anfo.cfg" ) ;
data/anfo-0.98/src/conffile.h:64:12:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	else if( !access( ".anfo.cfg", F_OK ) ) return parse_text_config( ".anfo.cfg" ) ;
data/anfo-0.98/src/conffile.h:67:8:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if( !access( f.c_str(), F_OK ) ) return parse_text_config( f.c_str() ) ;
data/anfo-0.98/src/misc_streams.cc:210:7:  [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.
		if( system( cmd.c_str() ) ) break ;;
data/anfo-0.98/src/stream.cc:1225:45:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if( !is_.get() ) throw_errno_if_minus1( access( name_.c_str(), R_OK ), "accessing ", name_.c_str() ) ;
data/anfo-0.98/src/stream.cc:1524:3:  [4] (shell) execl:
  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.
		execl( "/bin/sh", "sh", "-c", c, (char*)0 ) ;
data/anfo-0.98/src/stream.cc:1545:3:  [4] (shell) execl:
  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.
		execl( "/bin/sh", "sh", "-c", c, (char*)0 ) ;
data/anfo-0.98/src/anfo.cc:122:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if( const char *t = getenv( "SGE_TASK_ID" ) ) task_id = atoi( t ) -1 ; 
data/anfo-0.98/src/anfo.cc:123:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if( const char *t = getenv( "NSLOTS" ) ) nthreads = atoi( t ) ;
data/anfo-0.98/src/anfo.cc:235:27:  [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( const char *jobid = getenv( "SGE_JOB_ID" ) ) ohdr.set_sge_job_id( atoi( jobid ) ) ;
data/anfo-0.98/src/anfo.cc:236:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		if( const char *taskid = getenv( "SGE_TASK_ID" ) ) ohdr.set_sge_task_id( atoi( taskid ) ) ;
data/anfo-0.98/src/conffile.h:66:19:  [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.
		std::string f = getenv( "HOME" ) + std::string( "/.anfo.cfg" ) ;
data/anfo-0.98/src/index.cc:322:40:  [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.
Metagenome Metagenome::the_metagenome( getenv("ANFO_PATH") ) ;
data/anfo-0.98/src/index.cc:334:15:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	for( int i = random() % nephemeral ; i || gi->second->refcount_ ; ++gi ) if( gi->second->refcount_ == 0 ) --i ;
data/anfo-0.98/src/misc_streams.cc:208:34:  [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.
	string cmd = (editor_.empty() ? getenv("EDITOR") : editor_) + " " + tmpname ;
data/anfo-0.98/src/stream.cc:798:15:  [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.
	return f_ >= drand48() ;
data/anfo-0.98/src/util.cc:73:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	const char *base = getenv("ANFO_TEMP") ;
data/anfo-0.98/src/util.cc:74:21:  [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( !base ) base = getenv("TMPDIR") ;
data/anfo-0.98/src/util.cc:75:21:  [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( !base ) base = getenv("TEMP") ;
data/anfo-0.98/src/util.cc:76:21:  [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( !base ) base = getenv("TMP") ;
data/anfo-0.98/src/util.h:160:23:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		if( const char *p = getenv(env_var) ) {
data/anfo-0.98/src/anfo-elk.cc:113:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
								open( nm.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666 ),
data/anfo-0.98/src/anfo.cc:122:58:  [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( const char *t = getenv( "SGE_TASK_ID" ) ) task_id = atoi( t ) -1 ; 
data/anfo-0.98/src/anfo.cc:123:54:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	if( const char *t = getenv( "NSLOTS" ) ) nthreads = atoi( t ) ;
data/anfo-0.98/src/anfo.cc:235:73:  [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( const char *jobid = getenv( "SGE_JOB_ID" ) ) ohdr.set_sge_job_id( atoi( jobid ) ) ;
data/anfo-0.98/src/anfo.cc:236:76:  [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( const char *taskid = getenv( "SGE_TASK_ID" ) ) ohdr.set_sge_task_id( atoi( taskid ) ) ;
data/anfo-0.98/src/compress_stream.h:229: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 obuf_[15500] ;
data/anfo-0.98/src/compress_stream.h:318: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 ibuf_[15500] ;
data/anfo-0.98/src/compress_stream.h:398:28:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
				throw_errno_if_minus1( open( name, O_WRONLY | O_CREAT, 0666 ),
data/anfo-0.98/src/ducttape.cc:580: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[12] ;
data/anfo-0.98/src/file-info.cc:50:4:  [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[ len ] ;
data/anfo-0.98/src/file-info.cc:65:4:  [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[ len ] ;
data/anfo-0.98/src/index.cc:48:32:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fd_ = throw_errno_if_minus1( open( name.c_str(), O_RDONLY ), "opening", name.c_str() ) ;
data/anfo-0.98/src/index.cc:472:4:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			open( "/dev/zero", O_RDWR ), "opening", "/dev/zero" ) ;
data/anfo-0.98/src/misc_streams.cc:202:11:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	int fd = mkstemp( tmpname ) ;
data/anfo-0.98/src/sequence.cc:364: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 tag[2] ;
data/anfo-0.98/src/stream.cc:1232:36:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			int fd = throw_errno_if_minus1( open( name_.c_str(), O_RDONLY ), "opening (UniversalReader) ", name_.c_str() ) ;
data/anfo-0.98/src/util.cc:79: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  n1[ strlen(base) + strlen(suffix) + 1 ] ;
data/anfo-0.98/src/util.cc:84:37:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    int fd = throw_errno_if_minus1( mkstemp( n1 ), "making temp file" ) ;
data/anfo-0.98/src/util.h:130:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		int fd = open( s.c_str(), O_RDONLY ) ;
data/anfo-0.98/src/util.h:235:39:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		Console() : loglevel(warning), fd_( open( "/dev/tty", O_WRONLY ) ), next_(0) {}
data/anfo-0.98/src/anfo-elk.cc:189:50:  [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).
		catch( const char *e ) { err = Make_String( e, strlen(e) ) ; } \
data/anfo-0.98/src/anfo-elk.cc:398:50:  [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).
		r = Cons( Make_String( the_glob.gl_pathv[i-1], strlen( the_glob.gl_pathv[i-1] ) ), r ) ;
data/anfo-0.98/src/anfo-elk.cc:404: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).
Object p_version() { return Make_String( PACKAGE_VERSION, strlen(PACKAGE_VERSION) ) ; }
data/anfo-0.98/src/anfo_common.cc:146:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	const output::Read &rd = res_.read() ;
data/anfo-0.98/src/anfo_common.cc:207:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	Policy p = select_policy( conf_, res_.read()  ) ;
data/anfo-0.98/src/anfo_common.cc:239:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					effective_sequence( res_.read() ), seeds, params, &num_useless ) ;
data/anfo-0.98/src/anfo_common.cc:361:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	QSequence qs( res_.read() ) ;
data/anfo-0.98/src/ducttape.cc:301:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( AlnIter aln_i( r.read(), *h ), aln_e( r.read(), *h, 1 ) ; aln_i != aln_e ; ++aln_i )
data/anfo-0.98/src/ducttape.cc:301:47:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( AlnIter aln_i( r.read(), *h ), aln_e( r.read(), *h, 1 ) ; aln_i != aln_e ; ++aln_i )
data/anfo-0.98/src/ducttape.cc:313:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( AlnIter aln_b( r.read(), *h ), aln_i( aln_b ), aln_e( r.read(), *h, 1 ) ;
data/anfo-0.98/src/ducttape.cc:313:63:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( AlnIter aln_b( r.read(), *h ), aln_i( aln_b ), aln_e( r.read(), *h, 1 ) ;
data/anfo-0.98/src/ducttape.cc:470:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( AlnIter aln_b( r.read(), *h ), aln_i( aln_b ), aln_e( r.read(), *h, 1 ) ;
data/anfo-0.98/src/ducttape.cc:470:63:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( AlnIter aln_b( r.read(), *h ), aln_i( aln_b ), aln_e( r.read(), *h, 1 ) ;
data/anfo-0.98/src/ducttape.cc:548:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	const Read& r = rr.read() ;
data/anfo-0.98/src/ducttape.cc:634:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	const Read& r = res.read() ;
data/anfo-0.98/src/file-info.cc:43:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		fd.read( (char*)&sig, 4 ) ;
data/anfo-0.98/src/file-info.cc:48:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			fd.read( (char*)&off, 4 ) ;
data/anfo-0.98/src/file-info.cc:49:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			fd.read( (char*)&len, 4 ) ;
data/anfo-0.98/src/file-info.cc:52:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			fd.read( (char*)buf, len ) ;
data/anfo-0.98/src/file-info.cc:64:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			fd.read( (char*)&len, 4 ) ;
data/anfo-0.98/src/file-info.cc:66:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			fd.read( (char*)buf, len ) ;
data/anfo-0.98/src/misc_streams.cc:47:10:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
					|| !equal( gs_.begin(), gs_.end(), h.is_sorted_by_coordinate().begin() ) )
data/anfo-0.98/src/misc_streams.cc:94:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	string min_name = rs_[ min_idx ].read().seqid() ;
data/anfo-0.98/src/misc_streams.cc:98:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if( rs_[i].read().seqid() == min_name )
data/anfo-0.98/src/misc_streams.cc:171:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		pair< size_t, Result > &p = buffer_[ r.read().seqid() ] ;
data/anfo-0.98/src/misc_streams.cc:182:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			buffer_.erase( r.read().seqid() ) ;
data/anfo-0.98/src/misc_streams.cc:309:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	unsigned bases = r.read().sequence().size() ;
data/anfo-0.98/src/misc_streams.cc:310:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	unsigned gc = count( r.read().sequence().begin(), r.read().sequence().end(), 'G' )
data/anfo-0.98/src/misc_streams.cc:310:54:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	unsigned gc = count( r.read().sequence().begin(), r.read().sequence().end(), 'G' )
data/anfo-0.98/src/misc_streams.cc:311:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		        + count( r.read().sequence().begin(), r.read().sequence().end(), 'C' ) ;
data/anfo-0.98/src/misc_streams.cc:311:51:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		        + count( r.read().sequence().begin(), r.read().sequence().end(), 'C' ) ;
data/anfo-0.98/src/misc_streams.h:33:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			return compare( *u, *v, a.read(), b.read(), false ) ;
data/anfo-0.98/src/misc_streams.h:33:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			return compare( *u, *v, a.read(), b.read(), false ) ;
data/anfo-0.98/src/misc_streams.h:41:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			return compare( *u, *v, a.read(), b.read(), false ) ;
data/anfo-0.98/src/misc_streams.h:41:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			return compare( *u, *v, a.read(), b.read(), false ) ;
data/anfo-0.98/src/misc_streams.h:88:11:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
			return equal( gs_.begin(), gs_.end(), h.is_sorted_by_coordinate().begin() ) ;
data/anfo-0.98/src/misc_streams.h:102:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		return a->read().seqid() < b->read().seqid() ;
data/anfo-0.98/src/misc_streams.h:102:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		return a->read().seqid() < b->read().seqid() ;
data/anfo-0.98/src/misc_streams.h:257:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					if( (*i)->read().seqid() == (*o)->read().seqid() )
data/anfo-0.98/src/misc_streams.h:257:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					if( (*i)->read().seqid() == (*o)->read().seqid() )
data/anfo-0.98/src/output_streams.cc:44:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			res.read().sequence().begin() + res.read().trim_left() ;
data/anfo-0.98/src/output_streams.cc:44:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			res.read().sequence().begin() + res.read().trim_left() ;
data/anfo-0.98/src/output_streams.cc:483:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (!result.read().has_seqid()) return no_seqid ;
data/anfo-0.98/src/output_streams.cc:484:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (!result.read().has_sequence()) return no_seq ;
data/anfo-0.98/src/output_streams.cc:490:51:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if( len_from_bin_cigar( hit.cigar() ) != result.read().sequence().length() ) return bad_cigar ;
data/anfo-0.98/src/output_streams.cc:496:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		*out_ << /*QNAME*/  result.read().seqid() << '\t'
data/anfo-0.98/src/output_streams.cc:507:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				<< /*SEQ*/ result.read().sequence() << '\t' ;
data/anfo-0.98/src/output_streams.cc:509:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if( result.read().has_quality() ) /*QUAL*/   
data/anfo-0.98/src/output_streams.cc:510:37:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				for (size_t i = 0 ; i != result.read().quality().size() ; ++i )
data/anfo-0.98/src/output_streams.cc:511:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					*out_ << qual_to_sam( result.read().quality()[i] ) ;
data/anfo-0.98/src/output_streams.cc:521:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			const std::string& s = result.read().sequence() ;
data/anfo-0.98/src/output_streams.cc:534:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if( result.read().has_quality() ) /*QUAL*/   
data/anfo-0.98/src/output_streams.cc:535:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				for (size_t i = result.read().quality().size() ; i != 0 ; --i )
data/anfo-0.98/src/output_streams.cc:536:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					*out_ << qual_to_sam( result.read().quality()[i-1] ) ;
data/anfo-0.98/src/output_streams.cc:549:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		*out_ << /*QNAME*/  result.read().seqid() << '\t'
data/anfo-0.98/src/output_streams.cc:552:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			<< /*SEQ*/ result.read().sequence() << '\t' ;
data/anfo-0.98/src/output_streams.cc:554:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if( result.read().has_quality() ) /*QUAL*/   
data/anfo-0.98/src/output_streams.cc:555:36:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			for (size_t i = 0 ; i != result.read().quality().size() ; ++i )
data/anfo-0.98/src/output_streams.cc:556:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				*out_ << qual_to_sam( result.read().quality()[i] ) ;
data/anfo-0.98/src/output_streams.cc:594:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				<< '>' << r.read().seqid() 
data/anfo-0.98/src/output_streams.cc:595:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				<< ( r.read().has_trim_right() ? " adapter cut off\n" : "\n" ) 
data/anfo-0.98/src/output_streams.cc:603:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    const output::Read& r = rr.read() ;
data/anfo-0.98/src/output_streams.cc:628:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		int e = r.read().has_trim_right() ? r.read().trim_right() : r.read().sequence().size() ;
data/anfo-0.98/src/output_streams.cc:628:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		int e = r.read().has_trim_right() ? r.read().trim_right() : r.read().sequence().size() ;
data/anfo-0.98/src/output_streams.cc:628:65:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		int e = r.read().has_trim_right() ? r.read().trim_right() : r.read().sequence().size() ;
data/anfo-0.98/src/output_streams.cc:629:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		int b = r.read().trim_left() ;
data/anfo-0.98/src/output_streams.cc:639:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if( !r.read().depth_size() ) return ;
data/anfo-0.98/src/output_streams.cc:652:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while( alnpos != r.read().depth_size() && cigar_maj != h->cigar_size() ) {
data/anfo-0.98/src/output_streams.cc:658:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				*out_ << r.read().depth(alnpos) << '\n' ;
data/anfo-0.98/src/sequence.cc:379:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if( r.read().has_quality() ) std::reverse( r.mutable_read()->mutable_quality()->begin(), r.mutable_read()->mutable_quality()->end() ) ;
data/anfo-0.98/src/stream.cc:514:4:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
			equal( lhs.is_sorted_by_coordinate().begin(), lhs.is_sorted_by_coordinate().end(), rhs.is_sorted_by_coordinate().begin() ) ;
data/anfo-0.98/src/stream.cc:745:43:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return slope_ * ( effective_length( r.read() ) - intercept_ ) >= score ;
data/anfo-0.98/src/stream.cc:753:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	const Read& r = h.read() ;
data/anfo-0.98/src/stream.cc:764:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int len = effective_length( r.read() ) ;
data/anfo-0.98/src/stream.cc:771:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	const Read& rr = r.read() ;
data/anfo-0.98/src/stream.cc:806:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		!comp( *l, *r, lhs.read(), rhs.read() ) &&
data/anfo-0.98/src/stream.cc:806:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		!comp( *l, *r, lhs.read(), rhs.read() ) &&
data/anfo-0.98/src/stream.cc:807:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		!comp( *r, *l, rhs.read(), lhs.read() ) ;
data/anfo-0.98/src/stream.cc:807:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		!comp( *r, *l, rhs.read(), lhs.read() ) ;
data/anfo-0.98/src/stream.cc:827:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		*cur_.add_members() = rhs.read() ;
data/anfo-0.98/src/stream.cc:837:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for( size_t i = 0 ; i != rhs.read().sequence().size() ; ++i )
data/anfo-0.98/src/stream.cc:840:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		switch( rhs.read().sequence()[i] ) {
data/anfo-0.98/src/stream.cc:849:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					rhs.read().has_quality() ? rhs.read().quality()[i] : 30 ) ) ;
data/anfo-0.98/src/stream.cc:849:37:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					rhs.read().has_quality() ? rhs.read().quality()[i] : 30 ) ) ;
data/anfo-0.98/src/stream.cc:927:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				quals_[i].resize( cur_.read().sequence().size() ) ;
data/anfo-0.98/src/stream.cc:955:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			quals_[i].resize( cur_.read().sequence().size() ) ;
data/anfo-0.98/src/stream.cc:971:49:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				cur_.mutable_read()->set_seqid( "C_" + cur_.read().seqid() ) ;
data/anfo-0.98/src/stream.cc:999:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			quals_[i].resize( cur_.read().sequence().size() ) ;
data/anfo-0.98/src/stream.cc:1083:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if( r.read().has_quality() ) 
data/anfo-0.98/src/stream.cc:1084:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		for( size_t i = 0 ; i != r.read().sequence().size() && i != r.read().quality().size() ; ++i )
data/anfo-0.98/src/stream.cc:1084:65:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		for( size_t i = 0 ; i != r.read().sequence().size() && i != r.read().quality().size() ; ++i )
data/anfo-0.98/src/stream.cc:1085:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if( r.read().quality()[i] < q_ ) (*r.mutable_read()->mutable_sequence())[i] = 'N' ;
data/anfo-0.98/src/stream.cc:1333:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		res_.mutable_read()->set_trim_right( res_.read().sequence().size() - min( clip_qual_right, clip_adapter_right ) ) ;
data/anfo-0.98/src/stream.cc:1335:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		res_.mutable_read()->set_trim_right( res_.read().sequence().size() - clip_qual_right ) ;
data/anfo-0.98/src/stream.cc:1337:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		res_.mutable_read()->set_trim_right( res_.read().sequence().size() - clip_adapter_right ) ;
data/anfo-0.98/src/util.cc:79: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).
	char  n1[ strlen(base) + strlen(suffix) + 1 ] ;
data/anfo-0.98/src/util.cc:79: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).
	char  n1[ strlen(base) + strlen(suffix) + 1 ] ;
data/anfo-0.98/src/util.cc:101: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).
	mywrite( fd_, describe[l], strlen( describe[l] ) ) ;
data/anfo-0.98/src/util.h:119:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ssize_t w = read( fd, buf, count ) ;

ANALYSIS SUMMARY:

Hits = 142
Lines analyzed = 13254 in approximately 0.36 seconds (36852 lines/second)
Physical Source Lines of Code (SLOC) = 9078
Hits@level = [0]   0 [1]  99 [2]  20 [3]  14 [4]   9 [5]   0
Hits@level+ = [0+] 142 [1+] 142 [2+]  43 [3+]  23 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 15.6422 [1+] 15.6422 [2+] 4.73673 [3+] 2.5336 [4+] 0.991408 [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.