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/libkqueue-2.3.1/include/sys/event.h
Examining data/libkqueue-2.3.1/kern/kqueue.c
Examining data/libkqueue-2.3.1/kern/queue.h
Examining data/libkqueue-2.3.1/kern/test.c
Examining data/libkqueue-2.3.1/kqlite/dispatch.c
Examining data/libkqueue-2.3.1/kqlite/kqlite.c
Examining data/libkqueue-2.3.1/kqlite/lite.h
Examining data/libkqueue-2.3.1/kqlite/test-lite.c
Examining data/libkqueue-2.3.1/kqlite/utarray.h
Examining data/libkqueue-2.3.1/src/common/alloc.h
Examining data/libkqueue-2.3.1/src/common/debug.h
Examining data/libkqueue-2.3.1/src/common/filter.c
Examining data/libkqueue-2.3.1/src/common/kevent.c
Examining data/libkqueue-2.3.1/src/common/knote.c
Examining data/libkqueue-2.3.1/src/common/kqueue.c
Examining data/libkqueue-2.3.1/src/common/map.c
Examining data/libkqueue-2.3.1/src/common/private.h
Examining data/libkqueue-2.3.1/src/common/queue.h
Examining data/libkqueue-2.3.1/src/common/tree.h
Examining data/libkqueue-2.3.1/src/linux/platform.c
Examining data/libkqueue-2.3.1/src/linux/platform.h
Examining data/libkqueue-2.3.1/src/linux/proc.c
Examining data/libkqueue-2.3.1/src/linux/read.c
Examining data/libkqueue-2.3.1/src/linux/signal.c
Examining data/libkqueue-2.3.1/src/linux/timer.c
Examining data/libkqueue-2.3.1/src/linux/user.c
Examining data/libkqueue-2.3.1/src/linux/vnode.c
Examining data/libkqueue-2.3.1/src/linux/write.c
Examining data/libkqueue-2.3.1/src/posix/kevent.c
Examining data/libkqueue-2.3.1/src/posix/platform.c
Examining data/libkqueue-2.3.1/src/posix/platform.h
Examining data/libkqueue-2.3.1/src/posix/proc.c
Examining data/libkqueue-2.3.1/src/posix/signal.c
Examining data/libkqueue-2.3.1/src/posix/timer.c
Examining data/libkqueue-2.3.1/src/posix/user.c
Examining data/libkqueue-2.3.1/src/solaris/platform.c
Examining data/libkqueue-2.3.1/src/solaris/platform.h
Examining data/libkqueue-2.3.1/src/solaris/signal.c
Examining data/libkqueue-2.3.1/src/solaris/socket.c
Examining data/libkqueue-2.3.1/src/solaris/timer.c
Examining data/libkqueue-2.3.1/src/solaris/user.c
Examining data/libkqueue-2.3.1/src/windows/platform.c
Examining data/libkqueue-2.3.1/src/windows/platform.h
Examining data/libkqueue-2.3.1/src/windows/read.c
Examining data/libkqueue-2.3.1/src/windows/stdint.h
Examining data/libkqueue-2.3.1/src/windows/timer.c
Examining data/libkqueue-2.3.1/src/windows/user.c
Examining data/libkqueue-2.3.1/test/common.h
Examining data/libkqueue-2.3.1/test/kevent.c
Examining data/libkqueue-2.3.1/test/libdispatch/main.c
Examining data/libkqueue-2.3.1/test/lockstat.c
Examining data/libkqueue-2.3.1/test/main.c
Examining data/libkqueue-2.3.1/test/proc.c
Examining data/libkqueue-2.3.1/test/read.c
Examining data/libkqueue-2.3.1/test/signal.c
Examining data/libkqueue-2.3.1/test/stress/main.c
Examining data/libkqueue-2.3.1/test/test.c
Examining data/libkqueue-2.3.1/test/timer.c
Examining data/libkqueue-2.3.1/test/user.c
Examining data/libkqueue-2.3.1/test/vnode.c

FINAL RESULTS:

data/libkqueue-2.3.1/src/linux/platform.c:730:13:  [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.
    return (readlink(path, buf, bufsz));
data/libkqueue-2.3.1/kqlite/kqlite.c:60:30:  [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.
#error Unsupported operating system type
data/libkqueue-2.3.1/kqlite/kqlite.c:89:24:  [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.
#error Undefined event system
data/libkqueue-2.3.1/kqlite/kqlite.c:496:8:  [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(&buf[0], #attrib" ");
data/libkqueue-2.3.1/src/linux/platform.c:689:8:  [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(&buf[0], #attrib" ");
data/libkqueue-2.3.1/src/linux/vnode.c:27:8:  [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(buf, #attrib" ");
data/libkqueue-2.3.1/src/solaris/platform.c:38:8:  [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(&buf[0], " "#attrib);
data/libkqueue-2.3.1/src/solaris/platform.c:69:8:  [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(&buf[0], #attrib);
data/libkqueue-2.3.1/src/windows/platform.h:114:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf _snprintf
data/libkqueue-2.3.1/src/windows/platform.h:114:18:  [4] (format) _snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf _snprintf
data/libkqueue-2.3.1/test/vnode.c:36:9:  [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.
    if (system(buf) != 0)
data/libkqueue-2.3.1/test/vnode.c:46:9:  [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.
    if (system(buf) != 0)
data/libkqueue-2.3.1/src/common/kqueue.c:68:15:  [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.
    char *s = getenv("KQUEUE_DEBUG");
data/libkqueue-2.3.1/src/windows/platform.h:137:22:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
#define _cs_init(x)  InitializeCriticalSection((x))
data/libkqueue-2.3.1/src/windows/platform.h:138:22:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
#define _cs_lock(x)  EnterCriticalSection ((x))
data/libkqueue-2.3.1/test/main.c:320:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((c = getopt (argc, argv, "hn:")) != -1) {
data/libkqueue-2.3.1/test/vnode.c:248: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.
    char *tmpdir = getenv("TMPDIR");
data/libkqueue-2.3.1/kern/test.c:33: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("/dev/kqueue", O_RDWR);
data/libkqueue-2.3.1/kqlite/kqlite.c:393: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(dst, &kn->kev, sizeof(*dst));
data/libkqueue-2.3.1/kqlite/kqlite.c:489:21:  [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 __thread char buf[128];
data/libkqueue-2.3.1/kqlite/kqlite.c:506:5:  [2] (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). Risk is low because the
  source is a constant string.
    strcat(&buf[0], "}\n");
data/libkqueue-2.3.1/kqlite/utarray.h:97:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  else { memcpy(_utarray_eltptr(a,(a)->i++), p, (a)->icd.sz); };              \
data/libkqueue-2.3.1/kqlite/utarray.h:125:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  else { memcpy(_utarray_eltptr(a,j), p, (a)->icd.sz); };                     \
data/libkqueue-2.3.1/kqlite/utarray.h:144: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(_utarray_eltptr(a,j), _utarray_eltptr(w,0),                        \
data/libkqueue-2.3.1/src/common/filter.c:46: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(dst, src, sizeof(*src));
data/libkqueue-2.3.1/src/common/filter.c:159: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 *fname[EVFILT_SYSCOUNT] = {
data/libkqueue-2.3.1/src/common/kevent.c:34:21:  [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 __thread char buf[64];
data/libkqueue-2.3.1/src/common/kevent.c:44:21:  [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 __thread char buf[1024];
data/libkqueue-2.3.1/src/common/kevent.c:77:21:  [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 __thread char buf[1024];
data/libkqueue-2.3.1/src/common/kevent.c:104:21:  [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 __thread char buf[2147];
data/libkqueue-2.3.1/src/common/kevent.c:213:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(eventlist, src, sizeof(*src));
data/libkqueue-2.3.1/src/linux/platform.c:682:21:  [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 __thread char buf[128];
data/libkqueue-2.3.1/src/linux/platform.c:699:5:  [2] (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). Risk is low because the
  source is a constant string.
    strcat(&buf[0], "}\n");
data/libkqueue-2.3.1/src/linux/platform.c:724: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[1024];    //TODO: Maxpathlen, etc.
data/libkqueue-2.3.1/src/linux/proc.c:176: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(dst, &kn->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/read.c:66: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/read.c:84: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[PATH_MAX];
data/libkqueue-2.3.1/src/linux/read.c:111: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/signal.c:133: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/timer.c:68:21:  [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 __thread char buf[1024];
data/libkqueue-2.3.1/src/linux/timer.c:132: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/user.c:95: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/vnode.c:23:21:  [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 __thread char buf[1024];
data/libkqueue-2.3.1/src/linux/vnode.c:50:21:  [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 __thread char buf[1024];
data/libkqueue-2.3.1/src/linux/vnode.c:108: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[PATH_MAX];
data/libkqueue-2.3.1/src/linux/vnode.c:211: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/linux/write.c:42: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/posix/platform.c:73:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[1024];
data/libkqueue-2.3.1/src/posix/proc.c:137: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(&dst->kev, src, sizeof(*src));
data/libkqueue-2.3.1/src/posix/proc.c:161: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(dst, &kn->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/posix/timer.c:61: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[1];
data/libkqueue-2.3.1/src/posix/timer.c:261: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(dst, &kn->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/posix/user.c:53: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/solaris/platform.c:34:21:  [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 __thread char buf[512];
data/libkqueue-2.3.1/src/solaris/platform.c:60:21:  [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 __thread char buf[512];
data/libkqueue-2.3.1/src/solaris/platform.c:82:5:  [2] (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). Risk is low because the
  source is a constant string.
    strcat(&buf[0], ") }");
data/libkqueue-2.3.1/src/solaris/signal.c:70: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(&sigtbl[sig].st_kev, &kn->kev, sizeof(struct kevent));
data/libkqueue-2.3.1/src/solaris/socket.c:110: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/solaris/timer.c:37:21:  [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 __thread char buf[1024];
data/libkqueue-2.3.1/src/solaris/timer.c:92: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/solaris/user.c:24: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(dst, &src->kev, sizeof(*dst));
data/libkqueue-2.3.1/src/windows/read.c:99: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(dst, &src->kev, sizeof(*dst));          
data/libkqueue-2.3.1/src/windows/timer.c:104: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(dst, &src->kev, sizeof(struct kevent));
data/libkqueue-2.3.1/src/windows/user.c:33: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(dst, &src->kev, sizeof(struct kevent));
data/libkqueue-2.3.1/test/common.h:80: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 testfile[1024];
data/libkqueue-2.3.1/test/kevent.c:143: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[512];
data/libkqueue-2.3.1/test/main.c:69: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[1];
data/libkqueue-2.3.1/test/main.c:326:30:  [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).
                iterations = atoi(optarg);
data/libkqueue-2.3.1/test/read.c:70: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[1];
data/libkqueue-2.3.1/test/read.c:392: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("/etc/hosts", O_RDONLY);
data/libkqueue-2.3.1/test/vnode.c:25: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).
    if ((fd = open(path, O_CREAT | O_WRONLY, 0600)) < 0)
data/libkqueue-2.3.1/test/vnode.c:33:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[1024];
data/libkqueue-2.3.1/test/vnode.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[1024];
data/libkqueue-2.3.1/test/vnode.c:53:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[1024];
data/libkqueue-2.3.1/test/vnode.c:77:21:  [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).
    ctx->vnode_fd = open(ctx->testfile, O_RDWR);
data/libkqueue-2.3.1/kqlite/kqlite.c:387:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    n = read(kq->sigfd, &sig, sizeof(sig));
data/libkqueue-2.3.1/src/common/kevent.c:48:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
    strncat((char *) &buf[0], #attrib" ", 64);
data/libkqueue-2.3.1/src/common/kevent.c:67: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).
    buf[strlen(buf) - 1] = ')';
data/libkqueue-2.3.1/src/common/kevent.c:81:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat((char *) &buf[0], #attrib" ", 64);
data/libkqueue-2.3.1/src/common/kevent.c:94: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).
    buf[strlen(buf) - 1] = ')';
data/libkqueue-2.3.1/src/common/kqueue.c:69: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).
    if (s != NULL && strlen(s) > 0) {
data/libkqueue-2.3.1/src/linux/platform.c:305:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(kq->pipefd[0], &buffer, 1);
data/libkqueue-2.3.1/src/linux/platform.c:521:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    n = read(e->ef_id, &cur, sizeof(cur));
data/libkqueue-2.3.1/src/linux/proc.c:168:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(filt->kf_pfd, &cur, sizeof(cur)) < sizeof(cur)) {
data/libkqueue-2.3.1/src/linux/signal.c:53:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    n = read(sigfd, &sig, sizeof(sig));
data/libkqueue-2.3.1/src/linux/timer.c:139:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    n = read(src->data.pfd, &expired, sizeof(expired));
data/libkqueue-2.3.1/src/linux/user.c:69:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    n = read(evfd, &cur, sizeof(cur));
data/libkqueue-2.3.1/src/linux/vnode.c:42: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).
    buf[strlen(buf) - 1] = ')';
data/libkqueue-2.3.1/src/linux/vnode.c:81:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        n = read(inofd, dst, want);
data/libkqueue-2.3.1/src/posix/platform.c:77:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(e->ef_id, &buf, sizeof(buf)) < 0) {
data/libkqueue-2.3.1/src/posix/timer.c:106:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            cnt = read(sr->wfd, &buf, 1);
data/libkqueue-2.3.1/src/posix/timer.c:230:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    cnt = read(filt->kf_pfd, &si, sizeof(si));
data/libkqueue-2.3.1/src/solaris/platform.c:50:5:  [1] (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). Risk is low because the
  source is a constant character.
    strcat(&buf[0], ")");
data/libkqueue-2.3.1/test/kevent.c:78:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(buf, #attrib" ", 64);
data/libkqueue-2.3.1/test/kevent.c:102: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).
    buf[strlen(buf) - 1] = ')';
data/libkqueue-2.3.1/test/kevent.c:114:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(buf, #attrib" ", 64);
data/libkqueue-2.3.1/test/kevent.c:134: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).
    buf[strlen(buf) - 1] = ')';

ANALYSIS SUMMARY:

Hits = 97
Lines analyzed = 13394 in approximately 0.39 seconds (34400 lines/second)
Physical Source Lines of Code (SLOC) = 9342
Hits@level = [0]  60 [1]  22 [2]  58 [3]   5 [4]  11 [5]   1
Hits@level+ = [0+] 157 [1+]  97 [2+]  75 [3+]  17 [4+]  12 [5+]   1
Hits/KSLOC@level+ = [0+] 16.8058 [1+] 10.3832 [2+] 8.02826 [3+] 1.81974 [4+] 1.28452 [5+] 0.107043
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.