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/pgtop-4.0.0/boolean.h
Examining data/pgtop-4.0.0/c.h
Examining data/pgtop-4.0.0/color.c
Examining data/pgtop-4.0.0/color.h
Examining data/pgtop-4.0.0/commands.c
Examining data/pgtop-4.0.0/commands.h
Examining data/pgtop-4.0.0/display.c
Examining data/pgtop-4.0.0/display.h
Examining data/pgtop-4.0.0/getopt.c
Examining data/pgtop-4.0.0/help.h
Examining data/pgtop-4.0.0/layout.h
Examining data/pgtop-4.0.0/loadavg.h
Examining data/pgtop-4.0.0/machine.h
Examining data/pgtop-4.0.0/machine/m_aix43.c
Examining data/pgtop-4.0.0/machine/m_aix5.c
Examining data/pgtop-4.0.0/machine/m_common.c
Examining data/pgtop-4.0.0/machine/m_freebsd.c
Examining data/pgtop-4.0.0/machine/m_linux.c
Examining data/pgtop-4.0.0/machine/m_macosx.c
Examining data/pgtop-4.0.0/machine/m_netbsd.c
Examining data/pgtop-4.0.0/machine/m_openbsd.c
Examining data/pgtop-4.0.0/machine/m_remote.c
Examining data/pgtop-4.0.0/machine/m_sco5.c
Examining data/pgtop-4.0.0/machine/m_sunos5.c
Parsing failed to find end of parameter list; semicolon terminated it in (fmt, sizeof(fmt),
#else
	sprintf(fmt,
#endif
			Proc_format,
			(int) pp->pr_pid,
			(*get_userid) (pp->pr_uid),
			(u_short) pp->pr_fill < 999 ? (u_short) pp->pr_fill : 999,
			pp->pr_pri,
			pp->pr
Examining data/pgtop-4.0.0/machine/m_svr4.c
Examining data/pgtop-4.0.0/machine/m_svr5.c
Examining data/pgtop-4.0.0/message.h
Examining data/pgtop-4.0.0/os.h
Examining data/pgtop-4.0.0/pg.c
Examining data/pgtop-4.0.0/pg.h
Examining data/pgtop-4.0.0/pg_top.c
Examining data/pgtop-4.0.0/pg_top.h
Examining data/pgtop-4.0.0/port.h
Examining data/pgtop-4.0.0/remote.h
Examining data/pgtop-4.0.0/screen.c
Examining data/pgtop-4.0.0/screen.h
Examining data/pgtop-4.0.0/sprompt.c
Examining data/pgtop-4.0.0/utils.c
Examining data/pgtop-4.0.0/utils.h
Examining data/pgtop-4.0.0/version.c
Examining data/pgtop-4.0.0/version.h

FINAL RESULTS:

data/pgtop-4.0.0/machine/m_macosx.c:407:3:  [5] (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. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
		strncat(comm, ">", COMSIZ - 1);
data/pgtop-4.0.0/machine/m_netbsd.c:543:10:  [5] (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. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
		(void) strncat(comm, &pretty[1], COMSIZ - 1);
data/pgtop-4.0.0/commands.c:470: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).
	(void) strcat(str, msg);
data/pgtop-4.0.0/commands.c:498: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).
	(void) strcat(str, arg);
data/pgtop-4.0.0/commands.c:525:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(fullhelp, help_text, p);
data/pgtop-4.0.0/commands.c:656:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(sql, "EXPLAIN (ANALYZE, VERBOSE, BUFFERS)\n%s",
data/pgtop-4.0.0/commands.c:661:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(sql, "EXPLAIN\n%s", PQgetvalue(pgresult_query, i, 0));
data/pgtop-4.0.0/commands.c:742:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(line, header_format, "", "database", "schema", "table", "index",
data/pgtop-4.0.0/commands.c:762:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(line, line_format, i + 1, PQgetvalue(pgresult, i, 0),
data/pgtop-4.0.0/display.c:207:9:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
				p = strecpy(p, color_set(0));
data/pgtop-4.0.0/display.c:227:9:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
				p = strecpy(p, color_set(color));
data/pgtop-4.0.0/display.c:410: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(scratchbuf, MAX_COLS, fmt, argp);
data/pgtop-4.0.0/display.c:750:6:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
	p = strecpy(scratchbuf, "cpu.");
data/pgtop-4.0.0/display.c:753: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(p, cpustate_names[i]);
data/pgtop-4.0.0/display.c:760:6:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
	p = strecpy(scratchbuf, "memory.");
data/pgtop-4.0.0/display.c:763: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(p, homogenize(memory_names[i] + 1));
data/pgtop-4.0.0/display.c:770:6:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
	p = strecpy(scratchbuf, "swap.");
data/pgtop-4.0.0/display.c:773: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(p, homogenize(swap_names[i] + 1));
data/pgtop-4.0.0/display.c:1344:9:  [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.
	(void) vsnprintf(next_msg, sizeof(next_msg), msgfmt, ap);
data/pgtop-4.0.0/machine/m_aix43.c:400:29:  [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 (pp->pi_state && (sel->system || ((pp->pi_flags & SKPROC) == 0)))
data/pgtop-4.0.0/machine/m_aix43.c:479:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fmt, Proc_format,
data/pgtop-4.0.0/machine/m_aix5.c:508:29:  [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 (pp->pi_state && (sel->system || ((pp->pi_flags & SKPROC) == 0)))
data/pgtop-4.0.0/machine/m_aix5.c:584:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fmt, Proc_format,
data/pgtop-4.0.0/machine/m_freebsd.c:399:2:  [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(Header, sizeof(Header), header, namelength, namelength,
data/pgtop-4.0.0/machine/m_freebsd.c:784:7:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
		p = strecpy(cmd + 1, PP(pp, comm));
data/pgtop-4.0.0/machine/m_macosx.c:195: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, args);
data/pgtop-4.0.0/machine/m_macosx.c:450:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fmt,
data/pgtop-4.0.0/machine/m_netbsd.c:453:21:  [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.
	show_system = sel->system;
data/pgtop-4.0.0/machine/m_netbsd.c:582:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fmt,
data/pgtop-4.0.0/machine/m_openbsd.c:579:2:  [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(fmt, sizeof fmt, Proc_format,
data/pgtop-4.0.0/machine/m_remote.c:293:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(sql, QUERY_PG_PROC, procname);
data/pgtop-4.0.0/machine/m_sco5.c:457:27:  [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.
	int			show_system = sel->system;
data/pgtop-4.0.0/machine/m_sco5.c:554:4:  [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(command, strtok(u.u_psargs, " "));
data/pgtop-4.0.0/machine/m_sco5.c:557: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(command, s1);
data/pgtop-4.0.0/machine/m_sco5.c:561:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(command, "%s", u.u_psargs);
data/pgtop-4.0.0/machine/m_sco5.c:586:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fmt,
data/pgtop-4.0.0/machine/m_sunos5.c:1282:2:  [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(fmt, sizeof(fmt),
data/pgtop-4.0.0/machine/m_sunos5.c:1284:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fmt,
data/pgtop-4.0.0/machine/m_sunos5.c:1558:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s/psinfo", direntp->d_name);
data/pgtop-4.0.0/machine/m_svr4.c:362:21:  [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.
	show_system = sel->system;
data/pgtop-4.0.0/machine/m_svr4.c:429:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	(void) sprintf(fmt,
data/pgtop-4.0.0/machine/m_svr5.c:373:21:  [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.
	show_system = sel->system;
data/pgtop-4.0.0/machine/m_svr5.c:487:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	(void) sprintf(fmt,
data/pgtop-4.0.0/machine/m_svr5.c:928:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s/psinfo", direntp->d_name);
data/pgtop-4.0.0/pg.c:152:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(sql, GET_LOCKS, procpid);
data/pgtop-4.0.0/pg.c:157:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(sql, GET_LOCKS_9_1, procpid);
data/pgtop-4.0.0/pg.c:208:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(sql, CURRENT_QUERY, procpid);
data/pgtop-4.0.0/pg.c:213:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(sql, CURRENT_QUERY_9_1, procpid);
data/pgtop-4.0.0/utils.c:194:1:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
strecpy(char *to, char *from)
data/pgtop-4.0.0/utils.c:279:11:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
			resp = strecpy(resp, p);
data/pgtop-4.0.0/utils.c:282:12:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
				resp = strecpy(resp, ", ");
data/pgtop-4.0.0/utils.c:661:3:  [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(debugfile, fmt, argp);
data/pgtop-4.0.0/utils.h:22:10:  [4] (buffer) strecpy:
  This function does not protect against buffer overflows (CWE-120). Ensure
  the destination has 4 times the size of the source, to leave room for
  expansion.
char	   *strecpy(char *, char *);
data/pgtop-4.0.0/getopt.c:44:1:  [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.
getopt(int argc, char **argv, char *opts)
data/pgtop-4.0.0/machine/m_sunos5.c:417:11:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if ((p = getenv("TERMINFO")) == NULL || *p == '\0')
data/pgtop-4.0.0/os.h:45:10:  [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	   *getenv();
data/pgtop-4.0.0/pg_top.c:362:14:  [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 ((i = getopt_long(ac, av, "CDITbcinRrVh:s:d:U:o:Wp:Xx:z:",
data/pgtop-4.0.0/pg_top.c:733: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.
	if ((env_top = getenv("PG_TOP")) != NULL)
data/pgtop-4.0.0/pg_top.c:797:12:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	env_top = getenv("PG_TOPCOLOURS");
data/pgtop-4.0.0/pg_top.c:800: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.
		env_top = getenv("PG_TOPCOLORS");
data/pgtop-4.0.0/screen.c:151:11:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	char	   *getenv();
data/pgtop-4.0.0/screen.c:169:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	term_name = getenv("TERM");
data/pgtop-4.0.0/color.c:120:15:  [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).
				ce->min = atoi(++min);
data/pgtop-4.0.0/color.c:121:15:  [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).
				ce->max = atoi(++max);
data/pgtop-4.0.0/color.c:239:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char v[32];
data/pgtop-4.0.0/commands.c:152: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		tempbuf1[50];
data/pgtop-4.0.0/commands.c:167: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		tempbuf[50];
data/pgtop-4.0.0/commands.c:185: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		tempbuf[50];
data/pgtop-4.0.0/commands.c:205: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		tempbuf1[50];
data/pgtop-4.0.0/commands.c:220: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		tempbuf1[50];
data/pgtop-4.0.0/commands.c:265: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		tempbuf1[50];
data/pgtop-4.0.0/commands.c:280: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		tempbuf[50];
data/pgtop-4.0.0/commands.c:333: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		tempbuf[50];
data/pgtop-4.0.0/commands.c:469:9:  [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.
	(void) strcat(str, ": ");
data/pgtop-4.0.0/commands.c:496:10:  [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.
		(void) strcat(str, ", ");
data/pgtop-4.0.0/commands.c:592: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		info[64];
data/pgtop-4.0.0/commands.c:595:2:  [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.
	sprintf(info, "Current query for procpid %d:\n\n", procpid);
data/pgtop-4.0.0/commands.c:627: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		sql[4096];
data/pgtop-4.0.0/commands.c:628: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		info[1024];
data/pgtop-4.0.0/commands.c:632:2:  [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.
	sprintf(info,
data/pgtop-4.0.0/commands.c:692: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		info[64];
data/pgtop-4.0.0/commands.c:695: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		header_format[1024];
data/pgtop-4.0.0/commands.c:696: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		line_format[1024];
data/pgtop-4.0.0/commands.c:697: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		prefix[21];		/* Should hold any 64 bit integer. */
data/pgtop-4.0.0/commands.c:698: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		line[1024];
data/pgtop-4.0.0/commands.c:700:2:  [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.
	sprintf(info, "Locks held by procpid %d:\n\n", procpid);
data/pgtop-4.0.0/commands.c:715:2:  [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.
	sprintf(prefix, "%d", rows);
data/pgtop-4.0.0/commands.c:732:2:  [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.
	sprintf(header_format,
data/pgtop-4.0.0/commands.c:736:2:  [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.
	sprintf(line_format,
data/pgtop-4.0.0/display.c:87: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 scratchbuf[MAX_COLS];
data/pgtop-4.0.0/display.c:181: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		buff[128];
data/pgtop-4.0.0/display.c:846: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 minibar_buffer[64];
data/pgtop-4.0.0/display.c:940: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(lprocstates, brkdn, num_procstates * sizeof(int));
data/pgtop-4.0.0/display.c:968: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(lprocstates, brkdn, num_procstates * sizeof(int));
data/pgtop-4.0.0/display.c:1053: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(lcpustates, states, num_cpustates * sizeof(int));
data/pgtop-4.0.0/display.c:1212: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 next_msg[MAX_COLS + 8];
data/pgtop-4.0.0/display.c:1489:36:  [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).
	return (cnt == 0 ? -1 : numeric ? atoi(buffer) : cnt);
data/pgtop-4.0.0/getopt.c:31: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[2];\
data/pgtop-4.0.0/machine.h:109: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		usename[NAMEDATALEN + 1];	/* only this postgres usename */
data/pgtop-4.0.0/machine/m_aix43.c:219:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((kmem = open(KMEM, O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_aix43.c:374:2:  [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(p_info[0].pi_comm, "swapper");
data/pgtop-4.0.0/machine/m_aix43.c:421: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.
		qsort((char *) pref, active_procs, sizeof(struct procsinfo *),
data/pgtop-4.0.0/machine/m_aix43.c:434:1:  [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		fmt[MAX_COLS];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_aix5.c:239:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((kmem = open(KMEM, O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_aix5.c:444:2:  [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(p_info[0].pi_comm, "swapper");
data/pgtop-4.0.0/machine/m_aix5.c:529: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.
		qsort((char *) pref, active_procs, sizeof(struct procentry64 *),
data/pgtop-4.0.0/machine/m_aix5.c:542:1:  [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		fmt[128];			/* static area where result is built */
data/pgtop-4.0.0/machine/m_freebsd.c:397:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char Header[128];
data/pgtop-4.0.0/machine/m_freebsd.c:595:9:  [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).
							 atoi(PQgetvalue(pgresult, i, 0)), &junk);
data/pgtop-4.0.0/machine/m_freebsd.c:605: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(&pbase[i], &junk2[0], sizeof(struct kinfo_proc));
data/pgtop-4.0.0/machine/m_freebsd.c:638:12:  [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).
		n->pid = atoi(PQgetvalue(pgresult, i, 0));
data/pgtop-4.0.0/machine/m_freebsd.c:644: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(RU(n), RU(&junk2[0]), sizeof(struct rusage));
data/pgtop-4.0.0/machine/m_freebsd.c:661:18:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->sent_lag = atol(PQgetvalue(pgresult, i, REP_SENT_LAG));
data/pgtop-4.0.0/machine/m_freebsd.c:662:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->write_lag = atol(PQgetvalue(pgresult, i, REP_WRITE_LAG));
data/pgtop-4.0.0/machine/m_freebsd.c:663:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->flush_lag = atol(PQgetvalue(pgresult, i, REP_FLUSH_LAG));
data/pgtop-4.0.0/machine/m_freebsd.c:664:20:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->replay_lag = atol(PQgetvalue(pgresult, i, REP_REPLAY_LAG));
data/pgtop-4.0.0/machine/m_freebsd.c:672:15:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->xtime = atol(PQgetvalue(pgresult, i, PROC_XSTART));
data/pgtop-4.0.0/machine/m_freebsd.c:673:15:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->qtime = atol(PQgetvalue(pgresult, i, PROC_QSTART));
data/pgtop-4.0.0/machine/m_freebsd.c:674:15:  [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).
			n->locks = atoi(PQgetvalue(pgresult, i, PROC_LOCKS));
data/pgtop-4.0.0/machine/m_freebsd.c:684: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.
		qsort((char *) pref, active_procs, sizeof(struct kinfo_proc *),
data/pgtop-4.0.0/machine/m_freebsd.c:697:1:  [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		fmt[MAX_COLS];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_freebsd.c:698:1:  [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[MAX_COLS];
data/pgtop-4.0.0/machine/m_freebsd.c:742: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		status[16];
data/pgtop-4.0.0/machine/m_freebsd.c:811: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(status, "RUN");
data/pgtop-4.0.0/machine/m_freebsd.c:860:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_linux.c:128: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 *cpustatenames[NCPUSTATES + 1] =
data/pgtop-4.0.0/machine/m_linux.c:141: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 *memorynames[NMEMSTATS + 1] =
data/pgtop-4.0.0/machine/m_linux.c:156: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 *swapnames[NSWAPSTATS + 1] =
data/pgtop-4.0.0/machine/m_linux.c:317: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		buff[128];
data/pgtop-4.0.0/machine/m_linux.c:324:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open("uptime", 0)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:336:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open("stat", 0)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:387: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		buffer[4096 + 1];
data/pgtop-4.0.0/machine/m_linux.c:394:12:  [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("loadavg", O_RDONLY)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:406:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				info->last_pid = atoi(p);
data/pgtop-4.0.0/machine/m_linux.c:417:12:  [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("stat", O_RDONLY)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:439:12:  [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("meminfo", O_RDONLY)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:541:12:  [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("vmstat", O_RDONLY)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:601: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		buffer[4096],
data/pgtop-4.0.0/machine/m_linux.c:607: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		value[BUFFERLEN + 1];
data/pgtop-4.0.0/machine/m_linux.c:618:3:  [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.
		sprintf(buffer, "%d/cmdline", proc->pid);
data/pgtop-4.0.0/machine/m_linux.c:619:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(buffer, O_RDONLY)) != -1)
data/pgtop-4.0.0/machine/m_linux.c:643:2:  [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.
	sprintf(buffer, "%d/stat", proc->pid);
data/pgtop-4.0.0/machine/m_linux.c:645:7:  [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(buffer, O_RDONLY);
data/pgtop-4.0.0/machine/m_linux.c:744:2:  [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.
	sprintf(buffer, "%d/io", proc->pid);
data/pgtop-4.0.0/machine/m_linux.c:745:7:  [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(buffer, O_RDONLY);
data/pgtop-4.0.0/machine/m_linux.c:867: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).
			n->pid = atoi(PQgetvalue(pgresult, i, 0));
data/pgtop-4.0.0/machine/m_linux.c:895:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->sent_lag = atol(PQgetvalue(pgresult, i, REP_SENT_LAG));
data/pgtop-4.0.0/machine/m_linux.c:896:20:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->write_lag = atol(PQgetvalue(pgresult, i, REP_WRITE_LAG));
data/pgtop-4.0.0/machine/m_linux.c:897:20:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->flush_lag = atol(PQgetvalue(pgresult, i, REP_FLUSH_LAG));
data/pgtop-4.0.0/machine/m_linux.c:898:21:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->replay_lag = atol(PQgetvalue(pgresult, i, REP_REPLAY_LAG));
data/pgtop-4.0.0/machine/m_linux.c:900: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(&pgtable[active_procs++], n, sizeof(struct top_proc));
data/pgtop-4.0.0/machine/m_linux.c:912:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->xtime = atol(PQgetvalue(pgresult, i, PROC_XSTART));
data/pgtop-4.0.0/machine/m_linux.c:913:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->qtime = atol(PQgetvalue(pgresult, i, PROC_QSTART));
data/pgtop-4.0.0/machine/m_linux.c:914:16:  [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).
				n->locks = atoi(PQgetvalue(pgresult, i, PROC_LOCKS));
data/pgtop-4.0.0/machine/m_linux.c:929:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
					memcpy(&pgtable[active_procs++], n,
data/pgtop-4.0.0/machine/m_linux.c:964: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(strchr(fmt_header, 'X'), uname_field, uname_len);
data/pgtop-4.0.0/machine/m_linux.c:972:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_linux.c:991:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_linux.c:1014:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_macosx.c:94: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 fmt[MAX_COLS];
data/pgtop-4.0.0/machine/m_macosx.c:159: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		fullcmd[FULLCMDLEN + 1];
data/pgtop-4.0.0/machine/m_macosx.c:371:1:  [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[MAX_COLS];
data/pgtop-4.0.0/machine/m_macosx.c:401: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[COMSIZ];
data/pgtop-4.0.0/machine/m_macosx.c:618:12:  [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).
		mib[3] = atoi(PQgetvalue(pgresult, i, 0));
data/pgtop-4.0.0/machine/m_netbsd.c:486:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	qsort((char *) pref, active_procs, sizeof(struct kinfo_proc2 *),
data/pgtop-4.0.0/machine/m_netbsd.c:512: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		state[10];
data/pgtop-4.0.0/machine/m_netbsd.c:514: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		wmesg[KI_WMESGLEN + 1];
data/pgtop-4.0.0/machine/m_netbsd.c:515:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[128];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_netbsd.c:537: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[COMSIZ];
data/pgtop-4.0.0/machine/m_openbsd.c:411:12:  [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).
		mib[3] = atoi(PQgetvalue(pgresult, i, 0));
data/pgtop-4.0.0/machine/m_openbsd.c:458:12:  [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).
		n->pid = atoi(PQgetvalue(pgresult, i, 0));
data/pgtop-4.0.0/machine/m_openbsd.c:480:18:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->sent_lag = atol(PQgetvalue(pgresult, i, REP_SENT_LAG));
data/pgtop-4.0.0/machine/m_openbsd.c:481:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->write_lag = atol(PQgetvalue(pgresult, i, REP_WRITE_LAG));
data/pgtop-4.0.0/machine/m_openbsd.c:482:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->flush_lag = atol(PQgetvalue(pgresult, i, REP_FLUSH_LAG));
data/pgtop-4.0.0/machine/m_openbsd.c:483:20:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->replay_lag = atol(PQgetvalue(pgresult, i, REP_REPLAY_LAG));
data/pgtop-4.0.0/machine/m_openbsd.c:491:15:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->xtime = atol(PQgetvalue(pgresult, i, PROC_XSTART));
data/pgtop-4.0.0/machine/m_openbsd.c:492:15:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			n->qtime = atol(PQgetvalue(pgresult, i, PROC_QSTART));
data/pgtop-4.0.0/machine/m_openbsd.c:493:15:  [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).
			n->locks = atoi(PQgetvalue(pgresult, i, PROC_LOCKS));
data/pgtop-4.0.0/machine/m_openbsd.c:500: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.
		qsort((char *) pref, active_procs,
data/pgtop-4.0.0/machine/m_openbsd.c:512:1:  [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		fmt[MAX_COLS];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_openbsd.c:518:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char **s,
data/pgtop-4.0.0/machine/m_openbsd.c:597:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_remote.c:188: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 *cpustatenames[NCPUSTATES + 1] =
data/pgtop-4.0.0/machine/m_remote.c:193: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 *memorynames[NMEMSTATS + 1] =
data/pgtop-4.0.0/machine/m_remote.c:206: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 *swapnames[NSWAPSTATS + 1] =
data/pgtop-4.0.0/machine/m_remote.c:291: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		sql[128];
data/pgtop-4.0.0/machine/m_remote.c:302:10:  [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).
	count = atoi(PQgetvalue(pgresult, 0, 0));
data/pgtop-4.0.0/machine/m_remote.c:685: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(strchr(fmt_header, 'X'), uname_field, uname_len);
data/pgtop-4.0.0/machine/m_remote.c:692:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_remote.c:713:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_remote.c:735:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char fmt[MAX_COLS];	/* static area where result is built */
data/pgtop-4.0.0/machine/m_remote.c:778:20:  [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).
		info->last_pid = atoi(PQgetvalue(pgresult, 0, c_last_pid));
data/pgtop-4.0.0/machine/m_remote.c:796:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		cp_time[0] = atol(PQgetvalue(pgresult, 0, c_cpu_user));
data/pgtop-4.0.0/machine/m_remote.c:797:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		cp_time[1] = atol(PQgetvalue(pgresult, 0, c_cpu_nice));
data/pgtop-4.0.0/machine/m_remote.c:798:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		cp_time[2] = atol(PQgetvalue(pgresult, 0, c_cpu_system));
data/pgtop-4.0.0/machine/m_remote.c:799:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		cp_time[3] = atol(PQgetvalue(pgresult, 0, c_cpu_idle));
data/pgtop-4.0.0/machine/m_remote.c:800:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		cp_time[4] = atol(PQgetvalue(pgresult, 0, c_cpu_iowait));
data/pgtop-4.0.0/machine/m_remote.c:822:27:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		memory_stats[MEMUSED] = atol(PQgetvalue(pgresult, 0, c_memused));
data/pgtop-4.0.0/machine/m_remote.c:823:27:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		memory_stats[MEMFREE] = atol(PQgetvalue(pgresult, 0, c_memfree));
data/pgtop-4.0.0/machine/m_remote.c:824:29:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		memory_stats[MEMSHARED] = atol(PQgetvalue(pgresult, 0, c_memshared));
data/pgtop-4.0.0/machine/m_remote.c:825:30:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		memory_stats[MEMBUFFERS] = atol(PQgetvalue(pgresult, 0, c_membuffers));
data/pgtop-4.0.0/machine/m_remote.c:826:29:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		memory_stats[MEMCACHED] = atol(PQgetvalue(pgresult, 0, c_memcached));
data/pgtop-4.0.0/machine/m_remote.c:827:26:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		swap_stats[SWAPUSED] = atol(PQgetvalue(pgresult, 0, c_swapused));
data/pgtop-4.0.0/machine/m_remote.c:828:26:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		swap_stats[SWAPFREE] = atol(PQgetvalue(pgresult, 0, c_swapfree));
data/pgtop-4.0.0/machine/m_remote.c:829:28:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		swap_stats[SWAPCACHED] = atol(PQgetvalue(pgresult, 0, c_swapcached));
data/pgtop-4.0.0/machine/m_remote.c:943:12:  [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).
		n->pid = atoi(PQgetvalue(pgresult, i, c_pid));
data/pgtop-4.0.0/machine/m_remote.c:969:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->sent_lag = atol(PQgetvalue(pgresult, i, 10));
data/pgtop-4.0.0/machine/m_remote.c:970:20:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->write_lag = atol(PQgetvalue(pgresult, i, 11));
data/pgtop-4.0.0/machine/m_remote.c:971:20:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->flush_lag = atol(PQgetvalue(pgresult, i, 12));
data/pgtop-4.0.0/machine/m_remote.c:972:21:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->replay_lag = atol(PQgetvalue(pgresult, i, 13));
data/pgtop-4.0.0/machine/m_remote.c:974: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(&pgrtable[active_procs++], n, sizeof(struct top_proc_r));
data/pgtop-4.0.0/machine/m_remote.c:1007:31:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->time = (unsigned long) atol(PQgetvalue(pgresult, i, c_utime));
data/pgtop-4.0.0/machine/m_remote.c:1008:32:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->time += (unsigned long) atol(PQgetvalue(pgresult, i, c_stime));
data/pgtop-4.0.0/machine/m_remote.c:1010:6:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
					atol(PQgetvalue(pgresult, i, c_starttime));
data/pgtop-4.0.0/machine/m_remote.c:1012:11:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
								  atol(PQgetvalue(pgresult, i, c_vsize)));
data/pgtop-4.0.0/machine/m_remote.c:1014:10:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
								 atol(PQgetvalue(pgresult, i, c_rss)));
data/pgtop-4.0.0/machine/m_remote.c:1018:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->xtime = atol(PQgetvalue(pgresult, i, c_xtime));
data/pgtop-4.0.0/machine/m_remote.c:1019:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->qtime = atol(PQgetvalue(pgresult, i, c_qtime));
data/pgtop-4.0.0/machine/m_remote.c:1021:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				n->locks = atol(PQgetvalue(pgresult, i, c_locks));
data/pgtop-4.0.0/machine/m_remote.c:1063:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
					memcpy(&pgrtable[active_procs++], n, sizeof(struct top_proc_r));
data/pgtop-4.0.0/machine/m_sco5.c:209:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((kmem = open(KMEM, O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_sco5.c:214:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((mem = open(MEM, O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_sco5.c:284:16:  [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	   *fp = fopen("/dev/table/avenrun", "r");
data/pgtop-4.0.0/machine/m_sco5.c:336:17:  [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 unsigned char shareable[RT_VM86 + 1];	/* 1 if shareable */
data/pgtop-4.0.0/machine/m_sco5.c:494:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	qsort((char *) pref, active_procs, sizeof(struct proc *), proc_compares[idx]);
data/pgtop-4.0.0/machine/m_sco5.c:506:1:  [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		fmt[128];			/* static area where result is built */
data/pgtop-4.0.0/machine/m_sco5.c:518: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		command[29];
data/pgtop-4.0.0/machine/m_sco5.c:532:3:  [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(command, "<swapped>");
data/pgtop-4.0.0/machine/m_sco5.c:541: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(command, "Swapper");
data/pgtop-4.0.0/machine/m_sco5.c:543: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(command, "Pager");
data/pgtop-4.0.0/machine/m_sco5.c:545: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(command, "Sync'er");
data/pgtop-4.0.0/machine/m_sunos5.c:1014:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char path[256];
data/pgtop-4.0.0/machine/m_sunos5.c:1232:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	qsort((char *) pref, active_procs, sizeof(struct prpsinfo *),
data/pgtop-4.0.0/machine/m_sunos5.c:1245:1:  [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		fmt[MAX_COLS];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_sunos5.c:1263: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		sb[10];
data/pgtop-4.0.0/machine/m_sunos5.c:1275:3:  [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.
		sprintf(sb, "cpu/%-2d", pp->pr_onpro);	/* XXX large #s may overflow
data/pgtop-4.0.0/machine/m_sunos5.c:1551: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[30];
data/pgtop-4.0.0/machine/m_sunos5.c:1561:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(buf, O_RDONLY)) < 0)
data/pgtop-4.0.0/machine/m_sunos5.c:1570:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(direntp->d_name, O_RDONLY)) < 0)
data/pgtop-4.0.0/machine/m_sunos5.c:1731:2:  [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(pcinfo.pc_clname, "TS");
data/pgtop-4.0.0/machine/m_svr4.c:192:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((kmem = open(KMEM, O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_svr4.c:271:18:  [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_cpu = open("/stats/cpuinfo", O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_svr4.c:407:1:  [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		fmt[MAX_COLS];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_svr4.c:618:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(direntp->d_name, O_RDONLY)) < 0)
data/pgtop-4.0.0/machine/m_svr4.c:661:2:  [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(pcinfo.pc_clname, "TS");
data/pgtop-4.0.0/machine/m_svr4.c:700:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd1 = open("/stats/sysinfo", O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_svr5.c:227:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((kmem = open(KMEM, O_RDONLY)) == -1)
data/pgtop-4.0.0/machine/m_svr5.c:411:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	qsort((char *) pref, active_procs, sizeof(struct prpsinfo *),
data/pgtop-4.0.0/machine/m_svr5.c:464:1:  [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		fmt[MAX_COLS];		/* static area where result is built */
data/pgtop-4.0.0/machine/m_svr5.c:926: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[30];
data/pgtop-4.0.0/machine/m_svr5.c:930:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(buf, O_RDONLY)) < 0)
data/pgtop-4.0.0/machine/m_svr5.c:982:2:  [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(pcinfo.pc_clname, "TS");
data/pgtop-4.0.0/machine/m_svr5.c:1012:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char path[256];
data/pgtop-4.0.0/os.h:34: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.
#define memcpy(a, b, c)		bcopy((b), (a), (c))
data/pgtop-4.0.0/os.h:34:26:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define memcpy(a, b, c)		bcopy((b), (a), (c))
data/pgtop-4.0.0/pg.c:108: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.
	const char *keywords[6] = {"host", "port", "user", "password", "dbname",
data/pgtop-4.0.0/pg.h:12: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.
	const char *values[6];
data/pgtop-4.0.0/pg_top.c:67:1:  [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		stdoutbuf[Buffersize];
data/pgtop-4.0.0/pg_top.c:420:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				if ((pgtctx->delay = atoi(optarg)) < 0 ||
data/pgtop-4.0.0/pg_top.h:96: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	   *header_options[2][MODE_TYPES];
data/pgtop-4.0.0/screen.c:52:1:  [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		termcap_buf[1024];
data/pgtop-4.0.0/screen.c:53:1:  [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		string_buffer[1024];
data/pgtop-4.0.0/screen.c:54:1:  [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		home[16];
data/pgtop-4.0.0/screen.c:55:1:  [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		lower_left[15];
data/pgtop-4.0.0/sprompt.c:54: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).
	termin = fopen(DEVTTY, "r");
data/pgtop-4.0.0/sprompt.c:55: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).
	termout = fopen(DEVTTY, "w");
data/pgtop-4.0.0/sprompt.c:88: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/pgtop-4.0.0/utils.c:57:12:  [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).
			return (atoi(str));
data/pgtop-4.0.0/utils.c:82:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buffer[16];		/* result is built here */
data/pgtop-4.0.0/utils.c:114:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buffer[16];		/* result is built here */
data/pgtop-4.0.0/utils.c:460:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		return ((char *) (sys_errlist[errnum]));
data/pgtop-4.0.0/utils.c:476:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char result[10];
data/pgtop-4.0.0/utils.c:482:3:  [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(result, "  ???");
data/pgtop-4.0.0/utils.c:486:3:  [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.
		sprintf(result, "%5.0f", v);
data/pgtop-4.0.0/utils.c:490:3:  [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.
		sprintf(result, "%5.2f", v);
data/pgtop-4.0.0/utils.c:515:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char result[10];
data/pgtop-4.0.0/utils.c:520:3:  [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(result, "   ???");
data/pgtop-4.0.0/utils.c:525:3:  [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.
		sprintf(result, "%5.1fH", (double) seconds / (double) (60l * 60l));
data/pgtop-4.0.0/utils.c:538:3:  [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.
		sprintf(result, "%3ld:%02ld", seconds / 60l, seconds % 60l);
data/pgtop-4.0.0/utils.c:557:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char retarray[NUM_STRINGS][16];
data/pgtop-4.0.0/utils.c:612:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char retarray[NUM_STRINGS][16];
data/pgtop-4.0.0/utils.c:647:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	debugfile = fopen("/tmp/top.debug", "w");
data/pgtop-4.0.0/color.c:118:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(ce->tag, p, len);
data/pgtop-4.0.0/color.c:135: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).
					len = strlen(p);
data/pgtop-4.0.0/color.c:261: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).
		len = strlen(bytag_names[i]) + 1;
data/pgtop-4.0.0/commands.c:464: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).
	msglen = strlen(msg) + 2;
data/pgtop-4.0.0/commands.c:485: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).
	arglen = strlen(arg);
data/pgtop-4.0.0/commands.c:524: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).
		fullhelp = (char *) malloc(strlen(help_text) + strlen(p) + 2);
data/pgtop-4.0.0/commands.c:524:50:  [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).
		fullhelp = (char *) malloc(strlen(help_text) + strlen(p) + 2);
data/pgtop-4.0.0/commands.c:716: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).
	width[0] = strlen(prefix);
data/pgtop-4.0.0/commands.c:719: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(PQgetvalue(pgresult, i, 0)) > width[1])
data/pgtop-4.0.0/commands.c:720: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).
			width[1] = strlen(PQgetvalue(pgresult, i, 0));
data/pgtop-4.0.0/commands.c:721: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(PQgetvalue(pgresult, i, 1)) > width[2])
data/pgtop-4.0.0/commands.c:722: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).
			width[2] = strlen(PQgetvalue(pgresult, i, 1));
data/pgtop-4.0.0/commands.c:723: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(PQgetvalue(pgresult, i, 2)) > width[3])
data/pgtop-4.0.0/commands.c:724: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).
			width[3] = strlen(PQgetvalue(pgresult, i, 2));
data/pgtop-4.0.0/commands.c:725: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(PQgetvalue(pgresult, i, 3)) > width[4])
data/pgtop-4.0.0/commands.c:726: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).
			width[4] = strlen(PQgetvalue(pgresult, i, 3));
data/pgtop-4.0.0/commands.c:727: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(PQgetvalue(pgresult, i, 4)) > width[5])
data/pgtop-4.0.0/commands.c:728: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).
			width[5] = strlen(PQgetvalue(pgresult, i, 4));
data/pgtop-4.0.0/commands.c:729: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(PQgetvalue(pgresult, i, 5)) > width[6])
data/pgtop-4.0.0/commands.c:730: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).
			width[6] = strlen(PQgetvalue(pgresult, i, 5));
data/pgtop-4.0.0/display.c:314: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).
			curr_x += strlen(new);
data/pgtop-4.0.0/display.c:391: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).
		clear_eol(strlen(bufp));
data/pgtop-4.0.0/display.c:463: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).
					len = strlen(p);
data/pgtop-4.0.0/display.c:520:33:  [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 (lastname != NULL && (num = strlen(lastname)) > 1 &&
data/pgtop-4.0.0/display.c:590: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).
	else if ((num = strlen(lastname)) > 1 &&
data/pgtop-4.0.0/display.c:730: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).
			if ((i = strlen(*pp++)) > 0)
data/pgtop-4.0.0/display.c:990: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).
	if (cpustate_total_length + (int) strlen(long_tag) - 2 >= screen_width)
data/pgtop-4.0.0/display.c:1000: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).
	x_cpustates = strlen(use);
data/pgtop-4.0.0/display.c:1227: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).
			msglen = strlen(next_msg);
data/pgtop-4.0.0/display.c:1258: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).
	header_length = strlen(text);
data/pgtop-4.0.0/display.c:1293: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(thisline) > display_width)
data/pgtop-4.0.0/display.c:1352: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).
			i = strlen(next_msg);
data/pgtop-4.0.0/display.c:1373: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).
			msglen = strlen(next_msg);
data/pgtop-4.0.0/display.c:1423:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((fflush(stdout), read(0, ptr, 1) > 0))
data/pgtop-4.0.0/display.c:1505:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	(void) read(0, &ch, 1);
data/pgtop-4.0.0/display.c:1523:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				(void) read(0, &readch, 1);
data/pgtop-4.0.0/getopt.c:33:27:  [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).
	(void) write(2, argv[0], strlen(argv[0]));\
data/pgtop-4.0.0/getopt.c:34: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).
	(void) write(2, s, strlen(s));\
data/pgtop-4.0.0/machine/m_freebsd.c:302: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(pw->pw_name) > namelength)
data/pgtop-4.0.0/machine/m_freebsd.c:303: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).
			namelength = strlen(pw->pw_name);
data/pgtop-4.0.0/machine/m_freebsd.c:402: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).
	cmdlength = 80 - strlen(Header) + 6;
data/pgtop-4.0.0/machine/m_freebsd.c:791:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(cmd, PP(pp, comm), MAX_COLS - 1);
data/pgtop-4.0.0/machine/m_linux.c:61:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(value, p, len); \
data/pgtop-4.0.0/machine/m_linux.c:326:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(fd, buff, sizeof(buff)) > 0)
data/pgtop-4.0.0/machine/m_linux.c:338:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(fd, buff, sizeof(buff)) > 0)
data/pgtop-4.0.0/machine/m_linux.c:396:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ((len = read(fd, buffer, sizeof(buffer) - 1)) > 0)
data/pgtop-4.0.0/machine/m_linux.c:419:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ((len = read(fd, buffer, sizeof(buffer) - 1)) > 0)
data/pgtop-4.0.0/machine/m_linux.c:448:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ((len = read(fd, buffer, sizeof(buffer) - 1)) > 0)
data/pgtop-4.0.0/machine/m_linux.c:546:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ((len = read(fd, buffer, sizeof(buffer) - 1)) > 0)
data/pgtop-4.0.0/machine/m_linux.c:623:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ((len = read(fd, buffer, MAX_COLS)) > 1)
data/pgtop-4.0.0/machine/m_linux.c:646:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	len = read(fd, buffer, sizeof(buffer) - 1);
data/pgtop-4.0.0/machine/m_linux.c:755:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	len = read(fd, buffer, sizeof(buffer) - 1);
data/pgtop-4.0.0/machine/m_linux.c:959:20:  [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			uname_len = strlen(uname_field);
data/pgtop-4.0.0/machine/m_macosx.c:403:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(buf, comm, COMSIZ);
data/pgtop-4.0.0/machine/m_macosx.c:405:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(&comm[1], buf, COMSIZ - 2);
data/pgtop-4.0.0/machine/m_macosx.c:555:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(fullcmd, stringPtr, (size_t) FULLCMDLEN);
data/pgtop-4.0.0/machine/m_netbsd.c:539:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		(void) strncpy(buf, comm, COMSIZ);
data/pgtop-4.0.0/machine/m_netbsd.c:541:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		(void) strncpy(&comm[1], buf, COMSIZ - 2);
data/pgtop-4.0.0/machine/m_remote.c:681:20:  [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			uname_len = strlen(uname_field);
data/pgtop-4.0.0/machine/m_sco5.c:553:4:  [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(command, "<");
data/pgtop-4.0.0/machine/m_sco5.c:555:4:  [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(command, ">");
data/pgtop-4.0.0/machine/m_sco5.c:650:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(kmem, (char *) ptr, size) == -1)
data/pgtop-4.0.0/machine/m_sunos5.c:675: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).
	namelen = strlen(name);
data/pgtop-4.0.0/machine/m_sunos5.c:1564:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(fd, currproc, sizeof(psinfo_t)) != sizeof(psinfo_t))
data/pgtop-4.0.0/machine/m_svr4.c:276:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(fd_cpu, &num_cpus, sizeof(int)) != sizeof(int))
data/pgtop-4.0.0/machine/m_svr4.c:526:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(kmem, (char *) ptr, size) == -1)
data/pgtop-4.0.0/machine/m_svr4.c:707:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd1, buf, read_sz) != read_sz)
data/pgtop-4.0.0/machine/m_svr5.c:564:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(kmem, (char *) ptr, size) == -1)
data/pgtop-4.0.0/machine/m_svr5.c:933:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(fd, currproc, sizeof(psinfo_t)) != sizeof(psinfo_t))
data/pgtop-4.0.0/pg.c:151:25:  [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).
		sql = (char *) malloc(strlen(GET_LOCKS) + 7);
data/pgtop-4.0.0/pg.c:156:25:  [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).
		sql = (char *) malloc(strlen(GET_LOCKS) + 7);
data/pgtop-4.0.0/pg.c:207:25:  [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).
		sql = (char *) malloc(strlen(CURRENT_QUERY) + 7);
data/pgtop-4.0.0/pg.c:212:25:  [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).
		sql = (char *) malloc(strlen(CURRENT_QUERY_9_1) + 7);
data/pgtop-4.0.0/pg_top.c:383:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(pgtctx->ps.usename, optarg, NAMEDATALEN);
data/pgtop-4.0.0/pg_top.c:509:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(0, &ch, 1) != 1)
data/pgtop-4.0.0/screen.c:141:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	(void) strncpy(lower_left, lower_left_motion, 15);
data/pgtop-4.0.0/screen.c:259:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	(void) strncpy(home, home_motion, 15);
data/pgtop-4.0.0/sprompt.c:84: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).
	length = strlen(destination);
data/pgtop-4.0.0/sprompt.c:95: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).
			buflen = strlen(buf);
data/pgtop-4.0.0/utils.c:46:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(str);
data/pgtop-4.0.0/utils.c:270: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).
		cnt += strlen(p) + 2;

ANALYSIS SUMMARY:

Hits = 363
Lines analyzed = 19130 in approximately 0.45 seconds (42858 lines/second)
Physical Source Lines of Code (SLOC) = 13358
Hits@level = [0] 158 [1]  81 [2] 220 [3]   9 [4]  51 [5]   2
Hits@level+ = [0+] 521 [1+] 363 [2+] 282 [3+]  62 [4+]  53 [5+]   2
Hits/KSLOC@level+ = [0+] 39.0028 [1+] 27.1747 [2+] 21.1109 [3+] 4.64141 [4+] 3.96766 [5+] 0.149723
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.