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/gamin-0.1.10/lib/gam_event.h
Examining data/gamin-0.1.10/lib/gam_event.c
Examining data/gamin-0.1.10/lib/gam_error.c
Examining data/gamin-0.1.10/lib/gam_error.h
Examining data/gamin-0.1.10/server/gam_fs.h
Examining data/gamin-0.1.10/server/inotify-path.h
Examining data/gamin-0.1.10/server/gam_poll_generic.c
Examining data/gamin-0.1.10/server/gam_server.h
Examining data/gamin-0.1.10/server/gam_eq.c
Examining data/gamin-0.1.10/server/gam_poll_basic.c
Examining data/gamin-0.1.10/server/gam_hurd_mach_notify.h
Examining data/gamin-0.1.10/server/inotify-kernel.h
Examining data/gamin-0.1.10/server/gam_connection.c
Examining data/gamin-0.1.10/server/gam_pidname.h
Examining data/gamin-0.1.10/server/gam_dnotify.c
Examining data/gamin-0.1.10/server/inotify-kernel.c
Examining data/gamin-0.1.10/server/gam_conf.c
Examining data/gamin-0.1.10/server/gam_hurd_mach_notify.c
Examining data/gamin-0.1.10/server/gam_conf.h
Examining data/gamin-0.1.10/server/gam_poll_dnotify.h
Examining data/gamin-0.1.10/server/inotify-sub.h
Examining data/gamin-0.1.10/server/inotify-missing.c
Examining data/gamin-0.1.10/server/inotify-diag.c
Examining data/gamin-0.1.10/server/gam_channel.c
Examining data/gamin-0.1.10/server/gam_tree.c
Examining data/gamin-0.1.10/server/inotify-path.c
Examining data/gamin-0.1.10/server/gam_dnotify.h
Examining data/gamin-0.1.10/server/gam_kqueue.c
Examining data/gamin-0.1.10/server/gam_inotify.c
Examining data/gamin-0.1.10/server/server_config.h
Examining data/gamin-0.1.10/server/gam_excludes.c
Examining data/gamin-0.1.10/server/gam_debugging.c
Examining data/gamin-0.1.10/server/gam_tree.h
Examining data/gamin-0.1.10/server/gam_inotify.h
Examining data/gamin-0.1.10/server/gam_poll_dnotify.c
Examining data/gamin-0.1.10/server/inotify-sub.c
Examining data/gamin-0.1.10/server/inotify-diag.h
Examining data/gamin-0.1.10/server/gam_kqueue.h
Examining data/gamin-0.1.10/server/gam_pidname.c
Examining data/gamin-0.1.10/server/inotify-missing.h
Examining data/gamin-0.1.10/server/gam_connection.h
Examining data/gamin-0.1.10/server/gam_fs.c
Examining data/gamin-0.1.10/server/gam_debugging.h
Examining data/gamin-0.1.10/server/gam_channel.h
Examining data/gamin-0.1.10/server/gam_eq.h
Examining data/gamin-0.1.10/server/gam_poll_generic.h
Examining data/gamin-0.1.10/server/gam_poll_basic.h
Examining data/gamin-0.1.10/server/gam_excludes.h
Examining data/gamin-0.1.10/server/gam_listener.h
Examining data/gamin-0.1.10/server/gam_server.c
Examining data/gamin-0.1.10/server/gam_listener.c
Examining data/gamin-0.1.10/server/gam_node.c
Examining data/gamin-0.1.10/server/gam_node.h
Examining data/gamin-0.1.10/server/gam_subscription.c
Examining data/gamin-0.1.10/server/gam_subscription.h
Examining data/gamin-0.1.10/server/inotify-helper.c
Examining data/gamin-0.1.10/server/inotify-helper.h
Examining data/gamin-0.1.10/tests/testing.c
Examining data/gamin-0.1.10/libgamin/gam_fork.h
Examining data/gamin-0.1.10/libgamin/gam_data.h
Examining data/gamin-0.1.10/libgamin/gam_event.c
Examining data/gamin-0.1.10/libgamin/gam_protocol.h
Examining data/gamin-0.1.10/libgamin/gam_fork.c
Examining data/gamin-0.1.10/libgamin/gamin.c
Examining data/gamin-0.1.10/libgamin/gam_error.c
Examining data/gamin-0.1.10/libgamin/gam_api.c
Examining data/gamin-0.1.10/libgamin/fam.h
Examining data/gamin-0.1.10/libgamin/gam_data.c
Examining data/gamin-0.1.10/python/gamin.c

FINAL RESULTS:

data/gamin-0.1.10/tests/testing.c:371:15:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
        ret = chmod(arg, strtol (arg2, NULL, 8));
data/gamin-0.1.10/tests/testing.c:387:5:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
				chown(arg, strtol(arg2, NULL, 10), -1);
data/gamin-0.1.10/lib/gam_error.c:152:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf((debug_out ? debug_out : stderr), format, args);
data/gamin-0.1.10/lib/gam_error.c:188:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf((debug_out ? debug_out : stdout), format, args);
data/gamin-0.1.10/libgamin/gam_error.c:152:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf((debug_out ? debug_out : stderr), format, args);
data/gamin-0.1.10/libgamin/gam_error.c:188:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf((debug_out ? debug_out : stdout), format, args);
data/gamin-0.1.10/libgamin/gam_fork.c:38: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(server_paths[i], X_OK | R_OK) == 0) {
data/gamin-0.1.10/libgamin/gam_fork.c:102:17:  [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 (client_id, fam_client_id);
data/gamin-0.1.10/libgamin/gam_fork.c:106:13:  [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(server_path, server_path, NULL);
data/gamin-0.1.10/tests/testing.c:251:17:  [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 (client_id, arg);
data/gamin-0.1.10/tests/testing.c:271:15:  [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.
        ret = system("killall gam_server");
data/gamin-0.1.10/lib/gam_error.c:86:13:  [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("GAM_DEBUG") != NULL) {
data/gamin-0.1.10/libgamin/gam_api.c:147: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.
    fam_client_id = getenv("GAM_CLIENT_ID");
data/gamin-0.1.10/libgamin/gam_api.c:385:41:  [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.
            const char *fam_client_id = getenv("GAM_CLIENT_ID");
data/gamin-0.1.10/libgamin/gam_error.c:86:13:  [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("GAM_DEBUG") != NULL) {
data/gamin-0.1.10/libgamin/gam_fork.c:31:38:  [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.
    const char *gamin_debug_server = getenv("GAMIN_DEBUG_SERVER");
data/gamin-0.1.10/server/gam_conf.c:90:25:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';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.
					path = g_strconcat(g_get_home_dir(), &(words[y][1]), NULL);
data/gamin-0.1.10/server/gam_conf.c:114:25:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';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.
	userconf = g_strconcat(g_get_home_dir(), "/.gaminrc", NULL);
data/gamin-0.1.10/server/gam_server.c:141:8:  [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("GAM_TEST_DNOTIFY") && gam_inotify_init()) {
data/gamin-0.1.10/lib/gam_error.c:39:13:  [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 path[50] = "/tmp/gamin_debug_XXXXXX";
data/gamin-0.1.10/lib/gam_error.c:40:22:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
            int fd = mkstemp(path);
data/gamin-0.1.10/libgamin/fam.h:104: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 filename[PATH_MAX];   /* file changed */
data/gamin-0.1.10/libgamin/gam_api.c:62: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.
    static char res[200];
data/gamin-0.1.10/libgamin/gam_api.c:103: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.
static char user_name[100] = "";
data/gamin-0.1.10/libgamin/gam_api.c:145: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 path[MAXPATHLEN + 1];
data/gamin-0.1.10/libgamin/gam_api.c:181: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 path[MAXPATHLEN + 1];
data/gamin-0.1.10/libgamin/gam_api.c:429: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 data[2] = { 0, 0 };
data/gamin-0.1.10/libgamin/gam_api.c:627: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(&req.path[0], filename, len);
data/gamin-0.1.10/libgamin/gam_api.c:856: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(&req.path[0], filename, len);
data/gamin-0.1.10/libgamin/gam_error.c:39:13:  [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 path[50] = "/tmp/gamin_debug_XXXXXX";
data/gamin-0.1.10/libgamin/gam_error.c:40:22:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
            int fd = mkstemp(path);
data/gamin-0.1.10/libgamin/gam_fork.c:80:7:  [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 ("/dev/null", O_RDONLY);
data/gamin-0.1.10/libgamin/gam_fork.c:86:7:  [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 ("/dev/null", O_WRONLY);
data/gamin-0.1.10/libgamin/gam_fork.c:101:17:  [2] (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). Risk is low because the source is a constant string.
                strcpy (client_id, "GAM_CLIENT_ID=");
data/gamin-0.1.10/libgamin/gam_protocol.h: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 path[MAXPATHLEN];	/* the path to the file */
data/gamin-0.1.10/server/gam_channel.c:31: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 data[2] = { 0, 0 };
data/gamin-0.1.10/server/gam_conf.c:70:21:  [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).
					poll_timeout = atoi (words[3]);
data/gamin-0.1.10/server/gam_connection.c:608: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(req.path, path, len);
data/gamin-0.1.10/server/gam_connection.c:684: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(req.path, path, len);
data/gamin-0.1.10/server/gam_dnotify.c:144: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).
        fd = open(path, O_RDONLY);
data/gamin-0.1.10/server/gam_dnotify.c:218:9:  [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(data->path, O_RDONLY);
data/gamin-0.1.10/server/gam_dnotify.c:295: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[5000];
data/gamin-0.1.10/server/gam_hurd_mach_notify.c:101:13:  [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).
    m->fd = open (m->path, O_RDONLY);
data/gamin-0.1.10/server/gam_hurd_mach_notify.c:197: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->path, path, tail - path + 1);
data/gamin-0.1.10/server/gam_hurd_mach_notify.c:232: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 (dir, m->path, tail - m->path + 1);
data/gamin-0.1.10/server/gam_hurd_mach_notify.c:549: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 b[offsetof (struct dirent, d_name) + NAME_MAX + 1];
data/gamin-0.1.10/server/gam_kqueue.c:519:13:  [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).
  mon->fd = open(mon->pathname, O_RDONLY | O_NOFOLLOW);
data/gamin-0.1.10/server/gam_kqueue.c:1075: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(&mon->sb, &sb, sizeof(sb));
data/gamin-0.1.10/server/gam_kqueue.c:1104: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(&mon->sb, &sb, sizeof(sb));
data/gamin-0.1.10/server/gam_pidname.c:18: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).
    fp = fopen(procname, "r");
data/gamin-0.1.10/server/gam_poll_basic.c:312: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(&(node->sbuf), &(sbuf), sizeof(struct stat));
data/gamin-0.1.10/server/gam_poll_basic.c:360: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(&(node->sbuf), &(sbuf), sizeof(struct stat));
data/gamin-0.1.10/server/gam_poll_dnotify.c:191: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(&(node->sbuf), &(sbuf), sizeof(struct stat));
data/gamin-0.1.10/server/gam_poll_dnotify.c:255: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(&(node->sbuf), &(sbuf), sizeof(struct stat));
data/gamin-0.1.10/server/gam_server.c:529: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[5000];
data/gamin-0.1.10/tests/testing.c:20: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.
static char pwd[250];
data/gamin-0.1.10/tests/testing.c:21: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.
static char filename[MAXPATHLEN + 250];
data/gamin-0.1.10/tests/testing.c:84: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.
    static char error[15];
data/gamin-0.1.10/tests/testing.c:250:17:  [2] (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). Risk is low because the source is a constant string.
                strcpy (client_id, "GAM_CLIENT_ID=");
data/gamin-0.1.10/tests/testing.c:401:15:  [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).
        ret = open(arg, O_CREAT | O_WRONLY, 0666);
data/gamin-0.1.10/tests/testing.c:414:15:  [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).
        ret = open(arg, O_RDWR | O_APPEND);
data/gamin-0.1.10/tests/testing.c:544: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 command[MAXPATHLEN + 201];
data/gamin-0.1.10/tests/testing.c:551:6:  [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(filename, "r");
data/gamin-0.1.10/libgamin/gam_api.c:123:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(user_name, pw->pw_name, 99);
data/gamin-0.1.10/libgamin/gam_api.c:370:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(&addr.sun_path[1], path, (sizeof(addr) - 4) - 2);
data/gamin-0.1.10/libgamin/gam_api.c:380:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(&addr.sun_path[0], path, (sizeof(addr) - 4) - 1);
data/gamin-0.1.10/libgamin/gam_api.c:401: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/gamin-0.1.10/libgamin/gam_api.c:574: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(filename);
data/gamin-0.1.10/libgamin/gam_api.c:591: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(filename);
data/gamin-0.1.10/libgamin/gam_api.c:603: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(filename);
data/gamin-0.1.10/libgamin/gam_api.c:797:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(fd, (char *) data, size);
data/gamin-0.1.10/libgamin/gam_api.c:844: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(filename);
data/gamin-0.1.10/libgamin/gam_api.c:1082:34:  [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 ((filename[0] != '/') || (strlen(filename) >= MAXPATHLEN)) {
data/gamin-0.1.10/libgamin/gam_api.c:1124:34:  [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 ((filename[0] != '/') || (strlen(filename) >= MAXPATHLEN)) {
data/gamin-0.1.10/libgamin/gam_api.c:1166:34:  [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 ((filename[0] != '/') || (strlen(filename) >= MAXPATHLEN)) {
data/gamin-0.1.10/libgamin/gam_api.c:1206:34:  [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 ((filename[0] != '/') || (strlen(filename) >= MAXPATHLEN)) {
data/gamin-0.1.10/libgamin/gam_api.c:1506:9:  [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(filename) >= MAXPATHLEN) {
data/gamin-0.1.10/libgamin/gam_data.c:573:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(&(event->filename[0]), &(evn->path[0]), evn->pathlen);
data/gamin-0.1.10/libgamin/gam_fork.c:98:39:  [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 *client_id = malloc (strlen (fam_client_id) + sizeof "GAM_CLIENT_ID=");
data/gamin-0.1.10/server/gam_channel.c:260:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(fd, data, size);
data/gamin-0.1.10/server/gam_channel.c:636:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(&addr.sun_path[1], path, (sizeof(addr) - 4) - 2);
data/gamin-0.1.10/server/gam_channel.c:646:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(&addr.sun_path[0], path, (sizeof(addr) - 4) - 1);
data/gamin-0.1.10/server/gam_channel.c:647:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(0077);
data/gamin-0.1.10/server/gam_debugging.c:67:41:  [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).
	gam_send_event(conn, event, 50, value, strlen(value));
data/gamin-0.1.10/server/gam_excludes.c:81: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(filename);
data/gamin-0.1.10/server/gam_fs.c:110:9:  [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).
	return strlen(fsb->path) - strlen (fsa->path);
data/gamin-0.1.10/server/gam_fs.c:110:29:  [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).
	return strlen(fsb->path) - strlen (fsa->path);
data/gamin-0.1.10/server/gam_hurd_mach_notify.c:190: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).
	const char *tail = path + strlen (path) - 1;
data/gamin-0.1.10/server/gam_pidname.c:26:30:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    int ch = fgetc (fp);
data/gamin-0.1.10/server/gam_server.c:314: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).
    pathlen = strlen(path);
data/gamin-0.1.10/server/gam_server.c:377: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).
    pathlen = strlen(path);
data/gamin-0.1.10/server/gam_subscription.c:78: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).
    sub->pathlen = strlen(path);
data/gamin-0.1.10/server/gam_tree.c:196:26:  [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).
    g_return_val_if_fail(strlen(path) > 0, NULL);
data/gamin-0.1.10/server/gam_tree.c:209:21:  [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).
    for (i = 1; i < strlen(path_cpy); i++) {
data/gamin-0.1.10/server/inotify-kernel.c:257: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).
	event->len = strlen (event->name);
data/gamin-0.1.10/server/inotify-sub.c:84:8:  [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 (sub->dirname);
data/gamin-0.1.10/tests/testing.c:247:39:  [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 *client_id = malloc (strlen (arg) + sizeof "GAM_CLIENT_ID=");
data/gamin-0.1.10/tests/testing.c:506: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/gamin-0.1.10/tests/testing.c:562:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    ret = read(0, &command[clen], MAXPATHLEN + 200 - clen);

ANALYSIS SUMMARY:

Hits = 99
Lines analyzed = 16413 in approximately 0.42 seconds (39220 lines/second)
Physical Source Lines of Code (SLOC) = 10816
Hits@level = [0]  88 [1]  36 [2]  44 [3]   8 [4]   9 [5]   2
Hits@level+ = [0+] 187 [1+]  99 [2+]  63 [3+]  19 [4+]  11 [5+]   2
Hits/KSLOC@level+ = [0+] 17.2892 [1+] 9.15311 [2+] 5.8247 [3+] 1.75666 [4+] 1.01701 [5+] 0.184911
Dot directories skipped = 4 (--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.