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/ncdu-1.15.1/deps/khashl.h
Examining data/ncdu-1.15.1/deps/yopt.h
Examining data/ncdu-1.15.1/src/browser.c
Examining data/ncdu-1.15.1/src/help.c
Examining data/ncdu-1.15.1/src/dir.h
Examining data/ncdu-1.15.1/src/quit.h
Examining data/ncdu-1.15.1/src/delete.c
Examining data/ncdu-1.15.1/src/dir_import.c
Examining data/ncdu-1.15.1/src/dir_mem.c
Examining data/ncdu-1.15.1/src/help.h
Examining data/ncdu-1.15.1/src/delete.h
Examining data/ncdu-1.15.1/src/exclude.c
Examining data/ncdu-1.15.1/src/dir_scan.c
Examining data/ncdu-1.15.1/src/dir_common.c
Examining data/ncdu-1.15.1/src/path.c
Examining data/ncdu-1.15.1/src/util.h
Examining data/ncdu-1.15.1/src/path.h
Examining data/ncdu-1.15.1/src/quit.c
Examining data/ncdu-1.15.1/src/dir_export.c
Examining data/ncdu-1.15.1/src/shell.h
Examining data/ncdu-1.15.1/src/dirlist.h
Examining data/ncdu-1.15.1/src/dirlist.c
Examining data/ncdu-1.15.1/src/browser.h
Examining data/ncdu-1.15.1/src/shell.c
Examining data/ncdu-1.15.1/src/main.c
Examining data/ncdu-1.15.1/src/exclude.h
Examining data/ncdu-1.15.1/src/global.h
Examining data/ncdu-1.15.1/src/util.c

FINAL RESULTS:

data/ncdu-1.15.1/src/path.c:154:16:  [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.
    while((n = readlink(arr[i], lnk, lnkl)) == lnkl || (n < 0 && errno == ERANGE)) {
data/ncdu-1.15.1/deps/yopt.h:120:2:  [4] (format) vsnprintf:
  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.
	vsnprintf(o->errbuf, sizeof(o->errbuf), fmt, va);
data/ncdu-1.15.1/src/dir_common.c:55:3:  [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(dir_curpath, path);
data/ncdu-1.15.1/src/dir_common.c:63:3:  [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(dir_curpath, name);
data/ncdu-1.15.1/src/dir_common.c:91:3:  [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(lasterr, path);
data/ncdu-1.15.1/src/dir_common.c:104:3:  [4] (format) vsnprintf:
  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.
  vsnprintf(dir_fatalerr, 1023, fmt, va);
data/ncdu-1.15.1/src/dir_common.c:163: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(ani, antext);
data/ncdu-1.15.1/src/dir_import.c:438:7:  [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(ctx->buf_name, ctx->val);
data/ncdu-1.15.1/src/dir_mem.c:128:3:  [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(item->name, name);
data/ncdu-1.15.1/src/dir_scan.c:171: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+off, item->d_name);
data/ncdu-1.15.1/src/exclude.c:50:3:  [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((*n)->pattern, pat);
data/ncdu-1.15.1/src/path.c:117:5:  [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(ret, path);
data/ncdu-1.15.1/src/path.c:121: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(ret, path);
data/ncdu-1.15.1/src/path.c:174:9:  [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(tmp, lnk);
data/ncdu-1.15.1/src/path.c:176:9:  [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(tmp, lnk);
data/ncdu-1.15.1/src/path.c:185:9:  [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(tmp, arr[i]);
data/ncdu-1.15.1/src/path.c:192:5:  [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(tmp, arr[i]);
data/ncdu-1.15.1/src/shell.c:62:11:  [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.
    res = system(shell);
data/ncdu-1.15.1/src/util.c:48: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(dat, from);
data/ncdu-1.15.1/src/util.c:390:5:  [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(dat, list[c]->name);
data/ncdu-1.15.1/src/shell.c:55:25:  [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 *shell = getenv("NCDU_SHELL");
data/ncdu-1.15.1/src/shell.c:57: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.
      shell = getenv("SHELL");
data/ncdu-1.15.1/deps/yopt.h:78:2:  [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 errbuf[128];
data/ncdu-1.15.1/deps/yopt.h:136:2:  [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 sh[3];
data/ncdu-1.15.1/src/browser.c:42: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 mbuf[46];
data/ncdu-1.15.1/src/browser.c:203: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 mbuf[26];
data/ncdu-1.15.1/src/dir_common.c:115: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 ani[16] = {0};
data/ncdu-1.15.1/src/dir_export.c:65: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 tmp[20];
data/ncdu-1.15.1/src/dir_export.c:182:21:  [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).
  else if((stream = fopen(fn, "w")) == NULL)
data/ncdu-1.15.1/src/dir_import.c:76: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_name[MAX_VAL];
data/ncdu-1.15.1/src/dir_import.c:77: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 val[MAX_VAL];
data/ncdu-1.15.1/src/dir_import.c:78: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 readbuf[READ_BUF_SIZE];
data/ncdu-1.15.1/src/dir_import.c:97: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(ctx->readbuf, ctx->buf, r);
data/ncdu-1.15.1/src/dir_import.c:599:21:  [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).
  else if((stream = fopen(fn, "r")) == NULL)
data/ncdu-1.15.1/src/dir_mem.c:127: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(item, dir, offsetof(struct dir, name));
data/ncdu-1.15.1/src/dir_mem.c:130: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(dir_ext_ptr(item), ext, sizeof(struct dir_ext));
data/ncdu-1.15.1/src/dir_scan.c:284:7:  [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 extra[PATH_MAX];
data/ncdu-1.15.1/src/dirlist.c:222: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(dirlist_parent->name, "..");
data/ncdu-1.15.1/src/exclude.c:56: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[256];
data/ncdu-1.15.1/src/exclude.c:59:11:  [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).
  if((f = fopen(file, "r")) == NULL)
data/ncdu-1.15.1/src/exclude.c:114: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[sizeof CACHEDIR_TAG_SIGNATURE - 1];
data/ncdu-1.15.1/src/exclude.c:130:7:  [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(path, "rb");
data/ncdu-1.15.1/src/help.c:36:14:  [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 const char *keys[KEYS*2] = {
data/ncdu-1.15.1/src/help.c:61:14:  [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 const char *flags[FLAGS*2] = {
data/ncdu-1.15.1/src/main.c:281:11:  [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).
    tty = fopen("/dev/tty", "r+");
data/ncdu-1.15.1/src/util.c:45:10:  [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 dat[4096];
data/ncdu-1.15.1/src/util.c:100:10:  [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 dat[26]; /* max: 9.223.372.036.854.775.807  (= 2^63-1) */
data/ncdu-1.15.1/src/util.c:101: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 tmp[26];
data/ncdu-1.15.1/src/util.c:126:10:  [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[11];
data/ncdu-1.15.1/src/util.c:424: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[128];\
data/ncdu-1.15.1/src/browser.c:284:38:  [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).
    mvaddchc(UIC_DEFAULT, 1, 4+((int)strlen(tmp) > wincols-8 ? wincols-8 : (int)strlen(tmp)), ' ');
data/ncdu-1.15.1/src/browser.c:284:81:  [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).
    mvaddchc(UIC_DEFAULT, 1, 4+((int)strlen(tmp) > wincols-8 ? wincols-8 : (int)strlen(tmp)), ' ');
data/ncdu-1.15.1/src/dir_common.c:54:18:  [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).
  curpath_resize(strlen(path)+1);
data/ncdu-1.15.1/src/dir_common.c:60:18:  [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).
  curpath_resize(strlen(dir_curpath)+strlen(name)+2);
data/ncdu-1.15.1/src/dir_common.c:60:38:  [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).
  curpath_resize(strlen(dir_curpath)+strlen(name)+2);
data/ncdu-1.15.1/src/dir_common.c:62: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(dir_curpath, "/");
data/ncdu-1.15.1/src/dir_common.c:71:5:  [1] (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 character.
    strcpy(dir_curpath, "/");
data/ncdu-1.15.1/src/dir_common.c:86:13:  [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 req = strlen(path)+1;
data/ncdu-1.15.1/src/dir_common.c:153: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).
    if(++anpos == strlen(antext)*2)
data/ncdu-1.15.1/src/dir_common.c:155: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).
    memset(ani, ' ', strlen(antext));
data/ncdu-1.15.1/src/dir_common.c:156: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).
    if(anpos < strlen(antext))
data/ncdu-1.15.1/src/dir_common.c:160:13:  [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=strlen(antext)-1; i>anpos-strlen(antext); i--)
data/ncdu-1.15.1/src/dir_common.c:160:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      for(i=strlen(antext)-1; i>anpos-strlen(antext); i--)
data/ncdu-1.15.1/src/dir_import.c:115: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).
    if(strlen(ctx->lastfill) != (size_t)r) {
data/ncdu-1.15.1/src/dir_scan.c:166:24:  [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 req = off+3+strlen(item->d_name);
data/ncdu-1.15.1/src/dir_scan.c:172:12:  [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).
    off += strlen(item->d_name)+1;
data/ncdu-1.15.1/src/dir_scan.c:332:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  for(cur=dir; !fail&&cur&&*cur; cur+=strlen(cur)+1) {
data/ncdu-1.15.1/src/dirlist.c:49:61:  [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).
    (d)->flags & FF_EXL || (d)->name[0] == '.' || (d)->name[strlen((d)->name)-1] == '~'\
data/ncdu-1.15.1/src/exclude.c:49:36:  [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).
  (*n)->pattern = (char *) xmalloc(strlen(pat)+1);
data/ncdu-1.15.1/src/exclude.c:63:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(buf)-1;
data/ncdu-1.15.1/src/exclude.c:119:7:  [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).
  l = strlen(name) + sizeof CACHEDIR_TAG_FILENAME + 2;
data/ncdu-1.15.1/src/help.c:94:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        ncaddstr(++line, 13-strlen(keys[i]), keys[i]);
data/ncdu-1.15.1/src/path.c:56:7:  [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).
  n = strlen(cur);
data/ncdu-1.15.1/src/path.c:113: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).
    i = strlen(path) + strlen(ret) + 2;
data/ncdu-1.15.1/src/path.c:113:24:  [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).
    i = strlen(path) + strlen(ret) + 2;
data/ncdu-1.15.1/src/path.c:116: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(ret, "/");
data/ncdu-1.15.1/src/path.c:120: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).
    ret = xmalloc(strlen(path)+1);
data/ncdu-1.15.1/src/path.c:135:10:  [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).
  tmpl = strlen(cur)+1;
data/ncdu-1.15.1/src/path.c:142:3:  [1] (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 character.
  strcpy(tmp, "/");
data/ncdu-1.15.1/src/path.c:168:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        n += strlen(tmp);
data/ncdu-1.15.1/src/path.c:179:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        n += strlen(arr[i])+1;
data/ncdu-1.15.1/src/path.c:184:9:  [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(tmp, "/");
data/ncdu-1.15.1/src/path.c:196:7:  [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(tmp, "/");
data/ncdu-1.15.1/src/util.c:46:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int i, j, o = strlen(from);
data/ncdu-1.15.1/src/util.c:154:30:  [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(locale_thou_sep && 1 == strlen(locale_thou_sep))
data/ncdu-1.15.1/src/util.c:369:10:  [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).
    i += strlen(d->name)+1;
data/ncdu-1.15.1/src/util.c:389:7:  [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(dat, "/");
data/ncdu-1.15.1/src/util.c:428:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(0, buf, sizeof(buf));\
data/ncdu-1.15.1/src/util.h:79: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).
#define dir_memsize(n)     (offsetof(struct dir, name)+1+strlen(n))

ANALYSIS SUMMARY:

Hits = 89
Lines analyzed = 5766 in approximately 0.18 seconds (32181 lines/second)
Physical Source Lines of Code (SLOC) = 3757
Hits@level = [0]  40 [1]  39 [2]  28 [3]   2 [4]  19 [5]   1
Hits@level+ = [0+] 129 [1+]  89 [2+]  50 [3+]  22 [4+]  20 [5+]   1
Hits/KSLOC@level+ = [0+] 34.3359 [1+] 23.6891 [2+] 13.3085 [3+] 5.85574 [4+] 5.3234 [5+] 0.26617
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.