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/amoebax-0.2.1+dfsg/src/AIPlayer.cxx
Examining data/amoebax-0.2.1+dfsg/src/AIPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/AIPlayerFactory.cxx
Examining data/amoebax-0.2.1+dfsg/src/AIPlayerFactory.h
Examining data/amoebax-0.2.1+dfsg/src/AdvancedAIPlayer.cxx
Examining data/amoebax-0.2.1+dfsg/src/AdvancedAIPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/Amoeba.cxx
Examining data/amoebax-0.2.1+dfsg/src/Amoeba.h
Examining data/amoebax-0.2.1+dfsg/src/AmoebaxMain.h
Examining data/amoebax-0.2.1+dfsg/src/AnticipatoryAIPlayer.cxx
Examining data/amoebax-0.2.1+dfsg/src/AnticipatoryAIPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/ChainLabel.cxx
Examining data/amoebax-0.2.1+dfsg/src/ChainLabel.h
Examining data/amoebax-0.2.1+dfsg/src/CongratulationsState.cxx
Examining data/amoebax-0.2.1+dfsg/src/CongratulationsState.h
Examining data/amoebax-0.2.1+dfsg/src/ControlSetupState.cxx
Examining data/amoebax-0.2.1+dfsg/src/ControlSetupState.h
Examining data/amoebax-0.2.1+dfsg/src/CreditsState.cxx
Examining data/amoebax-0.2.1+dfsg/src/CreditsState.h
Examining data/amoebax-0.2.1+dfsg/src/DemoState.cxx
Examining data/amoebax-0.2.1+dfsg/src/DemoState.h
Examining data/amoebax-0.2.1+dfsg/src/DrawAmoeba.h
Examining data/amoebax-0.2.1+dfsg/src/DrawChainLabel.h
Examining data/amoebax-0.2.1+dfsg/src/DumbAIPlayer.cxx
Examining data/amoebax-0.2.1+dfsg/src/DumbAIPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/FadeInState.cxx
Examining data/amoebax-0.2.1+dfsg/src/FadeInState.h
Examining data/amoebax-0.2.1+dfsg/src/FadeOutState.cxx
Examining data/amoebax-0.2.1+dfsg/src/FadeOutState.h
Examining data/amoebax-0.2.1+dfsg/src/File.cxx
Examining data/amoebax-0.2.1+dfsg/src/File.h
Examining data/amoebax-0.2.1+dfsg/src/Font.cxx
Examining data/amoebax-0.2.1+dfsg/src/Font.h
Examining data/amoebax-0.2.1+dfsg/src/FrameManager.cxx
Examining data/amoebax-0.2.1+dfsg/src/FrameManager.h
Examining data/amoebax-0.2.1+dfsg/src/Grid.cxx
Examining data/amoebax-0.2.1+dfsg/src/Grid.h
Examining data/amoebax-0.2.1+dfsg/src/GridStatus.cxx
Examining data/amoebax-0.2.1+dfsg/src/GridStatus.h
Examining data/amoebax-0.2.1+dfsg/src/HighScoreState.cxx
Examining data/amoebax-0.2.1+dfsg/src/HighScoreState.h
Examining data/amoebax-0.2.1+dfsg/src/HumanPlayer.cxx
Examining data/amoebax-0.2.1+dfsg/src/HumanPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/IMatchObserver.h
Examining data/amoebax-0.2.1+dfsg/src/IPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/IState.h
Examining data/amoebax-0.2.1+dfsg/src/Joystick.cxx
Examining data/amoebax-0.2.1+dfsg/src/Joystick.h
Examining data/amoebax-0.2.1+dfsg/src/MainMenuState.cxx
Examining data/amoebax-0.2.1+dfsg/src/MainMenuState.h
Examining data/amoebax-0.2.1+dfsg/src/Music.cxx
Examining data/amoebax-0.2.1+dfsg/src/Music.h
Examining data/amoebax-0.2.1+dfsg/src/NewHighScoreState.cxx
Examining data/amoebax-0.2.1+dfsg/src/NewHighScoreState.h
Examining data/amoebax-0.2.1+dfsg/src/NormalSetupState.cxx
Examining data/amoebax-0.2.1+dfsg/src/NormalSetupState.h
Examining data/amoebax-0.2.1+dfsg/src/NormalState.cxx
Examining data/amoebax-0.2.1+dfsg/src/NormalState.h
Examining data/amoebax-0.2.1+dfsg/src/OSXOptions.cxx
Examining data/amoebax-0.2.1+dfsg/src/OSXOptions.h
Examining data/amoebax-0.2.1+dfsg/src/Options.cxx
Examining data/amoebax-0.2.1+dfsg/src/Options.h
Examining data/amoebax-0.2.1+dfsg/src/OptionsMenuState.cxx
Examining data/amoebax-0.2.1+dfsg/src/OptionsMenuState.h
Examining data/amoebax-0.2.1+dfsg/src/PairGenerator.cxx
Examining data/amoebax-0.2.1+dfsg/src/PairGenerator.h
Examining data/amoebax-0.2.1+dfsg/src/PauseState.cxx
Examining data/amoebax-0.2.1+dfsg/src/PauseState.h
Examining data/amoebax-0.2.1+dfsg/src/SimpleAIPlayer.cxx
Examining data/amoebax-0.2.1+dfsg/src/SimpleAIPlayer.h
Examining data/amoebax-0.2.1+dfsg/src/Sound.cxx
Examining data/amoebax-0.2.1+dfsg/src/Sound.h
Examining data/amoebax-0.2.1+dfsg/src/Surface.cxx
Examining data/amoebax-0.2.1+dfsg/src/Surface.h
Examining data/amoebax-0.2.1+dfsg/src/System.cxx
Examining data/amoebax-0.2.1+dfsg/src/System.h
Examining data/amoebax-0.2.1+dfsg/src/TournamentMenuState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TournamentMenuState.h
Examining data/amoebax-0.2.1+dfsg/src/TournamentSetupState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TournamentSetupState.h
Examining data/amoebax-0.2.1+dfsg/src/TournamentState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TournamentState.h
Examining data/amoebax-0.2.1+dfsg/src/TrainingState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TrainingState.h
Examining data/amoebax-0.2.1+dfsg/src/TryAgainState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TryAgainState.h
Examining data/amoebax-0.2.1+dfsg/src/TwoComputerPlayersState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TwoComputerPlayersState.h
Examining data/amoebax-0.2.1+dfsg/src/TwoGP2XPlayersState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TwoGP2XPlayersState.h
Examining data/amoebax-0.2.1+dfsg/src/TwoPlayersState.cxx
Examining data/amoebax-0.2.1+dfsg/src/TwoPlayersState.h
Examining data/amoebax-0.2.1+dfsg/src/UnixOptions.h
Examining data/amoebax-0.2.1+dfsg/src/VersusState.cxx
Examining data/amoebax-0.2.1+dfsg/src/VersusState.h
Examining data/amoebax-0.2.1+dfsg/src/VideoErrorState.cxx
Examining data/amoebax-0.2.1+dfsg/src/VideoErrorState.h
Examining data/amoebax-0.2.1+dfsg/src/Win32Options.cxx
Examining data/amoebax-0.2.1+dfsg/src/Win32Options.h
Examining data/amoebax-0.2.1+dfsg/src/binreloc.h
Examining data/amoebax-0.2.1+dfsg/src/gp2x.h
Examining data/amoebax-0.2.1+dfsg/src/main.cxx
Examining data/amoebax-0.2.1+dfsg/src/binreloc.cxx
Examining data/amoebax-0.2.1+dfsg/src/UnixOptions.cxx

FINAL RESULTS:

data/amoebax-0.2.1+dfsg/src/binreloc.cxx:78:10:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		size = readlink (path2, path, buf_size - 1);
data/amoebax-0.2.1+dfsg/src/main.cxx:81:5:  [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 ("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
data/amoebax-0.2.1+dfsg/src/System.cxx:244:5:  [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 (0));
data/amoebax-0.2.1+dfsg/src/UnixOptions.cxx:128:30:  [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* configHome = getenv ("XDG_CONFIG_HOME");
data/amoebax-0.2.1+dfsg/src/UnixOptions.cxx:132: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.
        const char* configHome = getenv ("HOME");
data/amoebax-0.2.1+dfsg/src/NewHighScoreState.cxx:399:9:  [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 character[2] = {toupper (static_cast<char>(code & 0x7f)), '\0'};
data/amoebax-0.2.1+dfsg/src/System.cxx:86:5:  [2] (buffer) TCHAR:
  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.
    TCHAR executablePath[MAX_PATH];
data/amoebax-0.2.1+dfsg/src/UnixOptions.cxx:86:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            return atoi (stringValue.c_str ());
data/amoebax-0.2.1+dfsg/src/Win32Options.cxx:92:9:  [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 registryValue[512];
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:122:6:  [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 ("/proc/self/maps", "r");
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:188: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 *address_string, line[SIZE], *found;
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:193:6:  [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 ("/proc/self/maps", "r");
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:253:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy (address_string, "0x", 2);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:254:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy (address_string + 2, start_addr, len);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:258:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy (address_string, "0x", 2);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:259:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy (address_string + 2, end_addr, len);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:675:2:  [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 (result, str1, len1);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:676:2:  [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 (result + len1, str2, len2);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:721:2:  [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 (result, str, size);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:73:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
	strncpy (path2, "/proc/self/exe", buf_size - 1);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:105:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy (path, path2, buf_size - 1);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:141: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).
	buf_size = strlen (line);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:229:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		len = strlen (file);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:236:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		len = strlen (file);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:241:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		len = strlen (start_addr);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx: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).
		if (len != strlen (end_addr))
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:671:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len1 = strlen (str1);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:672:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len2 = strlen (str2);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:690:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen (dir);
data/amoebax-0.2.1+dfsg/src/binreloc.cxx:714:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen (str);

ANALYSIS SUMMARY:

Hits = 30
Lines analyzed = 23806 in approximately 0.47 seconds (50872 lines/second)
Physical Source Lines of Code (SLOC) = 14626
Hits@level = [0]   2 [1]  11 [2]  14 [3]   3 [4]   1 [5]   1
Hits@level+ = [0+]  32 [1+]  30 [2+]  19 [3+]   5 [4+]   2 [5+]   1
Hits/KSLOC@level+ = [0+] 2.18788 [1+] 2.05114 [2+] 1.29906 [3+] 0.341857 [4+] 0.136743 [5+] 0.0683714
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.