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/arpwatch-2.1a15/bcopy.c
Examining data/arpwatch-2.1a15/dns.h
Examining data/arpwatch-2.1a15/ec.h
Examining data/arpwatch-2.1a15/fddi.h
Examining data/arpwatch-2.1a15/intoa.c
Examining data/arpwatch-2.1a15/lbl/gnuc.h
Examining data/arpwatch-2.1a15/lbl/os-irix4.h
Examining data/arpwatch-2.1a15/lbl/os-irix5.h
Examining data/arpwatch-2.1a15/lbl/os-osf3.h
Examining data/arpwatch-2.1a15/lbl/os-solaris2.h
Examining data/arpwatch-2.1a15/lbl/os-sunos3.h
Examining data/arpwatch-2.1a15/lbl/os-sunos4.h
Examining data/arpwatch-2.1a15/lbl/os-ultrix4.h
Examining data/arpwatch-2.1a15/machdep.c
Examining data/arpwatch-2.1a15/machdep.h
Examining data/arpwatch-2.1a15/setsignal.c
Examining data/arpwatch-2.1a15/setsignal.h
Examining data/arpwatch-2.1a15/strerror.c
Examining data/arpwatch-2.1a15/addresses.h
Examining data/arpwatch-2.1a15/arpwatch.h
Examining data/arpwatch-2.1a15/db.h
Examining data/arpwatch-2.1a15/file.h
Examining data/arpwatch-2.1a15/report.h
Examining data/arpwatch-2.1a15/arpsnmp.c
Examining data/arpwatch-2.1a15/util.c
Examining data/arpwatch-2.1a15/util.h
Examining data/arpwatch-2.1a15/localhost.c
Examining data/arpwatch-2.1a15/localhost.h
Examining data/arpwatch-2.1a15/ec.c
Examining data/arpwatch-2.1a15/file.c
Examining data/arpwatch-2.1a15/report.c
Examining data/arpwatch-2.1a15/db.c
Examining data/arpwatch-2.1a15/arpwatch.c
Examining data/arpwatch-2.1a15/dns.c

FINAL RESULTS:

data/arpwatch-2.1a15/lbl/os-sunos3.h:62:5:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
int	chmod(const char *, int);
data/arpwatch-2.1a15/lbl/os-sunos3.h:63:5:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
int	chown(const char *, int, int);
data/arpwatch-2.1a15/lbl/os-sunos4.h:132:5:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
int	readlink(const char *, char *, int);
data/arpwatch-2.1a15/arpwatch.c:870:2:  [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(tstr, str);
data/arpwatch-2.1a15/lbl/os-irix5.h:37:5:  [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.
int	snprintf(char *, size_t, const char *, ...);
data/arpwatch-2.1a15/lbl/os-osf3.h:31:5:  [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.
int	snprintf(char *, size_t, const char *, ...);
data/arpwatch-2.1a15/lbl/os-solaris2.h:48:5:  [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.
int	snprintf(char *, size_t, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:30:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
int	fprintf(FILE *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:39:7:  [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.
u_int	vfprintf(FILE *, const char *, char *);	/* arg 3 is really va_list */
data/arpwatch-2.1a15/lbl/os-sunos3.h:53:5:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
int	access(const char *, int);
data/arpwatch-2.1a15/lbl/os-sunos3.h:66:7:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
char	*crypt(const char *, const char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:71:5:  [4] (shell) execl:
  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	execl(const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:72:5:  [4] (shell) execlp:
  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	execlp(const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:73:5:  [4] (shell) execv:
  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	execv(const char *, char * const *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:93:7:  [4] (misc) getlogin:
  It's often easy to fool getlogin. Sometimes it does not work at all,
  because some program messed up the utmp file. Often, it gives only the
  first 8 characters of the login name. The user currently logged in on the
  controlling tty of our program need not be the user who started it. Avoid
  getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid())
  and extract the desired information instead.
char	*getlogin __P((void));
data/arpwatch-2.1a15/lbl/os-sunos3.h:94:7:  [4] (misc) getpass:
  This function is obsolete and not portable. It was in SUSv2 but removed by
  POSIX.2. What it does exactly varies considerably between systems,
  particularly in where its prompt is displayed and where it gets its data
  (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations
  overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do
  exactly what you want. If you continue to use it, or write your own, be
  sure to zero the password as soon as possible to avoid leaving the
  cleartext password visible in the process' address space.
char	*getpass(char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:129:5:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
int	printf(const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:150:5:  [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.
int	snprintf(char *, size_t, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:153:7:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
char	*sprintf(char *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:155:5:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
int	sscanf(char *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:163:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
char	*strcpy(char *, const char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:169:6:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
void	syslog(int, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:177:7:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
char	*vsprintf(char *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:31:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
int	fprintf(FILE *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:42:5:  [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.
int	vfprintf(FILE *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:43:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
int	vprintf(const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:64:7:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
char	*crypt(const char *, const char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:95:7:  [4] (misc) getpass:
  This function is obsolete and not portable. It was in SUSv2 but removed by
  POSIX.2. What it does exactly varies considerably between systems,
  particularly in where its prompt is displayed and where it gets its data
  (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations
  overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do
  exactly what you want. If you continue to use it, or write your own, be
  sure to zero the password as soon as possible to avoid leaving the
  cleartext password visible in the process' address space.
char	*getpass(char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:125:7:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
char	*mktemp(char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:129:5:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
int	printf(const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:162:5:  [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.
int	snprintf(char *, size_t, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:167:5:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
int	sscanf(char *, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:179:6:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
void	syslog(int, const char *, ...);
data/arpwatch-2.1a15/lbl/os-sunos4.h:180:5:  [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	system(const char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:189:5:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
int	vsprintf(char *, const char *, ...);
data/arpwatch-2.1a15/report.c:107:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	(void)sprintf(buf, "%u %s%s", (u_int32_t)t, cp, PLURAL(t));
data/arpwatch-2.1a15/report.c:163:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	(void)sprintf(buf, "%s, %s %d, %d %d:%02d:%02d %s",
data/arpwatch-2.1a15/report.c:319:8:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	(void)fprintf(f, fmt, "hostname", hn);
data/arpwatch-2.1a15/report.c:320:8:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	(void)fprintf(f, fmt, "ip address", intoa(a));
data/arpwatch-2.1a15/report.c:321:8:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	(void)fprintf(f, fmt, "interface", interface);
data/arpwatch-2.1a15/report.c:322:8:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	(void)fprintf(f, fmt, "ethernet address", e2str(e1));
data/arpwatch-2.1a15/report.c:325:8:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	(void)fprintf(f, fmt, "ethernet vendor", cp);
data/arpwatch-2.1a15/report.c:327:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		(void)sprintf(buf, "%s %s", cpu, os);
data/arpwatch-2.1a15/report.c:328:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		(void)fprintf(f, fmt, "dns cpu & os", buf);
data/arpwatch-2.1a15/report.c:331:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		(void)fprintf(f, fmt, "old ethernet address", e2str(e2));
data/arpwatch-2.1a15/report.c:334:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		(void)fprintf(f, fmt, "old ethernet vendor", cp);
data/arpwatch-2.1a15/report.c:337:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		(void)fprintf(f, fmt, "timestamp", fmtdate(*t1p));
data/arpwatch-2.1a15/report.c:339:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		(void)fprintf(f, fmt, "previous timestamp", fmtdate(*t2p));
data/arpwatch-2.1a15/report.c:341:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		(void)fprintf(f, fmt, "delta", fmtdelta(*t1p - *t2p));
data/arpwatch-2.1a15/report.c:355:2:  [4] (shell) execl:
  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.
	execl(sendmail, "sendmail", "-odi", watcher, NULL);
data/arpwatch-2.1a15/util.c:92:8:  [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).
	(void)strcpy(xbuf, e2str(ea));
data/arpwatch-2.1a15/util.c:95: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(xbuf, e2str(ha));
data/arpwatch-2.1a15/util.c:123:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	(void)sprintf(oldarpfile, "%s-", arpfile);
data/arpwatch-2.1a15/util.c:124:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	(void)sprintf(newarpfile, "%s.new", arpfile);
data/arpwatch-2.1a15/util.c:196:8:  [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).
	(void)strcpy(strptr, str);
data/arpwatch-2.1a15/arpsnmp.c:100:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((op = getopt(argc, argv, options)) != EOF)
data/arpwatch-2.1a15/arpwatch.c:282:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((op = getopt(argc, argv, options)) != EOF)
data/arpwatch-2.1a15/lbl/os-solaris2.h:33:7:  [3] (buffer) getwd:
  This does not protect against buffer overflows by itself, so use with
  caution (CWE-120, CWE-20). Use getcwd instead.
char	*getwd(char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:89:7:  [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 __P((char *));
data/arpwatch-2.1a15/lbl/os-sunos3.h:91:5:  [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.
int	getopt(int, char * const *, const char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:131:6:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
long	random(void);
data/arpwatch-2.1a15/lbl/os-sunos3.h:154:6:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
void	srandom(int);
data/arpwatch-2.1a15/lbl/os-sunos4.h:60:5:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
int	chroot(const char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:93:5:  [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.
int	getopt(int, char * const *, const char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:110:7:  [3] (buffer) getwd:
  This does not protect against buffer overflows by itself, so use with
  caution (CWE-120, CWE-20). Use getcwd instead.
char	*getwd(char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:131:6:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
long	random(void);
data/arpwatch-2.1a15/lbl/os-sunos4.h:166:6:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
void	srandom(int);
data/arpwatch-2.1a15/lbl/os-ultrix4.h:29:5:  [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.
int	getopt(int, char * const *, const char *);
data/arpwatch-2.1a15/arpsnmp.c:81: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[256];
data/arpwatch-2.1a15/arpsnmp.c:185:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((f = fopen(file, "r")) == NULL) {
data/arpwatch-2.1a15/arpwatch.c:214: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[PCAP_ERRBUF_SIZE];
data/arpwatch-2.1a15/arpwatch.c:429:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			fd = open("/dev/tty", O_RDWR);
data/arpwatch-2.1a15/arpwatch.c:849: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 tstr[64];
data/arpwatch-2.1a15/arpwatch.h:14:6:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
void bcopy(const void *, void *, size_t);
data/arpwatch-2.1a15/bcopy.c:45:6:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
void bcopy(const void *, void *, size_t);
data/arpwatch-2.1a15/bcopy.c:64:1:  [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(dst0, src0, length)
data/arpwatch-2.1a15/bcopy.c:71:1:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
bcopy(src0, dst0, length)
data/arpwatch-2.1a15/db.c:65: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 h[34];		/* simple hostname */
data/arpwatch-2.1a15/db.c:67: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 i[16];		/* interface */
data/arpwatch-2.1a15/dns.c:60: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 hostbuf[BUFSIZ+1];
data/arpwatch-2.1a15/ec.c:79: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 xbuf[128];
data/arpwatch-2.1a15/ec.c:82:8:  [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.
	(void)sprintf(xbuf, "%.32s:0:0:0", cp);
data/arpwatch-2.1a15/ec.c:138: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/arpwatch-2.1a15/ec.c:219: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 str[32];
data/arpwatch-2.1a15/ec.c:221:8:  [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.
	(void)sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x",
data/arpwatch-2.1a15/file.c:73: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/arpwatch-2.1a15/file.c:122:8:  [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).
			t = atoi(cp2);
data/arpwatch-2.1a15/intoa.c:23: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 buf[sizeof(".xxx.xxx.xxx.xxx")];
data/arpwatch-2.1a15/lbl/os-sunos3.h:55:5:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
int	atoi(const char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:56: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).
long	atol(const char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:58:6:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
void	bcopy(const void *, void *, u_int);
data/arpwatch-2.1a15/lbl/os-sunos3.h:124:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
char	*memcpy(char *, const char *, u_int);
data/arpwatch-2.1a15/lbl/os-sunos3.h:126:5:  [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).
int	open(char *, int, ...);
data/arpwatch-2.1a15/lbl/os-sunos3.h:176:5:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
int	vfork(void);
data/arpwatch-2.1a15/lbl/os-sunos4.h:58:6:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
void	bcopy(const void *, void *, u_int);
data/arpwatch-2.1a15/lbl/os-sunos4.h:124:5:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
int	mkstemp(char *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:188:5:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
int	vfork(void);
data/arpwatch-2.1a15/lbl/os-ultrix4.h:26:6:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
void	bcopy(const void *, void *, u_int);
data/arpwatch-2.1a15/machdep.c:42:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		(void)sprintf(ebuf, "setsysinfo: errno %d", errno);
data/arpwatch-2.1a15/report.c:86: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 buf[132];
data/arpwatch-2.1a15/report.c:111: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 *dow[7] = {
data/arpwatch-2.1a15/report.c:121: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 *moy[12] = {
data/arpwatch-2.1a15/report.c:146: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 zone[32], buf[132];
data/arpwatch-2.1a15/report.c:159:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		(void)sprintf(zone, "%c%02d%02d", ch, mw / 60, mw % 60);
data/arpwatch-2.1a15/report.c:244: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 tempfile[64], cpu[64], os[64];
data/arpwatch-2.1a15/report.c:250:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[132];
data/arpwatch-2.1a15/report.c:296:9:  [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.
		(void)strcpy(tempfile, "/tmp/arpwatch.XXXXXX");
data/arpwatch-2.1a15/report.c:297:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
		if ((fd = mkstemp(tempfile)) < 0) {
data/arpwatch-2.1a15/strerror.c:54: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 ebuf[40] = UPREFIX;		/* 64-bit number + slop */
data/arpwatch-2.1a15/strerror.c:57:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char tmp[40];
data/arpwatch-2.1a15/util.c:85: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 xbuf[64];
data/arpwatch-2.1a15/util.c:94: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(xbuf, " (");
data/arpwatch-2.1a15/util.c:121: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 oldarpfile[256], newarpfile[256];
data/arpwatch-2.1a15/util.c:159:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((f = fopen(arpfile, "r")) == NULL) {
data/arpwatch-2.1a15/util.c:170:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((f = fopen(ethercodes, "r")) != NULL) {
data/arpwatch-2.1a15/arpwatch.c:179:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (filter_user && strlen(filter_user)) {
data/arpwatch-2.1a15/arpwatch.c:181: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(filter_user) + strlen(filter_default) + 7 + 1;
data/arpwatch-2.1a15/arpwatch.c:181:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		len = strlen(filter_user) + strlen(filter_default) + 7 + 1;
data/arpwatch-2.1a15/arpwatch.c:851: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(str) > sizeof(tstr) - 1)
data/arpwatch-2.1a15/db.c:297:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ep->h, h, 34);
data/arpwatch-2.1a15/db.c:302:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ep->i, interface, 16);
data/arpwatch-2.1a15/db.c:323:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ep->h, h, 34);
data/arpwatch-2.1a15/ec.c:144: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).
		cp2 = cp + strlen(cp) - 1;
data/arpwatch-2.1a15/file.c:80: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).
		cp2 = cp + strlen(cp) - 1;
data/arpwatch-2.1a15/lbl/os-sunos3.h:43:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
int	read(int, const char *, u_int);
data/arpwatch-2.1a15/lbl/os-sunos3.h:166:5:  [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	strlen(const char *);
data/arpwatch-2.1a15/lbl/os-sunos3.h:179:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
int	umask(int);
data/arpwatch-2.1a15/lbl/os-sunos4.h:30:5:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
int	fgetc(FILE *);
data/arpwatch-2.1a15/lbl/os-sunos4.h:47:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
int	read(int, char *, u_int);
data/arpwatch-2.1a15/util.c:96:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
		(void)strcat(xbuf, ")");
data/arpwatch-2.1a15/util.c:186: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).
	i = strlen(str) + 1;

ANALYSIS SUMMARY:

Hits = 131
Lines analyzed = 4023 in approximately 0.16 seconds (24833 lines/second)
Physical Source Lines of Code (SLOC) = 2813
Hits@level = [0] 101 [1]  16 [2]  47 [3]  13 [4]  52 [5]   3
Hits@level+ = [0+] 232 [1+] 131 [2+] 115 [3+]  68 [4+]  55 [5+]   3
Hits/KSLOC@level+ = [0+] 82.4742 [1+] 46.5695 [2+] 40.8816 [3+] 24.1735 [4+] 19.5521 [5+] 1.06648
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.