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/minetestmapper-20200328/BlockDecoder.cpp
Examining data/minetestmapper-20200328/Image.cpp
Examining data/minetestmapper-20200328/PixelAttributes.cpp
Examining data/minetestmapper-20200328/PlayerAttributes.cpp
Examining data/minetestmapper-20200328/TileGenerator.cpp
Examining data/minetestmapper-20200328/ZlibDecompressor.cpp
Examining data/minetestmapper-20200328/db-leveldb.cpp
Examining data/minetestmapper-20200328/db-postgresql.cpp
Examining data/minetestmapper-20200328/db-redis.cpp
Examining data/minetestmapper-20200328/db-sqlite3.cpp
Examining data/minetestmapper-20200328/include/BlockDecoder.h
Examining data/minetestmapper-20200328/include/Image.h
Examining data/minetestmapper-20200328/include/PixelAttributes.h
Examining data/minetestmapper-20200328/include/PlayerAttributes.h
Examining data/minetestmapper-20200328/include/TileGenerator.h
Examining data/minetestmapper-20200328/include/ZlibDecompressor.h
Examining data/minetestmapper-20200328/include/config.h
Examining data/minetestmapper-20200328/include/db-leveldb.h
Examining data/minetestmapper-20200328/include/db-postgresql.h
Examining data/minetestmapper-20200328/include/db-redis.h
Examining data/minetestmapper-20200328/include/db-sqlite3.h
Examining data/minetestmapper-20200328/include/db.h
Examining data/minetestmapper-20200328/include/types.h
Examining data/minetestmapper-20200328/include/util.h
Examining data/minetestmapper-20200328/mapper.cpp
Examining data/minetestmapper-20200328/util.cpp

FINAL RESULTS:

data/minetestmapper-20200328/mapper.cpp:71:20:  [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.
	char *home = std::getenv("HOME");
data/minetestmapper-20200328/mapper.cpp:124:11:  [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.
		int c = getopt_long(argc, argv, "hi:o:", long_options, &option_index);
data/minetestmapper-20200328/Image.cpp:115: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).
	FILE *f = fopen(filename.c_str(), "wb");
data/minetestmapper-20200328/PixelAttributes.cpp:38: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(m_pixelAttributes[FirstLine], m_pixelAttributes[LastLine], lineLength);
data/minetestmapper-20200328/PixelAttributes.cpp:40: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(m_pixelAttributes[i], m_pixelAttributes[EmptyLine], lineLength);
data/minetestmapper-20200328/TileGenerator.cpp:218: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).
	in.open(fileName.c_str(), ifstream::in);
data/minetestmapper-20200328/TileGenerator.cpp:286: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 line[512];
data/minetestmapper-20200328/TileGenerator.cpp:299: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 name[128 + 1] = {0};
data/minetestmapper-20200328/db-redis.cpp:127: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 *argv[DB_REDIS_HMGET_NUMFIELDS + 2];
data/minetestmapper-20200328/util.cpp:22: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 linebuf[512];
data/minetestmapper-20200328/PlayerAttributes.cpp:99:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(10000);
data/minetestmapper-20200328/TileGenerator.cpp:296:6:  [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(strlen(line) == 0)
data/minetestmapper-20200328/TileGenerator.cpp:303:15:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
		int items = sscanf(line, "%128s %u %u %u %u %u", name, &r, &g, &b, &a, &t);
data/minetestmapper-20200328/db-sqlite3.cpp:91:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(10000);
data/minetestmapper-20200328/db-sqlite3.cpp:119:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(10000);
data/minetestmapper-20200328/db-sqlite3.cpp:181:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(10000); // Wait some time and try again

ANALYSIS SUMMARY:

Hits = 16
Lines analyzed = 3026 in approximately 0.09 seconds (35244 lines/second)
Physical Source Lines of Code (SLOC) = 2486
Hits@level = [0]   6 [1]   6 [2]   8 [3]   2 [4]   0 [5]   0
Hits@level+ = [0+]  22 [1+]  16 [2+]  10 [3+]   2 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 8.84956 [1+] 6.43604 [2+] 4.02253 [3+] 0.804505 [4+]   0 [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.