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/mpdas-0.4.5/mpd.h
Examining data/mpdas-0.4.5/main.cpp
Examining data/mpdas-0.4.5/config.h
Examining data/mpdas-0.4.5/md5.h
Examining data/mpdas-0.4.5/md5.cpp
Examining data/mpdas-0.4.5/utils.h
Examining data/mpdas-0.4.5/mpdas.h
Examining data/mpdas-0.4.5/cache.h
Examining data/mpdas-0.4.5/utils.cpp
Examining data/mpdas-0.4.5/cache.cpp
Examining data/mpdas-0.4.5/mpd.cpp
Examining data/mpdas-0.4.5/audioscrobbler.h
Examining data/mpdas-0.4.5/config.cpp
Examining data/mpdas-0.4.5/audioscrobbler.cpp
Examining data/mpdas-0.4.5/ini.h
Examining data/mpdas-0.4.5/ini.cpp

FINAL RESULTS:

data/mpdas-0.4.5/utils.cpp:10:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(file, F_OK) == 0)
data/mpdas-0.4.5/cache.cpp:7:21:  [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.
	std::string path = getenv("HOME");
data/mpdas-0.4.5/cache.cpp:31:21:  [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.
	std::string path = getenv("HOME");
data/mpdas-0.4.5/main.cpp:103:22:  [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.
		std::string home = getenv("HOME");
data/mpdas-0.4.5/main.cpp:106:6:  [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("XDG_CONFIG_HOME")) {
data/mpdas-0.4.5/main.cpp:107:28:  [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.
			xdgconfig = std::string(getenv("XDG_CONFIG_HOME"));
data/mpdas-0.4.5/config.cpp:43:12:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    return atoi(Get(name).c_str());
data/mpdas-0.4.5/ini.cpp:84: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 line[INI_MAX_LINE];
data/mpdas-0.4.5/ini.cpp:88: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 section[MAX_SECTION] = "";
data/mpdas-0.4.5/ini.cpp:89: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 prev_name[MAX_NAME] = "";
data/mpdas-0.4.5/ini.cpp:201: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 = fopen(filename, "r");
data/mpdas-0.4.5/md5.cpp:169: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(xbuf, data, 64);
data/mpdas-0.4.5/md5.cpp:343: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(pms->buf + offset, p, copy);
data/mpdas-0.4.5/md5.cpp:357: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(pms->buf, p, left);
data/mpdas-0.4.5/utils.cpp:26: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.
	unsigned char md5buf[16];
data/mpdas-0.4.5/ini.cpp:36:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    char* p = s + strlen(s);
data/mpdas-0.4.5/ini.cpp:73:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dest, src, size);
data/mpdas-0.4.5/ini.cpp:241: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).
    ctx.num_left = strlen(string);
data/mpdas-0.4.5/main.cpp:23:5:  [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(username) == 0)
data/mpdas-0.4.5/main.cpp:150:3:  [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(500000);

ANALYSIS SUMMARY:

Hits = 20
Lines analyzed = 1986 in approximately 0.06 seconds (32852 lines/second)
Physical Source Lines of Code (SLOC) = 1455
Hits@level = [0]   8 [1]   5 [2]   9 [3]   5 [4]   1 [5]   0
Hits@level+ = [0+]  28 [1+]  20 [2+]  15 [3+]   6 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 19.244 [1+] 13.7457 [2+] 10.3093 [3+] 4.12371 [4+] 0.687285 [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.