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/lua-luv-1.36.0-0/deps/lua_one.c
Examining data/lua-luv-1.36.0-0/src/async.c
Examining data/lua-luv-1.36.0-0/src/check.c
Examining data/lua-luv-1.36.0-0/src/constants.c
Examining data/lua-luv-1.36.0-0/src/dns.c
Examining data/lua-luv-1.36.0-0/src/fs.c
Examining data/lua-luv-1.36.0-0/src/fs_event.c
Examining data/lua-luv-1.36.0-0/src/fs_poll.c
Examining data/lua-luv-1.36.0-0/src/handle.c
Examining data/lua-luv-1.36.0-0/src/idle.c
Examining data/lua-luv-1.36.0-0/src/lhandle.c
Examining data/lua-luv-1.36.0-0/src/lhandle.h
Examining data/lua-luv-1.36.0-0/src/loop.c
Examining data/lua-luv-1.36.0-0/src/lreq.c
Examining data/lua-luv-1.36.0-0/src/lreq.h
Examining data/lua-luv-1.36.0-0/src/lthreadpool.h
Examining data/lua-luv-1.36.0-0/src/luv.c
Examining data/lua-luv-1.36.0-0/src/luv.h
Examining data/lua-luv-1.36.0-0/src/misc.c
Examining data/lua-luv-1.36.0-0/src/pipe.c
Examining data/lua-luv-1.36.0-0/src/poll.c
Examining data/lua-luv-1.36.0-0/src/prepare.c
Examining data/lua-luv-1.36.0-0/src/private.h
Examining data/lua-luv-1.36.0-0/src/process.c
Examining data/lua-luv-1.36.0-0/src/req.c
Examining data/lua-luv-1.36.0-0/src/schema.c
Examining data/lua-luv-1.36.0-0/src/signal.c
Examining data/lua-luv-1.36.0-0/src/stream.c
Examining data/lua-luv-1.36.0-0/src/tcp.c
Examining data/lua-luv-1.36.0-0/src/thread.c
Examining data/lua-luv-1.36.0-0/src/timer.c
Examining data/lua-luv-1.36.0-0/src/tty.c
Examining data/lua-luv-1.36.0-0/src/udp.c
Examining data/lua-luv-1.36.0-0/src/util.c
Examining data/lua-luv-1.36.0-0/src/util.h
Examining data/lua-luv-1.36.0-0/src/work.c

FINAL RESULTS:

data/lua-luv-1.36.0-0/src/fs.c:649:11:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
  FS_CALL(chmod, req, path, mode);
data/lua-luv-1.36.0-0/src/fs.c:734:11:  [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.
  FS_CALL(readlink, req, path);
data/lua-luv-1.36.0-0/src/fs.c:756:11:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
  FS_CALL(chown, req, path, uid, gid);
data/lua-luv-1.36.0-0/src/fs.c:639:11:  [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.
  FS_CALL(access, req, path, amode);
data/lua-luv-1.36.0-0/src/fs.c:744:11:  [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.
  FS_CALL(realpath, req, path);
data/lua-luv-1.36.0-0/src/dns.c:26: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 ip[INET6_ADDRSTRLEN];
data/lua-luv-1.36.0-0/src/fs.c:446:11:  [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).
  FS_CALL(open, req, path, flags, mode);
data/lua-luv-1.36.0-0/src/fs.c:518:11:  [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).
  FS_CALL(mkstemp, req, tpl);
data/lua-luv-1.36.0-0/src/fs_event.c:90: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[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/fs_poll.c:83: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[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/misc.c:131: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 title[MAX_TITLE_LENGTH];
data/lua-luv-1.36.0-0/src/misc.c:259: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 ip[INET6_ADDRSTRLEN];
data/lua-luv-1.36.0-0/src/misc.c:260: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 netmask[INET6_ADDRSTRLEN];
data/lua-luv-1.36.0-0/src/misc.c:316: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 exe_path[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/misc.c:325: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 path[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/misc.c:340: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 tmpdir[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/misc.c:349: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 homedir[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/misc.c:498: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 hostname[UV_MAXHOSTNAMESIZE];
data/lua-luv-1.36.0-0/src/misc.c:500: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 hostname[PATH_MAX];
data/lua-luv-1.36.0-0/src/misc.c:517: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 scoped_addr[128];
data/lua-luv-1.36.0-0/src/misc.c:532: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 interface_id[UV_IF_NAMESIZE];
data/lua-luv-1.36.0-0/src/pipe.c:68: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[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/pipe.c:79: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[2*PATH_MAX];
data/lua-luv-1.36.0-0/src/tcp.c:122: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 ip[INET6_ADDRSTRLEN];
data/lua-luv-1.36.0-0/src/thread.c:88: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((void*)arg->val.str.base, p, arg->val.str.len);
data/lua-luv-1.36.0-0/src/thread.c:189: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(p, arg->val.udata.data, arg->val.udata.size);
data/lua-luv-1.36.0-0/src/thread.c:320: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(thread->code, buff, len);
data/lua-luv-1.36.0-0/src/thread.c:346: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(&thread->handle, &t, sizeof(t));
data/lua-luv-1.36.0-0/src/work.c:158: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(ctx->code, buff, len);
data/lua-luv-1.36.0-0/src/fs.c:173:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  for (i = 0; i < strlen(string); ++i) {
data/lua-luv-1.36.0-0/src/fs.c:465:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  FS_CALL(read, req, file, &buf, 1, offset);
data/lua-luv-1.36.0-0/src/misc.c:288:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
      strncpy(ip, "<unknown sa family>", INET6_ADDRSTRLEN);
data/lua-luv-1.36.0-0/src/misc.c:289:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
      strncpy(netmask, "<unknown sa family>", INET6_ADDRSTRLEN);
data/lua-luv-1.36.0-0/src/misc.c:661: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(msec * 1000);

ANALYSIS SUMMARY:

Hits = 34
Lines analyzed = 7173 in approximately 0.24 seconds (30317 lines/second)
Physical Source Lines of Code (SLOC) = 5683
Hits@level = [0]  13 [1]   5 [2]  24 [3]   1 [4]   1 [5]   3
Hits@level+ = [0+]  47 [1+]  34 [2+]  29 [3+]   5 [4+]   4 [5+]   3
Hits/KSLOC@level+ = [0+] 8.27028 [1+] 5.98276 [2+] 5.10294 [3+] 0.879817 [4+] 0.703854 [5+] 0.52789
Dot directories skipped = 2 (--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.