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/duc-1.4.4/src/duc/cmd-cgi.c
Examining data/duc-1.4.4/src/duc/cmd-graph.c
Examining data/duc-1.4.4/src/duc/cmd-gui.c
Examining data/duc-1.4.4/src/duc/cmd-guigl.c
Examining data/duc-1.4.4/src/duc/cmd-index.c
Examining data/duc-1.4.4/src/duc/cmd-info.c
Examining data/duc-1.4.4/src/duc/cmd-ls.c
Examining data/duc-1.4.4/src/duc/cmd-ui.c
Examining data/duc-1.4.4/src/duc/cmd-xml.c
Examining data/duc-1.4.4/src/duc/cmd.h
Examining data/duc-1.4.4/src/duc/ducrc.c
Examining data/duc-1.4.4/src/duc/ducrc.h
Examining data/duc-1.4.4/src/duc/main.c
Examining data/duc-1.4.4/src/glad/KHR/khrplatform.h
Examining data/duc-1.4.4/src/glad/glad.c
Examining data/duc-1.4.4/src/glad/glad/glad.h
Examining data/duc-1.4.4/src/libduc-graph/duc-graph.h
Examining data/duc-1.4.4/src/libduc-graph/font.c
Examining data/duc-1.4.4/src/libduc-graph/graph-cairo.c
Examining data/duc-1.4.4/src/libduc-graph/graph-html.c
Examining data/duc-1.4.4/src/libduc-graph/graph-opengl.c
Examining data/duc-1.4.4/src/libduc-graph/graph-private.h
Examining data/duc-1.4.4/src/libduc-graph/graph-svg.c
Examining data/duc-1.4.4/src/libduc-graph/graph.c
Examining data/duc-1.4.4/src/libduc/buffer.c
Examining data/duc-1.4.4/src/libduc/buffer.h
Examining data/duc-1.4.4/src/libduc/canonicalize.c
Examining data/duc-1.4.4/src/libduc/db-kyoto.c
Examining data/duc-1.4.4/src/libduc/db-leveldb.c
Examining data/duc-1.4.4/src/libduc/db-lmdb.c
Examining data/duc-1.4.4/src/libduc/db-sqlite3.c
Examining data/duc-1.4.4/src/libduc/db-tokyo.c
Examining data/duc-1.4.4/src/libduc/db.c
Examining data/duc-1.4.4/src/libduc/db.h
Examining data/duc-1.4.4/src/libduc/dir.c
Examining data/duc-1.4.4/src/libduc/duc.c
Examining data/duc-1.4.4/src/libduc/duc.h
Examining data/duc-1.4.4/src/libduc/index.c
Examining data/duc-1.4.4/src/libduc/list.c
Examining data/duc-1.4.4/src/libduc/list.h
Examining data/duc-1.4.4/src/libduc/private.h
Examining data/duc-1.4.4/src/libduc/uthash.h
Examining data/duc-1.4.4/src/libduc/utlist.h
Examining data/duc-1.4.4/src/libduc/utstring.h
Examining data/duc-1.4.4/src/libduc/varint.c
Examining data/duc-1.4.4/src/libduc/varint.h

FINAL RESULTS:

data/duc-1.4.4/src/duc/cmd-index.c:62:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, va);
data/duc-1.4.4/src/duc/cmd-ls.c:144: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(parent_path, e->name);
data/duc-1.4.4/src/duc/cmd-ui.c:277:8:  [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.
					  system(cmd);
data/duc-1.4.4/src/duc/cmd-ui.c:386:12:  [4] (shell) popen:
  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.
	FILE *f = popen("clear; less -", "w");
data/duc-1.4.4/src/duc/main.c:417:2:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	printf(DB_BACKEND "\n");
data/duc-1.4.4/src/libduc/duc.c:20:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, va);
data/duc-1.4.4/src/libduc/duc.c:72:4:  [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.
			snprintf(tmp, sizeof tmp, "%s/" FNAME_DUC_DB, home);
data/duc-1.4.4/src/libduc/index.c:276: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(msg, sizeof(msg), fmt, va);
data/duc-1.4.4/src/libduc/uthash.h:260:29:  [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 HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
data/duc-1.4.4/src/libduc/utstring.h:128:11:  [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.
      n = vsnprintf (&s->d[s->i], s->n-s->i, fmt, cp);
data/duc-1.4.4/src/libduc/utstring.h:144:28:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  __attribute__ (( format( printf, 2, 3) ));
data/duc-1.4.4/src/duc/cmd-cgi.c:124:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	char *qs = getenv("QUERY_STRING");
data/duc-1.4.4/src/duc/cmd-cgi.c:299:17:  [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 *script = getenv("SCRIPT_NAME");
data/duc-1.4.4/src/duc/cmd-cgi.c:482:5:  [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("GATEWAY_INTERFACE") == NULL) {
data/duc-1.4.4/src/duc/ducrc.c:246:15:  [3] (buffer) getopt_long:
  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_long(*argc, *argv, optstr, longopts, &idx)) != -1) {
data/duc-1.4.4/src/duc/main.c:107: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("GATEWAY_INTERFACE")) {
data/duc-1.4.4/src/duc/main.c:133: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 *home = getenv("HOME");
data/duc-1.4.4/src/libduc/duc.c:62:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		path_db = getenv("DUC_DATABASE");
data/duc-1.4.4/src/libduc/duc.c:69: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.
		char *home = getenv("HOME");
data/duc-1.4.4/src/libduc/duc.c:70:27:  [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(home == NULL) home = getenv("APPDATA");
data/duc-1.4.4/src/libduc/index.c:273:2:  [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.
	realpath(name, path_full);
data/duc-1.4.4/src/libduc/index.c:299:2:  [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.
	realpath(name, path_full);
data/duc-1.4.4/src/duc/cmd-cgi.c:255:12:  [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 *f = fopen(fname, "rb");
data/duc-1.4.4/src/duc/cmd-cgi.c:259:4:  [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[4096];
data/duc-1.4.4/src/duc/cmd-cgi.c:302: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 url[DUC_PATH_MAX];
data/duc-1.4.4/src/duc/cmd-cgi.c:313:11:  [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).
		int x = atoi(xs);
data/duc-1.4.4/src/duc/cmd-cgi.c:314:11:  [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).
		int y = atoi(ys);
data/duc-1.4.4/src/duc/cmd-cgi.c:346: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 ts_date[32];
data/duc-1.4.4/src/duc/cmd-cgi.c:347: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 ts_time[32];
data/duc-1.4.4/src/duc/cmd-cgi.c:355: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 siz[32];
data/duc-1.4.4/src/duc/cmd-cgi.c:399:4:  [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 siz[32];
data/duc-1.4.4/src/duc/cmd-cgi.c:451:11:  [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).
		int x = atoi(xs);
data/duc-1.4.4/src/duc/cmd-cgi.c:452:11:  [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).
		int y = atoi(ys);
data/duc-1.4.4/src/duc/cmd-cgi.c:459:4:  [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 siz_app[32], siz_act[32], siz_cnt[32];
data/duc-1.4.4/src/duc/cmd-graph.c:90: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_out, "w");
data/duc-1.4.4/src/duc/cmd-index.c:50: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 siz[32], fs[32], ds[32];
data/duc-1.4.4/src/duc/cmd-index.c:108: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 siz_apparent[32], siz_actual[32];
data/duc-1.4.4/src/duc/cmd-index.c:113:4:  [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 dur[64];
data/duc-1.4.4/src/duc/cmd-info.c:36: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 ts[32];
data/duc-1.4.4/src/duc/cmd-info.c:41: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 siz[32], fs[32], ds[32];
data/duc-1.4.4/src/duc/cmd-ls.c:68:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char parent_path[DUC_PATH_MAX] = "";
data/duc-1.4.4/src/duc/cmd-ls.c:128: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 siz[32];
data/duc-1.4.4/src/duc/cmd-ls.c:202: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 siz[32];
data/duc-1.4.4/src/duc/cmd-ui.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 siz[32], fcnt[32], dcnt[32];
data/duc-1.4.4/src/duc/cmd-ui.c:168: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 siz[32];
data/duc-1.4.4/src/duc/cmd-ui.c:270:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
					  char cmd[DUC_PATH_MAX] = "true";
data/duc-1.4.4/src/duc/ducrc.c:112:13:  [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).
			*v_int = atoi(val);
data/duc-1.4.4/src/duc/ducrc.c:137:12:  [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 *f = fopen(path, "r");
data/duc-1.4.4/src/duc/ducrc.c:143: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 section[256] = "";
data/duc-1.4.4/src/duc/ducrc.c:144: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 buf[256];
data/duc-1.4.4/src/duc/ducrc.c:210: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 optstr[MAX_OPTIONS*2] = "";
data/duc-1.4.4/src/duc/ducrc.c:224:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
			l += sprintf(optstr+l, "%c", o->shortopt);
data/duc-1.4.4/src/duc/main.c:135: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[DUC_PATH_MAX];
data/duc-1.4.4/src/duc/main.c:245: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 s[4] = "";
data/duc-1.4.4/src/duc/main.c:246: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 l[20] = "";
data/duc-1.4.4/src/libduc-graph/font.c:2568:26:  [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.
                unsigned char data[STB_FONT_arial_40_latin_ext_BITMAP_HEIGHT][STB_FONT_arial_40_latin_ext_BITMAP_WIDTH],
data/duc-1.4.4/src/libduc-graph/graph-cairo.c:89: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 font[32];
data/duc-1.4.4/src/libduc-graph/graph-cairo.c:131: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 font[32];
data/duc-1.4.4/src/libduc-graph/graph-opengl.c:389: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.
	unsigned char fontpixels[STB_SOMEFONT_BITMAP_HEIGHT][STB_SOMEFONT_BITMAP_WIDTH];
data/duc-1.4.4/src/libduc-graph/graph-private.h:41: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 tooltip_msg[DUC_PATH_MAX+256];
data/duc-1.4.4/src/libduc-graph/graph.c:203: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 siz_app[32], siz_act[32], siz_cnt[32];
data/duc-1.4.4/src/libduc-graph/graph.c:383: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 siz[16];
data/duc-1.4.4/src/libduc-graph/graph.c:453: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 siz[16];
data/duc-1.4.4/src/libduc/buffer.c:57: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(b->data + b->ptr, data, len);
data/duc-1.4.4/src/libduc/buffer.c:67: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(data, b->data + b->ptr, len);
data/duc-1.4.4/src/libduc/canonicalize.c:150: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 cwd[DUC_PATH_MAX] = "";
data/duc-1.4.4/src/libduc/db-kyoto.c:48: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 fname[DUC_PATH_MAX];
data/duc-1.4.4/src/libduc/db-leveldb.c:72: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(t+t_len, val, t_len + val_len);
data/duc-1.4.4/src/libduc/db-lmdb.c:115: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(data, d.mv_data, d.mv_size);
data/duc-1.4.4/src/libduc/db-sqlite3.c:94: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(val, sqlite3_column_blob(pStmt, 0), *val_len);
data/duc-1.4.4/src/libduc/db.c:31:4:  [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(tmp + tmpl, report->path, sizeof(report->path));
data/duc-1.4.4/src/libduc/dir.c:36: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 key[32];
data/duc-1.4.4/src/libduc/dir.c:204: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 rest[DUC_PATH_MAX];
data/duc-1.4.4/src/libduc/duc.c:58: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 tmp[DUC_PATH_MAX];
data/duc-1.4.4/src/libduc/duc.h:98: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 path[DUC_PATH_MAX];        /* Indexed path */
data/duc-1.4.4/src/libduc/index.c:271: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 path_full[DUC_PATH_MAX];
data/duc-1.4.4/src/libduc/index.c:272: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 msg[DUC_PATH_MAX + 128];
data/duc-1.4.4/src/libduc/index.c:298: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 path_full[DUC_PATH_MAX];
data/duc-1.4.4/src/libduc/index.c:546: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 key[32];
data/duc-1.4.4/src/libduc/index.c:564:6:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	f = fopen("/proc/mounts", "r");
data/duc-1.4.4/src/libduc/index.c:567: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("/etc/mtab", "r");
data/duc-1.4.4/src/libduc/index.c:574: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 buf[DUC_PATH_MAX];
data/duc-1.4.4/src/libduc/utstring.h:102: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.
  if (l) memcpy(&(s)->d[(s)->i], b, l);                    \
data/duc-1.4.4/src/libduc/utstring.h:110:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  if ((src)->i) memcpy(&(dst)->d[(dst)->i], (src)->d, (src)->i); \
data/duc-1.4.4/src/duc/cmd-cgi.c:134:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if(!pn) pn = pe + strlen(pe);
data/duc-1.4.4/src/duc/cmd-cgi.c:146:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(param->key, key, keylen);
data/duc-1.4.4/src/duc/cmd-cgi.c:152:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(param->val, val, vallen);
data/duc-1.4.4/src/duc/cmd-ls.c:92: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).
		size_t l = strlen(e->name);
data/duc-1.4.4/src/duc/cmd-ls.c:142: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).
			parent_path_len += strlen(e->name) + 1;
data/duc-1.4.4/src/duc/cmd-ls.c:145: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(parent_path, "/");
data/duc-1.4.4/src/duc/cmd-ls.c:184: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).
			parent_path_len -= strlen(e->name) + 1;
data/duc-1.4.4/src/duc/ducrc.c:64: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).
	e = s + strlen(s) - 1;
data/duc-1.4.4/src/duc/ducrc.c:163:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(section, l+1, sizeof(section));
data/duc-1.4.4/src/duc/ducrc.c:168:6:  [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(section) == 0 || 
data/duc-1.4.4/src/duc/ducrc.c:187: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).
			if(strlen(longopt) > 0) {
data/duc-1.4.4/src/duc/ducrc.c:232:25:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
			if(o->shortopt) l += sprintf(optstr+l, ":");
data/duc-1.4.4/src/duc/main.c:260:31:  [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).
			printi(o->descr_long, 29 + strlen(o->descr_short), 29, width-2);
data/duc-1.4.4/src/glad/glad.c:322:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        const size_t length = strlen(prefixes[i]);
data/duc-1.4.4/src/libduc-graph/graph.c:147: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).
	size_t n = strlen(label);
data/duc-1.4.4/src/libduc/buffer.c:105: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).
	size_t len = strlen(s);
data/duc-1.4.4/src/libduc/canonicalize.c:156: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 in_len = strlen(in);
data/duc-1.4.4/src/libduc/db-kyoto.c:67:52:  [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).
		db_put(db, "duc_db_version", 14, DUC_DB_VERSION, strlen(DUC_DB_VERSION));
data/duc-1.4.4/src/libduc/db-tokyo.c:81:52:  [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).
		db_put(db, "duc_db_version", 14, DUC_DB_VERSION, strlen(DUC_DB_VERSION));
data/duc-1.4.4/src/libduc/db.c:25:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	char *tmp = db_get(duc->db, report->path, strlen(report->path), &tmpl);
data/duc-1.4.4/src/libduc/db.c:43:32:  [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).
	db_put(duc->db, report->path, strlen(report->path), b->data, b->len);
data/duc-1.4.4/src/libduc/db.c:55: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).
	char *val = db_get(duc->db, path, strlen(path), &vall);
data/duc-1.4.4/src/libduc/dir.c:172: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).
	int l = strlen(path_try);
data/duc-1.4.4/src/libduc/dir.c:205:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(rest, path_canon+l, sizeof rest);
data/duc-1.4.4/src/libduc/index.c:149: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).
		HASH_ADD_KEYPTR(hh, list, fstype->type, strlen(fstype->type), fstype);
data/duc-1.4.4/src/libduc/index.c:585:60:  [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).
			HASH_ADD_KEYPTR(hh, req->fstypes_mounted, fstype->path, strlen(fstype->path), fstype);
data/duc-1.4.4/src/libduc/uthash.h:242:31:  [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).
    HASH_FIND(hh,head,findstr,strlen(findstr),out)
data/duc-1.4.4/src/libduc/uthash.h:244:31:  [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).
    HASH_ADD(hh,head,strfield,strlen(add->strfield),add)

ANALYSIS SUMMARY:

Hits = 112
Lines analyzed = 14302 in approximately 0.47 seconds (30508 lines/second)
Physical Source Lines of Code (SLOC) = 11398
Hits@level = [0] 277 [1]  28 [2]  62 [3]  11 [4]  11 [5]   0
Hits@level+ = [0+] 389 [1+] 112 [2+]  84 [3+]  22 [4+]  11 [5+]   0
Hits/KSLOC@level+ = [0+] 34.1288 [1+] 9.82629 [2+] 7.36971 [3+] 1.93016 [4+] 0.965082 [5+]   0
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.