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/gmtp-1.3.11/src/mtp.c
Examining data/gmtp-1.3.11/src/main.h
Examining data/gmtp-1.3.11/src/mtp.h
Examining data/gmtp-1.3.11/src/progress.c
Examining data/gmtp-1.3.11/src/interface.h
Examining data/gmtp-1.3.11/src/metatag_info.h
Examining data/gmtp-1.3.11/src/properties.h
Examining data/gmtp-1.3.11/src/albumart.h
Examining data/gmtp-1.3.11/src/about.h
Examining data/gmtp-1.3.11/src/metatag_info.c
Examining data/gmtp-1.3.11/src/interface.c
Examining data/gmtp-1.3.11/src/preferences.c
Examining data/gmtp-1.3.11/src/main.c
Examining data/gmtp-1.3.11/src/callbacks.h
Examining data/gmtp-1.3.11/src/formatdevice.h
Examining data/gmtp-1.3.11/src/about.c
Examining data/gmtp-1.3.11/src/preferences.h
Examining data/gmtp-1.3.11/src/playlist.h
Examining data/gmtp-1.3.11/src/prefs.h
Examining data/gmtp-1.3.11/src/albumart.c
Examining data/gmtp-1.3.11/src/prefs.c
Examining data/gmtp-1.3.11/src/properties.c
Examining data/gmtp-1.3.11/src/dnd.c
Examining data/gmtp-1.3.11/src/playlist.c
Examining data/gmtp-1.3.11/src/progress.h
Examining data/gmtp-1.3.11/src/formatdevice.c
Examining data/gmtp-1.3.11/src/dnd.h
Examining data/gmtp-1.3.11/src/callbacks.c

FINAL RESULTS:

data/gmtp-1.3.11/src/interface.c:2020:13:  [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(fullfilename, F_OK) != -1) {
data/gmtp-1.3.11/src/main.c:165:17:  [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(filepath, F_OK) != -1) {
data/gmtp-1.3.11/src/mtp.c:1098:21:  [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(fullfilename, F_OK) != -1) {
data/gmtp-1.3.11/src/mtp.c:1161:21:  [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(fullfilename2, F_OK) != -1) {
data/gmtp-1.3.11/src/main.c:159:36:  [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.
        gchar *fullpath = g_strdup(getenv("PATH"));
data/gmtp-1.3.11/src/albumart.c:424:30:  [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(filename, "w");
data/gmtp-1.3.11/src/interface.c:1411:20:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    LIBMTP_file_t *tmpfile;
data/gmtp-1.3.11/src/interface.c:1491:16:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        while (tmpfile != NULL) {
data/gmtp-1.3.11/src/metatag_info.c:242:16:  [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).
    mp3_file = fopen(filename, "r");
data/gmtp-1.3.11/src/metatag_info.c:301:45:  [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).
            trackinformation->tracknumber = atoi(tracknumber);
data/gmtp-1.3.11/src/metatag_info.c:322:42:  [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).
            trackinformation->duration = atoi(trackduration);
data/gmtp-1.3.11/src/metatag_info.c:386:13:  [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).
    mfile = fopen(filename, "r");
data/gmtp-1.3.11/src/metatag_info.c:409: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).
        trackinformation->tracknumber = atoi(tracknumber);
data/gmtp-1.3.11/src/metatag_info.c:463: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).
        trackinformation->tracknumber = atoi(tracknumber);
data/gmtp-1.3.11/src/metatag_info.c:527:16:  [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).
    ASF_File = fopen(filename, "r");
data/gmtp-1.3.11/src/mtp.c:1276:20:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    LIBMTP_file_t* tmpfile;
data/gmtp-1.3.11/src/mtp.c:1280:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        aafile = tmpfile;
data/gmtp-1.3.11/src/mtp.c:1284:12:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    while (tmpfile != NULL) {
data/gmtp-1.3.11/src/mtp.c:1310:20:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    LIBMTP_file_t* tmpfile;
data/gmtp-1.3.11/src/mtp.c:1314:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        aafile = tmpfile;
data/gmtp-1.3.11/src/mtp.c:1318:12:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    while (tmpfile != NULL) {
data/gmtp-1.3.11/src/mtp.c:1345:33:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        LIBMTP_file_t* aafile = tmpfile;
data/gmtp-1.3.11/src/mtp.c:1346:16:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        while (tmpfile != NULL) {
data/gmtp-1.3.11/src/mtp.c:1384:33:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        LIBMTP_file_t* aafile = tmpfile;
data/gmtp-1.3.11/src/mtp.c:1385:16:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
        while (tmpfile != NULL) {
data/gmtp-1.3.11/src/mtp.c:1467:13:  [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(tracks, found_album->tracks, found_album->no_tracks * sizeof (uint32_t));
data/gmtp-1.3.11/src/mtp.c:1523:10:  [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(filename, "r");
data/gmtp-1.3.11/src/mtp.c:1688:10:  [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(filename, "r");
data/gmtp-1.3.11/src/mtp.c:1778:10:  [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(filename, "w");
data/gmtp-1.3.11/src/mtp.c:1896:12:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    while (tmpfile != NULL) {
data/gmtp-1.3.11/src/interface.c:1537:33:  [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(trackinfo->date) > 4)
data/gmtp-1.3.11/src/interface.c:1671:28:  [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).
            stringlength = strlen(fullfilename);
data/gmtp-1.3.11/src/interface.c:2434: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).
        if (strlen(textfield) == 0) {
data/gmtp-1.3.11/src/interface.c:2492: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).
        if (strlen(textfield) == 0) {
data/gmtp-1.3.11/src/interface.c:2550: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).
        if (strlen(textfield) == 0) {
data/gmtp-1.3.11/src/mtp.c:648: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).
            if (strlen(trackfile->date) == 4) {
data/gmtp-1.3.11/src/mtp.c:2044: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).
    stringlength = strlen(fullfilename);
data/gmtp-1.3.11/src/playlist.c:916: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).
        if (strlen(textfield) == 0) {

ANALYSIS SUMMARY:

Hits = 38
Lines analyzed = 14348 in approximately 0.40 seconds (36191 lines/second)
Physical Source Lines of Code (SLOC) = 9859
Hits@level = [0]  31 [1]   8 [2]  25 [3]   1 [4]   4 [5]   0
Hits@level+ = [0+]  69 [1+]  38 [2+]  30 [3+]   5 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 6.99868 [1+] 3.85435 [2+] 3.0429 [3+] 0.507151 [4+] 0.405721 [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.