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/dwarf-fortress-0.47.04/amd64/g_src/command_line.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/ttf_manager.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/ViewBase.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/endian.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/files.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/interface.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/basics.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_g.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/renderer_opengl.hpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/keybindings.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/graphics.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/bimap.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/graphics.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/init.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/g_basics.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/find_files.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_v.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/renderer_curses.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/command_line.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/curses.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/init.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/ttf_manager.hpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/files.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/textures.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/find_files_posix.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/template.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/renderer_offscreen.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/resize++.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/KeybindingScreen.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/ViewBase.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/random.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/platform.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/basics.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_openal.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/svector.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/textlines.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/resize++.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/win32_compat.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/keybindings.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/enabler.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/KeybindingScreen.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/texture_handler.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/random.h
Examining data/dwarf-fortress-0.47.04/amd64/g_src/textlines.cpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/renderer_2d.hpp
Examining data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_openal.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/command_line.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/ttf_manager.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/ViewBase.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/endian.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/files.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/interface.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/basics.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_g.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/renderer_opengl.hpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/keybindings.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/graphics.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/bimap.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/graphics.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/init.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/g_basics.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/find_files.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_v.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/renderer_curses.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/command_line.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/curses.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/init.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/ttf_manager.hpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/files.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/textures.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/find_files_posix.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/template.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/renderer_offscreen.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/resize++.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/KeybindingScreen.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/ViewBase.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/random.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/platform.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/basics.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_openal.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/svector.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/textlines.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/resize++.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/win32_compat.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/keybindings.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/enabler.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/KeybindingScreen.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/texture_handler.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/random.h
Examining data/dwarf-fortress-0.47.04/i386/g_src/textlines.cpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/renderer_2d.hpp
Examining data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_openal.h

FINAL RESULTS:

data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:35:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(buf, "%s: %s\n", error_preface, error_message);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:19:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
					strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:31:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
						strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:56:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
					strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:68:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
						strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files_posix.cpp:56:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				strcpy(c, src);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files_posix.cpp:83:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				strcpy(c, src);
data/dwarf-fortress-0.47.04/amd64/g_src/graphics.cpp:462:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(str,src_dir.c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/graphics.cpp:464:3:  [4] (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).
		strcat(str,processfilename[f]);
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1139:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
					strcpy(buf,gview.supermovie_sound.str[s]->dat.c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1411:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(str,str2.c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.cpp:118:44:  [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.
	FMOD_RESULT result = FMOD::System_Create(&system);
data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.h:38:30:  [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.
		musicsoundst() : song(-1), system(NULL), masterchannelgroup(NULL), sound_system(ALSA)
data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.h:78:58:  [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.
		void set_sound_system(musicsoundst::linux_sound_system system) {
data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.h:79:19:  [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.
			sound_system = system;
data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_fmodex.h:94:17:  [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.
		FMOD::System *system;
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:35:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(buf, "%s: %s\n", error_preface, error_message);
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:19:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
					strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:31:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
						strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:56:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
					strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:68:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
						strcpy(c,finddata.cFileName);
data/dwarf-fortress-0.47.04/i386/g_src/find_files_posix.cpp:56:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				strcpy(c, src);
data/dwarf-fortress-0.47.04/i386/g_src/find_files_posix.cpp:83:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				strcpy(c, src);
data/dwarf-fortress-0.47.04/i386/g_src/graphics.cpp:462:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(str,src_dir.c_str());
data/dwarf-fortress-0.47.04/i386/g_src/graphics.cpp:464:3:  [4] (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).
		strcat(str,processfilename[f]);
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1139:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
					strcpy(buf,gview.supermovie_sound.str[s]->dat.c_str());
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1411:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(str,str2.c_str());
data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.cpp:118:44:  [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.
	FMOD_RESULT result = FMOD::System_Create(&system);
data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.h:38:30:  [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.
		musicsoundst() : song(-1), system(NULL), masterchannelgroup(NULL), sound_system(ALSA)
data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.h:78:58:  [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.
		void set_sound_system(musicsoundst::linux_sound_system system) {
data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.h:79:19:  [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.
			sound_system = system;
data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_fmodex.h:94:17:  [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.
		FMOD::System *system;
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:718:7:  [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 (getenv("DISPLAY"))
data/dwarf-fortress-0.47.04/amd64/g_src/win32_compat.cpp:114:7:  [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 (getenv("DISPLAY")) {
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:718:7:  [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 (getenv("DISPLAY"))
data/dwarf-fortress-0.47.04/i386/g_src/win32_compat.cpp:114:7:  [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 (getenv("DISPLAY")) {
data/dwarf-fortress-0.47.04/amd64/g_src/basics.cpp:62:14:  [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).
		error_feed.open("errorlog.txt", std::ios::out | std::ios::app);
data/dwarf-fortress-0.47.04/amd64/g_src/basics.cpp:129:9:  [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(str.c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:881:41:  [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).
			  newel=new text_info_element_longst(atoi(nextstr.c_str()));
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.h:449:11:  [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 *ptrs[3];
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:337:30:  [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).
              matcher.mod  = atoi(string(match[1]).c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:356:17:  [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[2] = {char(matcher.unicode), 0};
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:367:30:  [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).
            matcher.button = atoi(str.c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:369:30:  [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).
              matcher.mod  = atoi(string(match[1]).c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:888: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[100];
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:1083:7:  [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 (atoi(prefix_command.c_str()) > 99)
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:1089:19:  [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).
    int repeats = atoi(prefix_command.c_str());
data/dwarf-fortress-0.47.04/amd64/g_src/files.cpp:357:5:  [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).
		f.open(filename.c_str(), fstream::in | fstream::out | fstream::binary);
data/dwarf-fortress-0.47.04/amd64/g_src/files.cpp:359:5:  [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).
		f.open(filename.c_str(), fstream::in | fstream::out | fstream::binary | fstream::trunc);
data/dwarf-fortress-0.47.04/amd64/g_src/files.h:297: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.
		static char def_ibuff[FILE_IN_BUFF];
data/dwarf-fortress-0.47.04/amd64/g_src/files.h:298: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.
		static char def_obuff[FILE_OUT_BUFF];
data/dwarf-fortress-0.47.04/amd64/g_src/graphics.cpp:448: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 str[400];
data/dwarf-fortress-0.47.04/amd64/g_src/graphics.cpp:463: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(str,"graphics/");
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1113:5:  [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).
		f.open(movie_file.c_str(), fstream::out | fstream::binary | fstream::app);
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1136: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 buf[50];
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1183: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).
	f.open(movie_file.c_str(), fstream::in | fstream::binary);
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1228:6:  [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[50];
data/dwarf-fortress-0.47.04/amd64/g_src/interface.h:110: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 supermoviebuffer[MOVIEBUFFSIZE];
data/dwarf-fortress-0.47.04/amd64/g_src/interface.h:111: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 supermoviebuffer_comp[COMPMOVIEBUFFSIZE];
data/dwarf-fortress-0.47.04/amd64/g_src/renderer_curses.cpp:100:7:  [2] (buffer) wchar_t:
  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.
      wchar_t chs[2] = {charmap[ch],0};
data/dwarf-fortress-0.47.04/amd64/g_src/textlines.cpp:29: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 filecomp_buffer[20000];
data/dwarf-fortress-0.47.04/amd64/g_src/textlines.cpp:30: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 filecomp_buffer2[80000];
data/dwarf-fortress-0.47.04/amd64/g_src/textlines.cpp:31: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 filecomp_buffer_aux[20000];
data/dwarf-fortress-0.47.04/amd64/g_src/textlines.cpp:32: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 filecomp_buffer2_aux[80000];
data/dwarf-fortress-0.47.04/i386/g_src/basics.cpp:62:14:  [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).
		error_feed.open("errorlog.txt", std::ios::out | std::ios::app);
data/dwarf-fortress-0.47.04/i386/g_src/basics.cpp:129:9:  [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(str.c_str());
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:881:41:  [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).
			  newel=new text_info_element_longst(atoi(nextstr.c_str()));
data/dwarf-fortress-0.47.04/i386/g_src/enabler.h:449:11:  [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 *ptrs[3];
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:337:30:  [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).
              matcher.mod  = atoi(string(match[1]).c_str());
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:356:17:  [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[2] = {char(matcher.unicode), 0};
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:367:30:  [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).
            matcher.button = atoi(str.c_str());
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:369:30:  [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).
              matcher.mod  = atoi(string(match[1]).c_str());
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:888: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[100];
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:1083:7:  [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 (atoi(prefix_command.c_str()) > 99)
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:1089:19:  [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).
    int repeats = atoi(prefix_command.c_str());
data/dwarf-fortress-0.47.04/i386/g_src/files.cpp:357:5:  [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).
		f.open(filename.c_str(), fstream::in | fstream::out | fstream::binary);
data/dwarf-fortress-0.47.04/i386/g_src/files.cpp:359:5:  [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).
		f.open(filename.c_str(), fstream::in | fstream::out | fstream::binary | fstream::trunc);
data/dwarf-fortress-0.47.04/i386/g_src/files.h:297: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.
		static char def_ibuff[FILE_IN_BUFF];
data/dwarf-fortress-0.47.04/i386/g_src/files.h:298: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.
		static char def_obuff[FILE_OUT_BUFF];
data/dwarf-fortress-0.47.04/i386/g_src/graphics.cpp:448: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 str[400];
data/dwarf-fortress-0.47.04/i386/g_src/graphics.cpp:463: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(str,"graphics/");
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1113:5:  [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).
		f.open(movie_file.c_str(), fstream::out | fstream::binary | fstream::app);
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1136: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 buf[50];
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1183: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).
	f.open(movie_file.c_str(), fstream::in | fstream::binary);
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1228:6:  [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[50];
data/dwarf-fortress-0.47.04/i386/g_src/interface.h:110: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 supermoviebuffer[MOVIEBUFFSIZE];
data/dwarf-fortress-0.47.04/i386/g_src/interface.h:111: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 supermoviebuffer_comp[COMPMOVIEBUFFSIZE];
data/dwarf-fortress-0.47.04/i386/g_src/renderer_curses.cpp:100:7:  [2] (buffer) wchar_t:
  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.
      wchar_t chs[2] = {charmap[ch],0};
data/dwarf-fortress-0.47.04/i386/g_src/textlines.cpp:29: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 filecomp_buffer[20000];
data/dwarf-fortress-0.47.04/i386/g_src/textlines.cpp:30: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 filecomp_buffer2[80000];
data/dwarf-fortress-0.47.04/i386/g_src/textlines.cpp:31: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 filecomp_buffer_aux[20000];
data/dwarf-fortress-0.47.04/i386/g_src/textlines.cpp:32: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 filecomp_buffer2_aux[80000];
data/dwarf-fortress-0.47.04/amd64/g_src/basics.cpp:272:22:  [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).
	int32_t sz=(int32_t)strlen(source);
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:34: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).
  buf = new char[strlen(error_preface) + strlen(error_message) + 4];
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:34:42:  [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 = new char[strlen(error_preface) + strlen(error_message) + 4];
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:247:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_frombox.read(r);
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:297:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        async_tobox.read(cmd);
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:601:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:612:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:679:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/amd64/g_src/enabler.cpp:698:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:619:146:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    Event e; e.r = REPEAT_NOT; e.repeats = 0; e.time = now; e.serial = serial; e.k = INTERFACEKEY_KEYBINDING_COMPLETE; e.tick = enabler.simticks.read();
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:653:146:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    Event e; e.r = REPEAT_NOT; e.repeats = 0; e.time = now; e.serial = serial; e.k = INTERFACEKEY_KEYBINDING_COMPLETE; e.tick = enabler.simticks.read();
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:690:71:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      Event e = {key_repeat(*k), *k, 0, serial, now, enabler.simticks.read()};
data/dwarf-fortress-0.47.04/amd64/g_src/enabler_input.cpp:724:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int simtick = enabler.simticks.read();
data/dwarf-fortress-0.47.04/amd64/g_src/files.cpp:235:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		f.read((char *)read_var,read_size);
data/dwarf-fortress-0.47.04/amd64/g_src/files.cpp:276:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	f.read((char*)&out_buffer_amount_written,sizeof(int32_t));
data/dwarf-fortress-0.47.04/amd64/g_src/files.cpp:278:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	f.read(out_buffer,out_buffer_amount_written);
data/dwarf-fortress-0.47.04/amd64/g_src/files.h:33: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).
			int16_t len=(int16_t)strlen(var);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:18: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).
				c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:30:17:  [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).
					c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:55: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).
				c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/amd64/g_src/find_files.cpp:67:17:  [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).
					c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/amd64/g_src/find_files_posix.cpp:54: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).
				int len = strlen(++src);
data/dwarf-fortress-0.47.04/amd64/g_src/find_files_posix.cpp:79: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).
				int len = strlen(++src);
data/dwarf-fortress-0.47.04/amd64/g_src/graphics.cpp:106:20:  [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).
  const int slen = strlen(str);
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1202:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)&loadversion,sizeof(int));
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1208:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)&cmh,sizeof(cursesmovie_headerst));
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1225:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					f.read((char *)&num,sizeof(int));
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1232:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
						f.read(buf,sizeof(char)*50);
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1243:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
							f.read((char *)&swp_l,sizeof(int));
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1282:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)&gview.currentblocksize,sizeof(int));
data/dwarf-fortress-0.47.04/amd64/g_src/interface.cpp:1284:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)gview.supermoviebuffer_comp,gview.currentblocksize);
data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp:21:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(T &r) {
data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp:63:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(T &r) { lock(); r = val; unlock(); }
data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp:64:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  T read() { T r; read(r); return r; }
data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp:64:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  T read() { T r; read(r); return r; }
data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp:94:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(T &r) {
data/dwarf-fortress-0.47.04/amd64/g_src/mail.hpp:124:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read() {
data/dwarf-fortress-0.47.04/amd64/g_src/music_and_sound_openal.cpp:56: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).
    devices += strlen(devices) + 1;
data/dwarf-fortress-0.47.04/i386/g_src/basics.cpp:272:22:  [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).
	int32_t sz=(int32_t)strlen(source);
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:34: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).
  buf = new char[strlen(error_preface) + strlen(error_message) + 4];
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:34:42:  [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 = new char[strlen(error_preface) + strlen(error_message) + 4];
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:247:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_frombox.read(r);
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:297:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        async_tobox.read(cmd);
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:601:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:612:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:679:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/i386/g_src/enabler.cpp:698:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    async_fromcomplete.read();
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:619:146:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    Event e; e.r = REPEAT_NOT; e.repeats = 0; e.time = now; e.serial = serial; e.k = INTERFACEKEY_KEYBINDING_COMPLETE; e.tick = enabler.simticks.read();
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:653:146:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    Event e; e.r = REPEAT_NOT; e.repeats = 0; e.time = now; e.serial = serial; e.k = INTERFACEKEY_KEYBINDING_COMPLETE; e.tick = enabler.simticks.read();
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:690:71:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      Event e = {key_repeat(*k), *k, 0, serial, now, enabler.simticks.read()};
data/dwarf-fortress-0.47.04/i386/g_src/enabler_input.cpp:724:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int simtick = enabler.simticks.read();
data/dwarf-fortress-0.47.04/i386/g_src/files.cpp:235:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		f.read((char *)read_var,read_size);
data/dwarf-fortress-0.47.04/i386/g_src/files.cpp:276:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	f.read((char*)&out_buffer_amount_written,sizeof(int32_t));
data/dwarf-fortress-0.47.04/i386/g_src/files.cpp:278:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	f.read(out_buffer,out_buffer_amount_written);
data/dwarf-fortress-0.47.04/i386/g_src/files.h:33: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).
			int16_t len=(int16_t)strlen(var);
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:18: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).
				c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:30:17:  [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).
					c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:55: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).
				c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/i386/g_src/find_files.cpp:67:17:  [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).
					c=new char[strlen(finddata.cFileName)+1];
data/dwarf-fortress-0.47.04/i386/g_src/find_files_posix.cpp:54: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).
				int len = strlen(++src);
data/dwarf-fortress-0.47.04/i386/g_src/find_files_posix.cpp:79: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).
				int len = strlen(++src);
data/dwarf-fortress-0.47.04/i386/g_src/graphics.cpp:106:20:  [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).
  const int slen = strlen(str);
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1202:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)&loadversion,sizeof(int));
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1208:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)&cmh,sizeof(cursesmovie_headerst));
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1225:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					f.read((char *)&num,sizeof(int));
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1232:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
						f.read(buf,sizeof(char)*50);
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1243:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
							f.read((char *)&swp_l,sizeof(int));
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1282:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)&gview.currentblocksize,sizeof(int));
data/dwarf-fortress-0.47.04/i386/g_src/interface.cpp:1284:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				f.read((char *)gview.supermoviebuffer_comp,gview.currentblocksize);
data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp:21:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(T &r) {
data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp:63:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(T &r) { lock(); r = val; unlock(); }
data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp:64:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  T read() { T r; read(r); return r; }
data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp:64:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  T read() { T r; read(r); return r; }
data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp:94:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(T &r) {
data/dwarf-fortress-0.47.04/i386/g_src/mail.hpp:124:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read() {
data/dwarf-fortress-0.47.04/i386/g_src/music_and_sound_openal.cpp:56: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).
    devices += strlen(devices) + 1;

ANALYSIS SUMMARY:

Hits = 168
Lines analyzed = 42098 in approximately 1.30 seconds (32435 lines/second)
Physical Source Lines of Code (SLOC) = 36686
Hits@level = [0]  30 [1]  76 [2]  56 [3]   4 [4]  32 [5]   0
Hits@level+ = [0+] 198 [1+] 168 [2+]  92 [3+]  36 [4+]  32 [5+]   0
Hits/KSLOC@level+ = [0+] 5.39715 [1+] 4.5794 [2+] 2.50777 [3+] 0.981301 [4+] 0.872267 [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.