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/phalanx-22+d051004/genmoves.c
Examining data/phalanx-22+d051004/hash.c
Examining data/phalanx-22+d051004/killers.c
Examining data/phalanx-22+d051004/learn.c
Examining data/phalanx-22+d051004/levels.c
Examining data/phalanx-22+d051004/moving.c
Examining data/phalanx-22+d051004/phalanx.c
Examining data/phalanx-22+d051004/static.c
Examining data/phalanx-22+d051004/book.c
Examining data/phalanx-22+d051004/search.c
Examining data/phalanx-22+d051004/phalanx.h
Examining data/phalanx-22+d051004/io.c
Examining data/phalanx-22+d051004/bcreate.c
Examining data/phalanx-22+d051004/endgame.c
Examining data/phalanx-22+d051004/data.c
Examining data/phalanx-22+d051004/evaluate.c

FINAL RESULTS:

data/phalanx-22+d051004/io.c:161:32:  [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( s == NULL ) puts(ss); else strcpy( s, ss );
data/phalanx-22+d051004/io.c:218:17:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
if( s == NULL ) printf(ss); else strcpy( s, ss );
data/phalanx-22+d051004/io.c:218:34:  [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( s == NULL ) printf(ss); else strcpy( s, ss );
data/phalanx-22+d051004/io.c:502:33:  [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( s == NULL ) puts(ss); else strcpy(s,ss);
data/phalanx-22+d051004/io.c:619:17:  [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( s != NULL ) strcpy( s, ss );
data/phalanx-22+d051004/io.c:679: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( s==NULL ) puts(ss); else strcpy(s,ss);
data/phalanx-22+d051004/phalanx.c:30: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(name,mode))	/* In the current directory? */
data/phalanx-22+d051004/phalanx.c:38:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(file,"%s/%s",path,name);
data/phalanx-22+d051004/phalanx.c:337:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  		sprintf(filename,"./%s",LEARN_FILE);
data/phalanx-22+d051004/phalanx.c:395:35:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
printf("tellics set 1 Phalanx "); printf(VERSION);
data/phalanx-22+d051004/bcreate.c:269:13:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while( (c=getopt(argc,argv,"b:p:c:v:g:w:d:l:u:")) != -1 )
data/phalanx-22+d051004/phalanx.c:28:16:  [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.
  else if((aux=getenv(env_variable))) /* In an environment variable? */
data/phalanx-22+d051004/phalanx.c:94:1:  [3] (random) srand:
  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.
srand( ((unsigned)time(NULL)) + ((unsigned)getpid()) );
data/phalanx-22+d051004/phalanx.c:140:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
while( ( c = getopt_long( argc, argv, "vf:T:t:p:s:x:c:o:r:b:e:l:S:P:L:g:",
data/phalanx-22+d051004/phalanx.c:143:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
while( ( c = getopt(argc,argv,"vf:T:t:p:s:x:c:o:r:b:e:l:S:P:L:g:") ) != -1 )
data/phalanx-22+d051004/bcreate.c:103:7:  [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).
		tb1=fopen("rbook.phalanx","rb");
data/phalanx-22+d051004/bcreate.c:104:7:  [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).
		tb2=fopen("rbook.phalanx.tmp","wb");
data/phalanx-22+d051004/bcreate.c:151: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 s[64];
data/phalanx-22+d051004/bcreate.c:177: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 piece[7];
data/phalanx-22+d051004/bcreate.c:178: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 file[10];
data/phalanx-22+d051004/bcreate.c:179: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 row[12];
data/phalanx-22+d051004/bcreate.c:212:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char m[128];
data/phalanx-22+d051004/bcreate.c:322: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).
	{ tb1 = fopen("rbook.phalanx", "w+"); }
data/phalanx-22+d051004/bcreate.c:340: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( ( f = fopen( SBOOK_FILE, "wb" ) ) == NULL )
data/phalanx-22+d051004/bcreate.c:348:7:  [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).
  tb1=fopen("rbook.phalanx","rb");
data/phalanx-22+d051004/book.c:43: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.
	const char P[14]=
data/phalanx-22+d051004/book.c:46: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( s, "%1X%1X", (Color==BLACK), G[Counter].castling & 0xF );
data/phalanx-22+d051004/book.c:53: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(&s[lenght],"%i",counter);
data/phalanx-22+d051004/book.c:57: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(&s[lenght],"%c",P[B[i]/8+(color(B[i])==BLACK)]);
data/phalanx-22+d051004/book.c:62:14:  [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.
	if(counter) sprintf(&s[lenght],"%i ",counter);
data/phalanx-22+d051004/book.c:277: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 s[256], p[256];
data/phalanx-22+d051004/book.c:328: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 p[256]; int i;
data/phalanx-22+d051004/book.c:357: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 s[128];
data/phalanx-22+d051004/book.c:359: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(s,"   0      0       0      0  book");
data/phalanx-22+d051004/book.c:361: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(s,"Book moves ");
data/phalanx-22+d051004/book.c:362:19:  [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.
			if( foundtxt ) sprintf(s+strlen(s),"1 ");
data/phalanx-22+d051004/book.c:363:9:  [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.
			else sprintf(s+strlen(s),"2 ");
data/phalanx-22+d051004/book.c:370:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
				char sm[64];
data/phalanx-22+d051004/book.c:419:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		  char ms[32]; int msi; int n;
data/phalanx-22+d051004/book.c:469:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		{ char t[128], * c;
data/phalanx-22+d051004/book.c:516: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 c[128]; postr(c); printf("%s\n",c); }
data/phalanx-22+d051004/data.c:33: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.
signed char Th_[80] =
data/phalanx-22+d051004/data.c:45: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.
signed char Tv_[80] =
data/phalanx-22+d051004/genmoves.c:8:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char pin[120];
data/phalanx-22+d051004/genmoves.c:9:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char tar[120];
data/phalanx-22+d051004/io.c:7: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 Inp[256] = "\0";
data/phalanx-22+d051004/io.c:8: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 piece[7] =
data/phalanx-22+d051004/io.c:10: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 file[10] =
data/phalanx-22+d051004/io.c:12: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 row[12] =
data/phalanx-22+d051004/io.c:77: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 s[8];
data/phalanx-22+d051004/io.c:118:4:  [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(Inp,"quit\n"); return; }
data/phalanx-22+d051004/io.c:138: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 ss[64];
data/phalanx-22+d051004/io.c:142:24:  [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 LONG_CASTLING:  sprintf( ss, "O-O-O  " ); goto endprint;
data/phalanx-22+d051004/io.c:143:24:  [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 SHORT_CASTLING: sprintf( ss, "O-O  " ); goto endprint;
data/phalanx-22+d051004/io.c:146:1:  [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( ss, "%c%c%c%c%c%c", piece[m.in1>>4],
data/phalanx-22+d051004/io.c:151:23:  [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.
if( m.in2a != m.in1 ) sprintf( ss+strlen(ss), "%c", piece[m.in2a>>4] );
data/phalanx-22+d051004/io.c:154:20:  [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.
if( m.dch != 100 ) sprintf( ss+strlen(ss), "/%i",m.dch );
data/phalanx-22+d051004/io.c:157:1:  [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( ss+strlen(ss), "  " );
data/phalanx-22+d051004/io.c:171: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 ss[8];  /* longest: "Nb1xd2+\0" */
data/phalanx-22+d051004/io.c:177:24:  [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 LONG_CASTLING:  sprintf( ss, "O-O-O" ); goto endprint;
data/phalanx-22+d051004/io.c:178:24:  [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 SHORT_CASTLING: sprintf( ss, "O-O" ); goto endprint;
data/phalanx-22+d051004/io.c:183: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( ss, "%c", file[mi->from%10] );
data/phalanx-22+d051004/io.c:185: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( ss+strlen(ss),
data/phalanx-22+d051004/io.c:188:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	else sprintf( ss+strlen(ss), "%c", row[mi->to/10] );
data/phalanx-22+d051004/io.c:190: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( ss+strlen(ss), "=%c", piece[mi->in2a>>4] );
data/phalanx-22+d051004/io.c:195:1:  [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( ss, "%c", piece[mi->in1>>4] );
data/phalanx-22+d051004/io.c:200: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( ss+strlen(ss), "%c", file[mi->from%10] );
data/phalanx-22+d051004/io.c:205: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( ss+strlen(ss), "%c", row[mi->from/10] );
data/phalanx-22+d051004/io.c:209:1:  [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( ss+strlen(ss), "%c%c", file[mi->to%10], row[mi->to/10] );
data/phalanx-22+d051004/io.c:280: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 bufik[32];
data/phalanx-22+d051004/io.c:465: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 ss[1024] = "";
data/phalanx-22+d051004/io.c:475: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 s1[1024] = "";
data/phalanx-22+d051004/io.c:497:14:  [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.
	if( j < 3 ) sprintf( ss+strlen(ss), "           " );
data/phalanx-22+d051004/io.c:518: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 ss[1024];
data/phalanx-22+d051004/io.c:557: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( ss, "%3i", A_d );
data/phalanx-22+d051004/io.c:559: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( ss+strlen(ss), "%7i", PV[0][0].value );
data/phalanx-22+d051004/io.c:560:22:  [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.
	else if( typ == 3 ) sprintf( ss+strlen(ss), " -> " );
data/phalanx-22+d051004/io.c:566: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( ss+strlen(ss), "%3i:%02i.%02li",
data/phalanx-22+d051004/io.c:571: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( ss+strlen(ss), " %5li", (long)(t-T1) );
data/phalanx-22+d051004/io.c:573: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( ss+strlen(ss), " %8lli  ", Nodes );
data/phalanx-22+d051004/io.c:577: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( ss,
data/phalanx-22+d051004/io.c:587: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( ss+strlen(ss), ", N/s=%i\n",
data/phalanx-22+d051004/io.c:597: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( ss+strlen(ss), "PV = " ); printPV(8,5,ss+strlen(ss));
data/phalanx-22+d051004/io.c:599: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( ss+strlen(ss),
data/phalanx-22+d051004/io.c:606: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( ss+strlen(ss), "!       \n" );
data/phalanx-22+d051004/io.c:608:9:  [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 3: sprintf( ss+strlen(ss), "%2i turn", Turns );
data/phalanx-22+d051004/io.c:609: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.
	if(Turns==1) sprintf( ss+strlen(ss), "                          \n");
data/phalanx-22+d051004/io.c:610: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.
	else         sprintf( ss+strlen(ss), "s                         \n");
data/phalanx-22+d051004/io.c:613: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( ss+strlen(ss), "??      \n" );
data/phalanx-22+d051004/io.c:616: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( ss+strlen(ss), "!!      \n" );
data/phalanx-22+d051004/io.c:631: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 s[256];
data/phalanx-22+d051004/io.c:636: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( s, "(%2i)", A_d );
data/phalanx-22+d051004/io.c:637: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( s+strlen(s), "   ");
data/phalanx-22+d051004/io.c:638: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( s+strlen(s), "%3li:%02li   ", t/60, t%60 );
data/phalanx-22+d051004/io.c:639: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( s+strlen(s), "%9lli  ", Nodes );
data/phalanx-22+d051004/io.c:640: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( s+strlen(s), "(%2i/%2i) ", i+1, n );
data/phalanx-22+d051004/io.c:642: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( s+strlen(s), "     " );
data/phalanx-22+d051004/io.c:653: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 ss[2048];
data/phalanx-22+d051004/io.c:655: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(ss, "  +---+---+---+---+---+---+---+---+\n  ");
data/phalanx-22+d051004/io.c:661: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(ss+strlen(ss),"| %c ",piece[B[i]>>4]);
data/phalanx-22+d051004/io.c:664: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(ss+strlen(ss),"| *%c",piece[B[i]>>4]);
data/phalanx-22+d051004/io.c:666:12:  [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.
		default: sprintf(ss+strlen(ss),"|   ");
data/phalanx-22+d051004/io.c:671: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(ss+strlen(ss),
data/phalanx-22+d051004/io.c:673:14:  [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.
			if(i!=10) sprintf(ss+strlen(ss),"\n  ");
data/phalanx-22+d051004/io.c:676:23:  [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.
	if( Color == WHITE ) sprintf(ss+strlen(ss),"   White to move\n");
data/phalanx-22+d051004/io.c:677:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	else sprintf(ss+strlen(ss),"   Black to move\n");
data/phalanx-22+d051004/io.c:985:37:  [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.
	if( fgets(Inp,255,stdin) == NULL ) strcpy(Inp,"quit\n");
data/phalanx-22+d051004/io.c:1345:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
				static char filename[16] = "notfound.fin";
data/phalanx-22+d051004/io.c:1347:11:  [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).
					nf = fopen(filename,"w");
data/phalanx-22+d051004/io.c:1348: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).
				else	nf = fopen(filename,"a");
data/phalanx-22+d051004/levels.c:34:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	moves = atoi(l);
data/phalanx-22+d051004/levels.c:47: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).
	minutes = atoi(l);
data/phalanx-22+d051004/levels.c:53: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).
		seconds = atoi(l);
data/phalanx-22+d051004/levels.c:60:14:  [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).
	increment = atoi(l);
data/phalanx-22+d051004/moving.c:92:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static unsigned char cb_[80] =
data/phalanx-22+d051004/phalanx.c:23: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 file[256];
data/phalanx-22+d051004/phalanx.c:209: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( ( Flag.log = fopen(optarg,"a") ) != NULL )
data/phalanx-22+d051004/phalanx.c:283: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 * positions[NPOS] =
data/phalanx-22+d051004/phalanx.c:321:11:  [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).
Sbook.f = fopen(SbookDir,"rb");
data/phalanx-22+d051004/phalanx.c:323:11:  [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).
Pbook.f = fopen(PbookDir,"rb");
data/phalanx-22+d051004/phalanx.c:325:7:  [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).
Eco = fopen(EcoDir,"rb");
data/phalanx-22+d051004/phalanx.c:330:12:  [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).
	Learn.f = fopen(LbookDir,"r+");
data/phalanx-22+d051004/phalanx.c:335: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 filename[256];
data/phalanx-22+d051004/phalanx.c:340: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).
		Learn.f = fopen(LbookDir,"w+");
data/phalanx-22+d051004/search.c:318: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 pb[2048];
data/phalanx-22+d051004/static.c:33: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.
signed char sqcolor_[80] =
data/phalanx-22+d051004/static.c:324:1:  [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( mB+20, mBinit, 80*sizeof(tsquare) );
data/phalanx-22+d051004/bcreate.c:154:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  { while( (c=getchar()) != EOF && c!='R' ) {}
data/phalanx-22+d051004/bcreate.c:160:17:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      while( (c=getchar()) == ' ' ) {}
data/phalanx-22+d051004/bcreate.c:168:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
while( (c=getchar()) != EOF && nlns < 2 )
data/phalanx-22+d051004/bcreate.c:216:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  { while( (c=getchar()) != '.' && c!=EOF )
data/phalanx-22+d051004/bcreate.c:220:12:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while( (c=getchar())!='}' && c!=EOF && csize<MaxComment )
data/phalanx-22+d051004/bcreate.c:223:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while( (c=getchar())==' ' || c=='\n' ) {}
data/phalanx-22+d051004/bcreate.c:225:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while( (c=getchar())!=' ' && c!='\n' && c!=EOF ) { m[i]=c; i++; }
data/phalanx-22+d051004/bcreate.c:231:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while( (c=getchar())==' ' || c=='\n' || c=='.' || isdigit(c) ) {}
data/phalanx-22+d051004/bcreate.c:235:12:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while( (c=getchar())!='}' && c!=EOF && csize<MaxComment )
data/phalanx-22+d051004/bcreate.c:241:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while( (c=getchar())!=' ' && c!='\n' && c!=EOF ) { m[i]=c; i++; }
data/phalanx-22+d051004/book.c:63:7:  [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.
	else sprintf(&s[lenght]," ");
data/phalanx-22+d051004/book.c:362:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if( foundtxt ) sprintf(s+strlen(s),"1 ");
data/phalanx-22+d051004/book.c:363: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).
			else sprintf(s+strlen(s),"2 ");
data/phalanx-22+d051004/book.c:365: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).
			{ printm( m[moves[i]], s+strlen(s) ); }
data/phalanx-22+d051004/book.c:366:4:  [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.
			sprintf(s+strlen(s),"\n");
data/phalanx-22+d051004/book.c:366: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).
			sprintf(s+strlen(s),"\n");
data/phalanx-22+d051004/book.c:415:13:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while( (c=fgetc(Eco))!='[' ) if( c==EOF ) goto doneinit;
data/phalanx-22+d051004/book.c:421:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		  while( (c=getc(Eco))!=']' ) if( c==EOF ) goto doneinit;
data/phalanx-22+d051004/book.c:427:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		  	while( (c=getc(Eco))==' ' || c=='\n' ) {}
data/phalanx-22+d051004/book.c:429:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while( (c=getc(Eco))!=' ' && c!='\n' && msi<=30 )
data/phalanx-22+d051004/book.c:444:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		  while( (c=fgetc(Eco))!='[' ) if( c==EOF ) goto doneinit;
data/phalanx-22+d051004/evaluate.c:182:3:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  getchar();
data/phalanx-22+d051004/evaluate.c:593:4:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			getchar();
data/phalanx-22+d051004/genmoves.c:218:1:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
getchar();
data/phalanx-22+d051004/genmoves.c:256:1:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
getchar();
data/phalanx-22+d051004/hash.c:137:36:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
printf ("Hit ENTER to continue "); getchar();
data/phalanx-22+d051004/io.c:151: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).
if( m.in2a != m.in1 ) sprintf( ss+strlen(ss), "%c", piece[m.in2a>>4] );
data/phalanx-22+d051004/io.c:154: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).
if( m.dch != 100 ) sprintf( ss+strlen(ss), "/%i",m.dch );
data/phalanx-22+d051004/io.c:157: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).
sprintf( ss+strlen(ss), "  " );
data/phalanx-22+d051004/io.c:185: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).
		sprintf( ss+strlen(ss),
data/phalanx-22+d051004/io.c:188: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).
	else sprintf( ss+strlen(ss), "%c", row[mi->to/10] );
data/phalanx-22+d051004/io.c:190: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).
		sprintf( ss+strlen(ss), "=%c", piece[mi->in2a>>4] );
data/phalanx-22+d051004/io.c:200: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).
	sprintf( ss+strlen(ss), "%c", file[mi->from%10] );
data/phalanx-22+d051004/io.c:205: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).
	sprintf( ss+strlen(ss), "%c", row[mi->from/10] );
data/phalanx-22+d051004/io.c:207:35:  [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.
if( mi->in2 != 0 || mi->special ) sprintf( ss+strlen(ss), "x" );
data/phalanx-22+d051004/io.c:207:47:  [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( mi->in2 != 0 || mi->special ) sprintf( ss+strlen(ss), "x" );
data/phalanx-22+d051004/io.c:209: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).
sprintf( ss+strlen(ss), "%c%c", file[mi->to%10], row[mi->to/10] );
data/phalanx-22+d051004/io.c:215:24:  [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.
if( checktest(Color) ) sprintf( ss+strlen(ss), "+" );
data/phalanx-22+d051004/io.c:215:36:  [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( checktest(Color) ) sprintf( ss+strlen(ss), "+" );
data/phalanx-22+d051004/io.c:242:3:  [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.
		sprintf( s+strlen(s), " " );
data/phalanx-22+d051004/io.c:242: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).
		sprintf( s+strlen(s), " " );
data/phalanx-22+d051004/io.c:243: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).
		pvSAN( v, s+strlen(s) );
data/phalanx-22+d051004/io.c:291:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(bufik,inp,30);
data/phalanx-22+d051004/io.c:491:4:  [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.
			sprintf( ss+strlen(ss), "\n" );
data/phalanx-22+d051004/io.c:491: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).
			sprintf( ss+strlen(ss), "\n" );
data/phalanx-22+d051004/io.c:492:28:  [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.
			for( i=0; i!=lid; i++ ) sprintf( ss+strlen(ss), " " );
data/phalanx-22+d051004/io.c:492:40:  [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!=lid; i++ ) sprintf( ss+strlen(ss), " " );
data/phalanx-22+d051004/io.c:494: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).
		printm( PV[0][j], ss+strlen(ss) );
data/phalanx-22+d051004/io.c:497:26:  [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( j < 3 ) sprintf( ss+strlen(ss), "           " );
data/phalanx-22+d051004/io.c:500:2:  [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.
	sprintf( ss+strlen(ss), "\n" );
data/phalanx-22+d051004/io.c:500: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).
	sprintf( ss+strlen(ss), "\n" );
data/phalanx-22+d051004/io.c:559: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).
		sprintf( ss+strlen(ss), "%7i", PV[0][0].value );
data/phalanx-22+d051004/io.c:560:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	else if( typ == 3 ) sprintf( ss+strlen(ss), " -> " );
data/phalanx-22+d051004/io.c:566: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).
		sprintf( ss+strlen(ss), "%3i:%02i.%02li",
data/phalanx-22+d051004/io.c:571: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).
		sprintf( ss+strlen(ss), " %5li", (long)(t-T1) );
data/phalanx-22+d051004/io.c:573: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).
	sprintf( ss+strlen(ss), " %8lli  ", Nodes );
data/phalanx-22+d051004/io.c:587: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).
	sprintf( ss+strlen(ss), ", N/s=%i\n",
data/phalanx-22+d051004/io.c:591:7:  [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.
	else sprintf( ss+strlen(ss), "\n" );
data/phalanx-22+d051004/io.c:591: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).
	else sprintf( ss+strlen(ss), "\n" );
data/phalanx-22+d051004/io.c:597: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).
	sprintf( ss+strlen(ss), "PV = " ); printPV(8,5,ss+strlen(ss));
data/phalanx-22+d051004/io.c:597:52:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	sprintf( ss+strlen(ss), "PV = " ); printPV(8,5,ss+strlen(ss));
data/phalanx-22+d051004/io.c:599: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).
	sprintf( ss+strlen(ss),
data/phalanx-22+d051004/io.c:602: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).
case 1: printPV(6,27,ss+strlen(ss));
data/phalanx-22+d051004/io.c:605:23:  [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).
	printm( PV[0][0], ss+strlen(ss) );
data/phalanx-22+d051004/io.c:606: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).
	sprintf( ss+strlen(ss), "!       \n" );
data/phalanx-22+d051004/io.c:608:21:  [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).
case 3: sprintf( ss+strlen(ss), "%2i turn", Turns );
data/phalanx-22+d051004/io.c:609: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(Turns==1) sprintf( ss+strlen(ss), "                          \n");
data/phalanx-22+d051004/io.c:610: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).
	else         sprintf( ss+strlen(ss), "s                         \n");
data/phalanx-22+d051004/io.c:612:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
case 4: printm( PV[0][0], ss+strlen(ss) );
data/phalanx-22+d051004/io.c:613: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).
	sprintf( ss+strlen(ss), "??      \n" );
data/phalanx-22+d051004/io.c:615:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
case 5: printm( PV[0][0], ss+strlen(ss) );
data/phalanx-22+d051004/io.c:616: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).
	sprintf( ss+strlen(ss), "!!      \n" );
data/phalanx-22+d051004/io.c:637: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).
	sprintf( s+strlen(s), "   ");
data/phalanx-22+d051004/io.c:638: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).
	sprintf( s+strlen(s), "%3li:%02li   ", t/60, t%60 );
data/phalanx-22+d051004/io.c:639: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).
	sprintf( s+strlen(s), "%9lli  ", Nodes );
data/phalanx-22+d051004/io.c:640: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).
	sprintf( s+strlen(s), "(%2i/%2i) ", i+1, n );
data/phalanx-22+d051004/io.c:641:18:  [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).
	printm( m[i], s+strlen(s) );
data/phalanx-22+d051004/io.c:642: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).
	sprintf( s+strlen(s), "     " );
data/phalanx-22+d051004/io.c:643:25:  [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.
	for( j=0; j!=79; j++ ) sprintf( s+strlen(s), "" );
data/phalanx-22+d051004/io.c:643:36:  [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( j=0; j!=79; j++ ) sprintf( s+strlen(s), "" );
data/phalanx-22+d051004/io.c:661: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).
			sprintf(ss+strlen(ss),"| %c ",piece[B[i]>>4]);
data/phalanx-22+d051004/io.c:664: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).
			sprintf(ss+strlen(ss),"| *%c",piece[B[i]>>4]);
data/phalanx-22+d051004/io.c:666:23:  [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).
		default: sprintf(ss+strlen(ss),"|   ");
data/phalanx-22+d051004/io.c:671: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).
			sprintf(ss+strlen(ss),
data/phalanx-22+d051004/io.c:673: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).
			if(i!=10) sprintf(ss+strlen(ss),"\n  ");
data/phalanx-22+d051004/io.c:676:34:  [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( Color == WHITE ) sprintf(ss+strlen(ss),"   White to move\n");
data/phalanx-22+d051004/io.c:677:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	else sprintf(ss+strlen(ss),"   Black to move\n");
data/phalanx-22+d051004/io.c:945:4:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c=getc(stdin); ungetc(c,stdin);
data/phalanx-22+d051004/moving.c:38:3:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		getchar();
data/phalanx-22+d051004/search.c:172:22:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
printm(m[max],NULL); getchar();

ANALYSIS SUMMARY:

Hits = 217
Lines analyzed = 8908 in approximately 0.26 seconds (34791 lines/second)
Physical Source Lines of Code (SLOC) = 6939
Hits@level = [0] 227 [1]  90 [2] 112 [3]   5 [4]  10 [5]   0
Hits@level+ = [0+] 444 [1+] 217 [2+] 127 [3+]  15 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 63.9862 [1+] 31.2725 [2+] 18.3023 [3+] 2.16169 [4+] 1.44113 [5+]   0
Dot directories skipped = 2 (--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.