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/dd2-0.2.2/src/menu.c
Examining data/dd2-0.2.2/src/SDL_plus.c
Examining data/dd2-0.2.2/src/cfg.c
Examining data/dd2-0.2.2/src/control.c
Examining data/dd2-0.2.2/src/control.h
Examining data/dd2-0.2.2/src/cfg.h
Examining data/dd2-0.2.2/src/SDL_plus.h
Examining data/dd2-0.2.2/src/menu.h
Examining data/dd2-0.2.2/src/main.h
Examining data/dd2-0.2.2/src/engine.h
Examining data/dd2-0.2.2/src/main.c
Examining data/dd2-0.2.2/src/engine.c

FINAL RESULTS:

data/dd2-0.2.2/src/SDL_plus.c:48:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(buffer,fmt,number);
data/dd2-0.2.2/src/engine.c:201:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/game.act",DD2_DATA);
data/dd2-0.2.2/src/main.c:68:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/bgm1.xm",DD2_DATA);
data/dd2-0.2.2/src/main.c:73:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/bgm2.xm",DD2_DATA);
data/dd2-0.2.2/src/main.c:79:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buffer,"%s/efx%i.wav",DD2_DATA,i+1);
data/dd2-0.2.2/src/main.c:288:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buffer,"%s/dd2.cfg",DD2_DATA);
data/dd2-0.2.2/src/main.c:293:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/dd2.cfg",DD2_DATA);
data/dd2-0.2.2/src/main.c:299:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/hiscore",DD2_SCORE);
data/dd2-0.2.2/src/main.c:367:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/gfx.bmp",DD2_DATA);
data/dd2-0.2.2/src/main.c:458:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/dd2.cfg",DD2_DATA);
data/dd2-0.2.2/src/main.c:466:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer,"%s/hiscore",DD2_SCORE);
data/dd2-0.2.2/src/menu.c:76:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buffer,"%s+",name);
data/dd2-0.2.2/src/main.c:285:33:  [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.
	sprintf(buffer,"%.500s/.dd2rc",getenv("HOME"));
data/dd2-0.2.2/src/main.c:461:33:  [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.
	sprintf(buffer,"%.500s/.dd2rc",getenv("HOME"));
data/dd2-0.2.2/src/SDL_plus.c:44: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 buffer[32],fmt[16];
data/dd2-0.2.2/src/SDL_plus.c:47: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(fmt,"%%.%ii",padd);
data/dd2-0.2.2/src/cfg.c:30: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 buffer[512];
data/dd2-0.2.2/src/cfg.c:38:4:  [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).
	f=fopen(path,"rt");
data/dd2-0.2.2/src/cfg.c:75:4:  [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).
	f=fopen(path,"wt");
data/dd2-0.2.2/src/cfg.c:100:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(hisc[i].name,"nobody");
data/dd2-0.2.2/src/cfg.c:105:4:  [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).
	f=fopen(path,"rt");
data/dd2-0.2.2/src/cfg.c:143:4:  [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).
	f=fopen(path,"wt");
data/dd2-0.2.2/src/cfg.h:33: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 name[9];
data/dd2-0.2.2/src/engine.c:68: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 comm[32];
data/dd2-0.2.2/src/engine.c:69: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 buffer[512];
data/dd2-0.2.2/src/engine.c:202:5:  [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).
	fd=fopen(buffer,"rt");
data/dd2-0.2.2/src/engine.c:478: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 stage[16];
data/dd2-0.2.2/src/engine.c:479: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(stage,"stage %i",vt->y);
data/dd2-0.2.2/src/main.c:66: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 buffer[512];
data/dd2-0.2.2/src/main.c:271: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 buffer[512];
data/dd2-0.2.2/src/main.c:285:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buffer,"%.500s/.dd2rc",getenv("HOME"));
data/dd2-0.2.2/src/main.c:461:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buffer,"%.500s/.dd2rc",getenv("HOME"));
data/dd2-0.2.2/src/menu.c:47: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 buffer[64];
data/dd2-0.2.2/src/menu.c:54:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buffer,"player %i with score %.6li",playern,player[playern-1].score);
data/dd2-0.2.2/src/menu.c:59: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(buffer,"you got %ith place",place);
data/dd2-0.2.2/src/menu.c:62: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(buffer,"you got %ist place",place);
data/dd2-0.2.2/src/menu.c:65: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(buffer,"you got %ind place",place);
data/dd2-0.2.2/src/menu.c:68: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(buffer,"you got %ird place",place);
data/dd2-0.2.2/src/menu.c:148:7:  [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(name,"nobody");
data/dd2-0.2.2/src/SDL_plus.c:56: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).
	for(i=0;i<strlen(buffer);i++) {
data/dd2-0.2.2/src/SDL_plus.c:201: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).
  for(i=0,a.x=x,a.y=y;i<strlen(str);i++) {
data/dd2-0.2.2/src/menu.c:78:3:  [1] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant character.
		strcpy(buffer,"+");

ANALYSIS SUMMARY:

Hits = 42
Lines analyzed = 4650 in approximately 0.19 seconds (24471 lines/second)
Physical Source Lines of Code (SLOC) = 3650
Hits@level = [0]  36 [1]   3 [2]  25 [3]   2 [4]  12 [5]   0
Hits@level+ = [0+]  78 [1+]  42 [2+]  39 [3+]  14 [4+]  12 [5+]   0
Hits/KSLOC@level+ = [0+] 21.3699 [1+] 11.5068 [2+] 10.6849 [3+] 3.83562 [4+] 3.28767 [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.