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/menu-cache-1.1.0/libmenu-cache/version.h
Examining data/menu-cache-1.1.0/libmenu-cache/menu-cache.c
Examining data/menu-cache-1.1.0/menu-cache-gen/menu-tags.h
Examining data/menu-cache-1.1.0/menu-cache-gen/menu-compose.c
Examining data/menu-cache-1.1.0/menu-cache-gen/main.c
Examining data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c
Examining data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c

FINAL RESULTS:

data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1566:9:  [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(MENUCACHE_LIBEXECDIR "/menu-cached", MENUCACHE_LIBEXECDIR "/menu-cached",
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:751:18:  [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.
        else if (access(cache->cache_file, R_OK) != 0)
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1545:52:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
    g_snprintf( buf, len, "%s/.menu-cached-%s-%s", g_get_tmp_dir(),
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:508:52:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
    g_snprintf( buf, len, "%s/.menu-cached-%s-%s", g_get_tmp_dir(),
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:180:31:  [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).
        dir->flags = (guint32)atoi(line);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:265:27:  [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).
    app->flags = (guint32)atoi(line);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:272:35:  [2] (integer) atol:
  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).
    app->show_in_flags = (guint32)atol(line);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:460:11:  [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).
    idx = atoi( line );
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:497: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).
    n = atoi( line );
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1586: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[1024]; /* protocol has a lot shorter strings */
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1836:5:  [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( cache->md5, md5, 32 );
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1870: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[38];
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:59: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 md5[33]; /* cache id */
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:146: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[ 4096 ];
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:168: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).
    n = atoi( line );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:262:9:  [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( cache_file, "r" );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:283: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[38];
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:292:5:  [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( buf, "REL:", 4 );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:293:5:  [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( buf + 4, cache->md5, 32 );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:461:9:  [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( cache_file, "r" );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:550:10:  [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).
    fd = open(lockfile, O_CREAT | O_EXCL | O_WRONLY, 0700);
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:668: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 reload_cmd[38] = "REL:";
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:698:15:  [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 *)md5)[-1] = '\0';
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:721: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( cache->md5, md5, 33 );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:771:9:  [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(reload_cmd + 4, md5, 32);
data/menu-cache-1.1.0/menu-cache-gen/menu-compose.c:1036: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 *de_names[N_KNOWN_DESKTOPS] = { "LXDE",
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:702: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).
            menu->layout.inline_limit = atoi(attribute_values[0]);
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:829:36:  [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).
            layout->inline_limit = atoi(attribute_values[0]);
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:1508: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(item, sep, sizeof(MenuMerge));
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:1513: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(item, sep, sizeof(MenuSep));
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:1518: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(item, sep, sizeof(MenuFilename));
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:1524: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(item, sep, sizeof(MenuMenuname));
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:233:31:  [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).
        memmove(&str[len], p, strlen(p) + 1);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1596:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        sz = read(fd, &buf[ptr], sizeof(buf) - ptr);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1748:13:  [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(50000);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1828:11:  [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(buf);
data/menu-cache-1.1.0/libmenu-cache/menu-cache.c:1858: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).
    ssize_t len = strlen(cache->reg);
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:178: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).
        len = strlen( line );
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:407:27:  [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(dir_path);
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:516:43:  [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).
    socklen_t len = sizeof(sa_family_t) + strlen(addr->sun_path) + 1;
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:907: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).
    else if (strlen(argv[1]) >= sizeof(addr.sun_path))
data/menu-cache-1.1.0/menu-cache-daemon/menu-cached.c:912:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(addr.sun_path, argv[1], sizeof(addr.sun_path) - 1);
data/menu-cache-1.1.0/menu-cache-gen/main.c:100: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).
        ifile[strlen(ifile)-7] = '\0';
data/menu-cache-1.1.0/menu-cache-gen/menu-compose.c:606: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).
            len = strlen(l->data);
data/menu-cache-1.1.0/menu-cache-gen/menu-compose.c:616: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).
            len = strlen(l->data);
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:423:54:  [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).
                        rel_path = data->file_path + strlen(dir[0]);
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:429:50:  [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).
                    rel_path = data->file_path + strlen(g_get_user_config_dir());
data/menu-cache-1.1.0/menu-cache-gen/menu-merge.c:964: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(name) <= 5 || !g_str_has_suffix(name, ".menu"))

ANALYSIS SUMMARY:

Hits = 48
Lines analyzed = 6519 in approximately 0.18 seconds (36134 lines/second)
Physical Source Lines of Code (SLOC) = 5009
Hits@level = [0]  14 [1]  16 [2]  28 [3]   2 [4]   2 [5]   0
Hits@level+ = [0+]  62 [1+]  48 [2+]  32 [3+]   4 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 12.3777 [1+] 9.58275 [2+] 6.3885 [3+] 0.798563 [4+] 0.399281 [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.