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/umockdev-0.15.2/docs/examples/battery.c
Examining data/umockdev-0.15.2/src/debug.c
Examining data/umockdev-0.15.2/src/debug.h
Examining data/umockdev-0.15.2/src/ioctl_tree.c
Examining data/umockdev-0.15.2/src/ioctl_tree.h
Examining data/umockdev-0.15.2/src/libumockdev-preload.c
Examining data/umockdev-0.15.2/src/uevent_sender.c
Examining data/umockdev-0.15.2/src/uevent_sender.h
Examining data/umockdev-0.15.2/tests/chatter-socket-stream.c
Examining data/umockdev-0.15.2/tests/chatter.c
Examining data/umockdev-0.15.2/tests/readbyte.c
Examining data/umockdev-0.15.2/tests/test-ioctl-tree.c
Examining data/umockdev-0.15.2/tests/test-umockdev.c

FINAL RESULTS:

data/umockdev-0.15.2/src/libumockdev-preload.c:202:9:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    if (readlink(buf, link, sizeof(link)) < 0) {
data/umockdev-0.15.2/src/libumockdev-preload.c:243:15:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    libc_func(readlink, ssize_t, const char*, char*, size_t);
data/umockdev-0.15.2/src/libumockdev-preload.c:1344:21:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
WRAP_2ARGS(int, -1, chmod, mode_t);
data/umockdev-0.15.2/src/libumockdev-preload.c:1355:25:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
WRAP_3ARGS(ssize_t, -1, readlink, char *, size_t);
data/umockdev-0.15.2/src/libumockdev-preload.c:1379:15:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    libc_func(readlink, ssize_t, const char*, char *, size_t);					\
data/umockdev-0.15.2/src/libumockdev-preload.c:1674:15:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    libc_func(readlink, ssize_t, const char*, char*, size_t);
data/umockdev-0.15.2/docs/examples/battery.c:43:5:  [4] (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).
    strcpy (path, exec + 5);
data/umockdev-0.15.2/src/debug.h:20:51:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define DBG(cat, ...) if (cat & debug_categories) fprintf(stderr, __VA_ARGS__)
data/umockdev-0.15.2/src/libumockdev-preload.c:119:15:  [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.
    libc_func(access, int, const char*, int);
data/umockdev-0.15.2/src/libumockdev-preload.c:170:5:  [4] (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).
    strcpy(buf, prefix);
data/umockdev-0.15.2/src/libumockdev-preload.c:175:5:  [4] (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).
    strcpy(buf + trap_path_prefix_len, path);
data/umockdev-0.15.2/src/libumockdev-preload.c:1345: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.
WRAP_2ARGS(int, -1, access, int);
data/umockdev-0.15.2/src/debug.c:12: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.
    const char *d = getenv("UMOCKDEV_DEBUG");
data/umockdev-0.15.2/src/libumockdev-preload.c:153:14:  [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.
    prefix = getenv("UMOCKDEV_DIR");
data/umockdev-0.15.2/src/libumockdev-preload.c:191:63:  [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.
    name_offset = snprintf(buf, sizeof(buf), "%s/dev/.node/", getenv("UMOCKDEV_DIR"));
data/umockdev-0.15.2/src/libumockdev-preload.c:350:24:  [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 *path = getenv("UMOCKDEV_DIR");
data/umockdev-0.15.2/src/libumockdev-preload.c:368:24:  [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 *path = getenv("UMOCKDEV_DIR");
data/umockdev-0.15.2/src/libumockdev-preload.c:437: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.
	const char *dev = getenv("UMOCKDEV_IOCTL_RECORD_DEV");
data/umockdev-0.15.2/src/libumockdev-preload.c:470: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.
	const char *path = getenv("UMOCKDEV_IOCTL_RECORD_FILE");
data/umockdev-0.15.2/src/libumockdev-preload.c:471: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.
	const char *device_path = getenv("UMOCKDEV_IOCTL_RECORD_DEVICE_PATH");
data/umockdev-0.15.2/src/libumockdev-preload.c:482: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("UMOCKDEV_DIR") != NULL) {
data/umockdev-0.15.2/src/libumockdev-preload.c:560: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.
	fprintf(ioctl_record_log, "@DEV %s\n", getenv("UMOCKDEV_IOCTL_RECORD_DEVICE_PATH"));
data/umockdev-0.15.2/src/libumockdev-preload.c:624:61:  [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.
    snprintf(ioctl_path, sizeof(ioctl_path), "%s/ioctl/%s", getenv("UMOCKDEV_DIR"), dev_path);
data/umockdev-0.15.2/src/libumockdev-preload.c:730:12:  [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.
	logname = getenv(varname);
data/umockdev-0.15.2/src/libumockdev-preload.c:734:12:  [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.
	devname = getenv(varname);
data/umockdev-0.15.2/src/libumockdev-preload.c:740:11:  [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.
	format = getenv(varname);
data/umockdev-0.15.2/src/libumockdev-preload.c:750:16:  [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.
	    devpath = getenv(varname);
data/umockdev-0.15.2/src/libumockdev-preload.c:922:24:  [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 *path = getenv("UMOCKDEV_DIR");
data/umockdev-0.15.2/src/libumockdev-preload.c:1453:34:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
WRAP_2ARGS_PATHRET(char *, NULL, realpath, char *);
data/umockdev-0.15.2/src/libumockdev-preload.c:1701:59:  [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.
    snprintf(ptymap, sizeof(ptymap), "%s/dev/.ptymap/%s", getenv("UMOCKDEV_DIR"), ttyname);
data/umockdev-0.15.2/tests/test-umockdev.c:1033:12:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    path = realpath("/sys/devices/dev1", pathbuf);
data/umockdev-0.15.2/tests/test-umockdev.c:1037:12:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    path = realpath("/sys/bus/../bus/pci/devices/./dev1", pathbuf);
data/umockdev-0.15.2/tests/test-umockdev.c:1041:14:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    g_assert(realpath("/sys/devices/xxnoexist", pathbuf) == NULL);
data/umockdev-0.15.2/tests/test-umockdev.c:1045:12:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    path = realpath("/sys/devices/dev1", NULL);
data/umockdev-0.15.2/docs/examples/battery.c:35: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 path[PATH_MAX];
data/umockdev-0.15.2/src/ioctl_tree.c:66: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 lead_ws[1001];
data/umockdev-0.15.2/src/ioctl_tree.c:67: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 ioctl_name[101];
data/umockdev-0.15.2/src/ioctl_tree.c:480: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->data, data, NSIZE(node));
data/umockdev-0.15.2/src/ioctl_tree.c:530: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(arg, node->data, NSIZE(node));
data/umockdev-0.15.2/src/ioctl_tree.c:554: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->data, data, size);
data/umockdev-0.15.2/src/ioctl_tree.c:603: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(arg, node->data, size);
data/umockdev-0.15.2/src/ioctl_tree.c:626: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(copy, urb, sizeof(struct usbdevfs_urb));
data/umockdev-0.15.2/src/ioctl_tree.c:629: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(copy->buffer, urb->buffer, urb->buffer_length);
data/umockdev-0.15.2/src/ioctl_tree.c:753:6:  [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(submit_urb->buffer, orig_node_urb->buffer, orig_node_urb->actual_length);
data/umockdev-0.15.2/src/ioctl_tree.c:951:11:  [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).
	offset = atol(parens + 1);
data/umockdev-0.15.2/src/ioctl_tree.h:31: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 name[100];
data/umockdev-0.15.2/src/libumockdev-preload.c:144: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 buf[PATH_MAX * 2];
data/umockdev-0.15.2/src/libumockdev-preload.c:171:5:  [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(buf + trap_path_prefix_len, "/disabled");
data/umockdev-0.15.2/src/libumockdev-preload.c:186: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 buf[PATH_MAX];
data/umockdev-0.15.2/src/libumockdev-preload.c:187: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 link[PATH_MAX];
data/umockdev-0.15.2/src/libumockdev-preload.c:246: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 dest[10];		/* big enough, we are only interested in the prefix */
data/umockdev-0.15.2/src/libumockdev-preload.c:429:15:  [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).
    libc_func(fopen, FILE*, const char *, const char*);
data/umockdev-0.15.2/src/libumockdev-preload.c:609:15:  [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).
    libc_func(fopen, FILE*, const char *, const char*);
data/umockdev-0.15.2/src/libumockdev-preload.c:612: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 ioctl_path[PATH_MAX];
data/umockdev-0.15.2/src/libumockdev-preload.c:723: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 varname[100];
data/umockdev-0.15.2/src/libumockdev-preload.c:792:15:  [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).
    libc_func(fopen, FILE*, const char *, const char*);
data/umockdev-0.15.2/src/libumockdev-preload.c:814:6:  [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[1000];
data/umockdev-0.15.2/src/libumockdev-preload.c:977: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 header[100];
data/umockdev-0.15.2/src/libumockdev-preload.c:1257: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).
int prefix ## open ## suffix (const char *path, int flags, ...)	    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1260:25:  [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).
    libc_func(prefix ## open ## suffix, int, const char*, int, ...);\
data/umockdev-0.15.2/src/libumockdev-preload.c:1275:23:  [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 = _ ## prefix ## open ## suffix(p, flags, mode);   	    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1277:24:  [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 =  _ ## prefix ## open ## suffix(p, flags);		    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1289: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).
int prefix ## open ## suffix (const char *path, int flags)	    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1292:25:  [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).
    libc_func(prefix ## open ## suffix, int, const char*, int);	    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1301:27:  [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 =  _ ## prefix ## open ## suffix(p, flags);		    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1314:17:  [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* prefix ## fopen ## suffix (const char *path, const char *mode)  \
data/umockdev-0.15.2/src/libumockdev-preload.c:1317:25:  [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).
    libc_func(prefix ## fopen ## suffix, FILE*, const char*, const char*);\
data/umockdev-0.15.2/src/libumockdev-preload.c:1326:27:  [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).
    ret =  _ ## prefix ## fopen ## suffix(p, mode);		    \
data/umockdev-0.15.2/src/libumockdev-preload.c:1384:16:  [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 buf[PATH_MAX],link[PATH_MAX];						\
data/umockdev-0.15.2/src/libumockdev-preload.c:1676: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 ttyname[1024];
data/umockdev-0.15.2/src/libumockdev-preload.c:1677: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 ptymap[PATH_MAX];
data/umockdev-0.15.2/src/libumockdev-preload.c:1678: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 majmin[20];
data/umockdev-0.15.2/src/uevent_sender.c:37: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 socket_glob[PATH_MAX];
data/umockdev-0.15.2/src/uevent_sender.c:126: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 prefix[8];
data/umockdev-0.15.2/src/uevent_sender.c:218: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 props[1024];
data/umockdev-0.15.2/src/uevent_sender.c:225: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 seqnumstr[20];
data/umockdev-0.15.2/src/uevent_sender.c:256: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(nlh.prefix, "libudev", 8);
data/umockdev-0.15.2/tests/chatter-socket-stream.c:47: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[100];
data/umockdev-0.15.2/tests/chatter.c:43: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[100];
data/umockdev-0.15.2/tests/chatter.c:51: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(argv[1], O_RDWR);
data/umockdev-0.15.2/tests/readbyte.c:40: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(argv[1], O_RDWR);
data/umockdev-0.15.2/tests/readbyte.c:57: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).
        f = fopen(argv[1], "rb");
data/umockdev-0.15.2/tests/test-ioctl-tree.c:78:9:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    f = tmpfile();
data/umockdev-0.15.2/tests/test-ioctl-tree.c:241: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 contents[1000];
data/umockdev-0.15.2/tests/test-ioctl-tree.c:260:9:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    f = tmpfile();
data/umockdev-0.15.2/tests/test-ioctl-tree.c:276: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 contents[1000];
data/umockdev-0.15.2/tests/test-ioctl-tree.c:282:9:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    f = tmpfile();
data/umockdev-0.15.2/tests/test-ioctl-tree.c:361: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(urb->buffer, orig->buffer, orig->buffer_length);
data/umockdev-0.15.2/tests/test-ioctl-tree.c:368: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 urbbuf[15];
data/umockdev-0.15.2/tests/test-ioctl-tree.c:391: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 urbbuf[15];
data/umockdev-0.15.2/tests/test-ioctl-tree.c:480: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 contents[1000];
data/umockdev-0.15.2/tests/test-ioctl-tree.c:484: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 synbits[4] = "\x01\x02\x03\x04";
data/umockdev-0.15.2/tests/test-ioctl-tree.c:485: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 keybits[48] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
data/umockdev-0.15.2/tests/test-ioctl-tree.c:486: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 pwrbits[4] = "\x00\x00\x00\x00";
data/umockdev-0.15.2/tests/test-ioctl-tree.c:487: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 bits_query[48];
data/umockdev-0.15.2/tests/test-ioctl-tree.c:508:9:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    f = tmpfile();
data/umockdev-0.15.2/tests/test-umockdev.c:778: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[1000];
data/umockdev-0.15.2/tests/test-umockdev.c:780:14:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    stderr = tmpfile();
data/umockdev-0.15.2/tests/test-umockdev.c:820: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 long_action[4096];
data/umockdev-0.15.2/tests/test-umockdev.c:1019: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 pathbuf[PATH_MAX];
data/umockdev-0.15.2/tests/test-umockdev.c:1070: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).
    dirfd = open("/", O_RDONLY | O_DIRECTORY);
data/umockdev-0.15.2/tests/test-umockdev.c:1088: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).
    dirfd = open("/run", O_RDONLY | O_DIRECTORY);
data/umockdev-0.15.2/tests/test-umockdev.c:1153: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[100];
data/umockdev-0.15.2/tests/test-umockdev.c:1194:14:  [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).
    g_assert(fopen("/dev/wishyouwerehere", "r") == NULL);
data/umockdev-0.15.2/tests/test-umockdev.c:1196: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("/dev/zero", "rb");
data/umockdev-0.15.2/tests/test-umockdev.c:1397: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[1024];
data/umockdev-0.15.2/tests/test-umockdev.c:1419:18:  [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 cur = ((char *)dummy_events)[i];
data/umockdev-0.15.2/tests/test-umockdev.c:1473: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[1024];
data/umockdev-0.15.2/tests/test-umockdev.c:1582: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[1024];
data/umockdev-0.15.2/tests/test-umockdev.c:1622: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[1024];
data/umockdev-0.15.2/tests/test-umockdev.c:1663: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[1024];
data/umockdev-0.15.2/tests/test-umockdev.c:1728: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[1024];
data/umockdev-0.15.2/tests/test-umockdev.c:2137:22:  [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).
    if (f != NULL && atoi(f) > 0)
data/umockdev-0.15.2/tests/test-umockdev.c:2138:35:  [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).
            slow_testbed_factor = atoi(f);
data/umockdev-0.15.2/src/ioctl_tree.c:74:6:  [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.
	if (sscanf(line, "%1000[ ]%100s %i %n", lead_ws, ioctl_name, &ret, &offset) < 2) {
data/umockdev-0.15.2/src/ioctl_tree.c:79:6:  [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.
	if (sscanf(line, "%100s %i %n", ioctl_name, &ret, &offset) < 1) {
data/umockdev-0.15.2/src/ioctl_tree.c:94:16:  [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).
    t->depth = strlen(lead_ws);
data/umockdev-0.15.2/src/ioctl_tree.c:275:45:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    if (node->id == tree->id && node->type->equal(node, tree))
data/umockdev-0.15.2/src/ioctl_tree.c:489:23:  [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).
    size_t data_len = strlen(data) / 2;
data/umockdev-0.15.2/src/ioctl_tree.c:560:23:  [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).
    size_t data_len = strlen(data) / 2;
data/umockdev-0.15.2/src/ioctl_tree.h:36:11:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    int (*equal) (const ioctl_tree *, const ioctl_tree *);
data/umockdev-0.15.2/src/libumockdev-preload.c:162:16:  [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).
    path_len = strlen(path);
data/umockdev-0.15.2/src/libumockdev-preload.c:163: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).
    trap_path_prefix_len = strlen(prefix);
data/umockdev-0.15.2/src/libumockdev-preload.c:195:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buf + name_offset, nodename, sizeof(buf) - name_offset - 1);
data/umockdev-0.15.2/src/libumockdev-preload.c:505:18:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    while ((c = fgetc(ioctl_record_log)) == '#')
data/umockdev-0.15.2/src/libumockdev-preload.c:506:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while (fgetc(ioctl_record_log) != '\n')
data/umockdev-0.15.2/src/libumockdev-preload.c:998:23:  [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).
		r = _fwrite(header, strlen(header), 1, srinfo->log);
data/umockdev-0.15.2/src/libumockdev-preload.c:1086: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).
	    memmove(r, r + trap_path_prefix_len, strlen(r) - trap_path_prefix_len + 1); \
data/umockdev-0.15.2/src/libumockdev-preload.c:1124: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).
	    memmove(r, r + trap_path_prefix_len, strlen(r) - trap_path_prefix_len + 1); \
data/umockdev-0.15.2/src/libumockdev-preload.c:1162: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).
	    memmove(r, r + trap_path_prefix_len, strlen(r) - trap_path_prefix_len + 1); \
data/umockdev-0.15.2/src/libumockdev-preload.c:1388:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(link + 1, pathname, sizeof(link) - 2);					\
data/umockdev-0.15.2/src/libumockdev-preload.c:1463:1:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
read(int fd, void *buf, size_t count)
data/umockdev-0.15.2/src/libumockdev-preload.c:1465:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    libc_func(read, ssize_t, int, void *, size_t);
data/umockdev-0.15.2/src/libumockdev-preload.c:1515: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(res);
data/umockdev-0.15.2/src/libumockdev-preload.c:1596:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(trapped_addr.sun_path, p, sizeof(trapped_addr.sun_path) - 1);
data/umockdev-0.15.2/src/uevent_sender.c:72:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(event_addr.sun_path, path, sizeof(event_addr.sun_path) - 1);
data/umockdev-0.15.2/src/uevent_sender.c:157: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).
    int len = strlen(str);
data/umockdev-0.15.2/tests/chatter-socket-stream.c:35:22:  [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).
    r = write(fd, s, strlen(s));
data/umockdev-0.15.2/tests/chatter-socket-stream.c:63: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, argv[1], sizeof(addr.sun_path)-1);
data/umockdev-0.15.2/tests/chatter-socket-stream.c:70:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    len = read(fd, buf, sizeof(buf) - 1);
data/umockdev-0.15.2/tests/chatter-socket-stream.c:78:5:  [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(20000);
data/umockdev-0.15.2/tests/chatter.c:32:22:  [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).
    r = write(fd, s, strlen(s));
data/umockdev-0.15.2/tests/chatter.c:58:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    len = read(fd, buf, sizeof(buf) - 1);
data/umockdev-0.15.2/tests/chatter.c:65:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    len = read(fd, buf, sizeof(buf) - 1);
data/umockdev-0.15.2/tests/readbyte.c:25: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).
#define writestr(s) assert(write(fd, s, strlen(s)) >= 0)
data/umockdev-0.15.2/tests/readbyte.c:45:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        len = read(fd, &buf, 1);
data/umockdev-0.15.2/tests/test-ioctl-tree.c:80: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).
    g_assert_cmpint(fwrite(test_tree_str, strlen(test_tree_str), 1, f), ==, 1);
data/umockdev-0.15.2/tests/test-umockdev.c:84:5:  [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 (delay);
data/umockdev-0.15.2/tests/test-umockdev.c:91:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ret = read (fd, &buf[len], length - len);
data/umockdev-0.15.2/tests/test-umockdev.c:584:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(counter->last_device, g_udev_device_get_sysfs_path(device), sizeof(counter->last_device) - 1);
data/umockdev-0.15.2/tests/test-umockdev.c:1163:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    g_assert_cmpint(read(fd, buf, 20), ==, 20);
data/umockdev-0.15.2/tests/test-umockdev.c:1185:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    g_assert_cmpint(read(fd, buf, 20), ==, 12);
data/umockdev-0.15.2/tests/test-umockdev.c:1215:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    g_assert_cmpint(read(fd, buf, 20), ==, 12);
data/umockdev-0.15.2/tests/test-umockdev.c:1386:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, buf, 5), ==, -1);    \
data/umockdev-0.15.2/tests/test-umockdev.c:1417:37:  [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_assert_cmpint(write(fd, "r 0 ", strlen("r 0 ")), ==, strlen("r 0 "));
data/umockdev-0.15.2/tests/test-umockdev.c:1417:58:  [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_assert_cmpint(write(fd, "r 0 ", strlen("r 0 ")), ==, strlen("r 0 "));
data/umockdev-0.15.2/tests/test-umockdev.c:1449:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t tmp = read(fd, buf, sizeof buf);
data/umockdev-0.15.2/tests/test-umockdev.c:1502:42:  [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_assert_cmpint(write(fd, test_script, strlen(test_script)), >, 10);
data/umockdev-0.15.2/tests/test-umockdev.c:1541: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(100000);
data/umockdev-0.15.2/tests/test-umockdev.c:1550: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(5000);
data/umockdev-0.15.2/tests/test-umockdev.c:1552: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(5000);
data/umockdev-0.15.2/tests/test-umockdev.c:1595:42:  [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_assert_cmpint(write(fd, test_script, strlen(test_script)), >, 10);
data/umockdev-0.15.2/tests/test-umockdev.c:1609:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, buf, 2), ==, 2);
data/umockdev-0.15.2/tests/test-umockdev.c:1635:42:  [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_assert_cmpint(write(fd, test_script, strlen(test_script)), >, 10);
data/umockdev-0.15.2/tests/test-umockdev.c:1649:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, buf, 2), ==, 2);
data/umockdev-0.15.2/tests/test-umockdev.c:1673:42:  [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_assert_cmpint(write(fd, test_script, strlen(test_script)), >, 10);
data/umockdev-0.15.2/tests/test-umockdev.c:1743:42:  [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_assert_cmpint(write(fd, test_script, strlen(test_script)), >, 10);
data/umockdev-0.15.2/tests/test-umockdev.c:1808:40:  [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_assert_cmpint(write(fd, test_data, strlen(test_data)), ==, strlen(test_data));
data/umockdev-0.15.2/tests/test-umockdev.c:1808:64:  [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_assert_cmpint(write(fd, test_data, strlen(test_data)), ==, strlen(test_data));
data/umockdev-0.15.2/tests/test-umockdev.c:1824:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, &ev, sizeof(ev)), ==, sizeof(ev));
data/umockdev-0.15.2/tests/test-umockdev.c:1835:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, &ev, sizeof(ev)), ==, sizeof(ev));
data/umockdev-0.15.2/tests/test-umockdev.c:1846:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, &ev, sizeof(ev)), ==, sizeof(ev));
data/umockdev-0.15.2/tests/test-umockdev.c:1857:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, &ev, sizeof(ev)), ==, sizeof(ev));
data/umockdev-0.15.2/tests/test-umockdev.c:1890:40:  [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_assert_cmpint(write(fd, test_data, strlen(test_data)), ==, strlen(test_data));
data/umockdev-0.15.2/tests/test-umockdev.c:1890:64:  [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_assert_cmpint(write(fd, test_data, strlen(test_data)), ==, strlen(test_data));
data/umockdev-0.15.2/tests/test-umockdev.c:1904:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  g_assert_cmpint(read(fd, &ev, sizeof(ev)), ==, sizeof(ev));

ANALYSIS SUMMARY:

Hits = 176
Lines analyzed = 6319 in approximately 0.19 seconds (33361 lines/second)
Physical Source Lines of Code (SLOC) = 4630
Hits@level = [0]  82 [1]  62 [2]  80 [3]  22 [4]   6 [5]   6
Hits@level+ = [0+] 258 [1+] 176 [2+] 114 [3+]  34 [4+]  12 [5+]   6
Hits/KSLOC@level+ = [0+] 55.7235 [1+] 38.013 [2+] 24.622 [3+] 7.34341 [4+] 2.59179 [5+] 1.2959
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.