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/cdpr-2.4/cdp.h
Examining data/cdpr-2.4/cdprs.c
Examining data/cdpr-2.4/conffile.c
Examining data/cdpr-2.4/u_ints.h
Examining data/cdpr-2.4/XGetopt.c
Examining data/cdpr-2.4/XGetopt.h
Examining data/cdpr-2.4/cdpr.c
Examining data/cdpr-2.4/cdpr.h

FINAL RESULTS:

data/cdpr-2.4/cdpr.c:124:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(switch_ip6, "switch_ip6=%s&", ipv6_buf);
data/cdpr-2.4/cdprs.c:93:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(location, "&loc=%s", url);
data/cdpr-2.4/cdprs.c:215:6:  [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(msg, http_hdr);
data/cdpr-2.4/cdprs.c:238: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(msg,string);
data/cdpr-2.4/XGetopt.c:134: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 argc, char *argv[], char *optstring)
data/cdpr-2.4/XGetopt.h:21: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 argc, char *argv[], char *optstring);
data/cdpr-2.4/cdpr.c:550:13:  [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((c = getopt(argc, argv, "d:t:vhu:l:n:s:p:r:")) !=EOF)
data/cdpr-2.4/cdpr.c:100: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 switch_ip[100];
data/cdpr-2.4/cdpr.c:103: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 (switch_ip, "switch_ip=%d.%d.%d.%d&",
data/cdpr-2.4/cdpr.c:114:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char ipv6_buf[INET6_ADDRSTRLEN];
data/cdpr-2.4/cdpr.c:117:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char switch_ip6[600];
data/cdpr-2.4/cdpr.c:281:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy (&data, d, sizeof (CDP_DATA));
data/cdpr-2.4/cdpr.c:310:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
				char port[1024];
data/cdpr-2.4/cdpr.c:314:5:  [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(port, "port=%.*s", portlen, portval);
data/cdpr-2.4/cdpr.c:513: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/cdpr-2.4/cdpr.c:560: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).
				seconds = atoi(optarg);
data/cdpr-2.4/cdprs.c:74: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 uname[256];
data/cdpr-2.4/cdprs.c:88: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 location[500]={0};
data/cdpr-2.4/conffile.c:74:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			port = atoi(tport);
data/cdpr-2.4/conffile.c:151: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[666] = {0};
data/cdpr-2.4/conffile.c:167: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).
		FILE *fp = fopen (file, "r");
data/cdpr-2.4/cdpr.c:313: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).
				portval = urlencode((char *)v, strlen((char *)v), &portlen);
data/cdpr-2.4/cdpr.c:718: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(errbuf))
data/cdpr-2.4/cdpr.c:748:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(10000);
data/cdpr-2.4/cdprs.c:90: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).
	char *url = urlencode (loc, strlen (loc), &loc_len);
data/cdpr-2.4/cdprs.c:167: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).
	msg_len = strlen(msg);
data/cdpr-2.4/cdprs.c:220: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).
					if(strlen(string))

ANALYSIS SUMMARY:

Hits = 27
Lines analyzed = 1632 in approximately 0.07 seconds (22884 lines/second)
Physical Source Lines of Code (SLOC) = 1074
Hits@level = [0]  97 [1]   6 [2]  14 [3]   3 [4]   4 [5]   0
Hits@level+ = [0+] 124 [1+]  27 [2+]  21 [3+]   7 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 115.456 [1+] 25.1397 [2+] 19.5531 [3+] 6.51769 [4+] 3.72439 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.