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/sdl-net1.2-1.2.8/chat.cpp
Examining data/sdl-net1.2-1.2.8/chat.h
Examining data/sdl-net1.2-1.2.8/chatd.c
Examining data/sdl-net1.2-1.2.8/SDLnet.c
Examining data/sdl-net1.2-1.2.8/SDLnetselect.c
Examining data/sdl-net1.2-1.2.8/SDLnetsys.h
Examining data/sdl-net1.2-1.2.8/SDLnetTCP.c
Examining data/sdl-net1.2-1.2.8/showinterfaces.c
Examining data/sdl-net1.2-1.2.8/VisualC/resource.h
Examining data/sdl-net1.2-1.2.8/SDL_net.h
Examining data/sdl-net1.2-1.2.8/SDLnetUDP.c

FINAL RESULTS:

data/sdl-net1.2-1.2.8/SDLnetUDP.c:28:9:  [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.
#define srandom	srand
data/sdl-net1.2-1.2.8/SDLnetUDP.c:28:17:  [3] (random) srand:
  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.
#define srandom	srand
data/sdl-net1.2-1.2.8/SDLnetUDP.c:29:9:  [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.
#define random	rand
data/sdl-net1.2-1.2.8/SDLnetUDP.c:228:2:  [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.
	srandom(SDL_GetTicks());
data/sdl-net1.2-1.2.8/SDLnetUDP.c:349:9:  [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.
			if ((random()%100) <= sock->packetloss) {
data/sdl-net1.2-1.2.8/chat.cpp:83:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		     ((name=getenv("CHAT_USER")) == NULL) &&
data/sdl-net1.2-1.2.8/chat.cpp:84:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		     ((name=getenv("USER")) == NULL ) ) {
data/sdl-net1.2-1.2.8/SDLnet.c:129: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(&address->host,hp->h_addr,hp->h_length);
data/sdl-net1.2-1.2.8/SDLnet.c:174: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 data[4096];
data/sdl-net1.2-1.2.8/chat.cpp:64: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 *image_files[NUM_IMAGES] = {
data/sdl-net1.2-1.2.8/chat.cpp: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 hello[1+1+256];
data/sdl-net1.2-1.2.8/chat.cpp:92: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(&hello[CHAT_HELLO_PORT], &myip->port, 2);
data/sdl-net1.2-1.2.8/chat.cpp:122: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(packets[0]->data, buf, len);
data/sdl-net1.2-1.2.8/chat.cpp:130: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 keybuf[80-sizeof(CHAT_PROMPT)+1];
data/sdl-net1.2-1.2.8/chat.cpp:190: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(people[which].name, &data[CHAT_ADD_NAME], 256);
data/sdl-net1.2-1.2.8/chat.cpp:282:22:  [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.
			termwin->AddText((char *)packets[n]->data, packets[n]->len);
data/sdl-net1.2-1.2.8/chatd.c:103: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 data[512];
data/sdl-net1.2-1.2.8/chatd.c:106:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	n = strlen((char *)people[about].name)+1;
data/sdl-net1.2-1.2.8/chatd.c:109: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(&data[CHAT_ADD_HOST], &people[about].peer.host, 4);
data/sdl-net1.2-1.2.8/chatd.c:110: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(&data[CHAT_ADD_PORT], &people[about].peer.port, 2);
data/sdl-net1.2-1.2.8/chatd.c:112: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(&data[CHAT_ADD_NAME], people[about].name, n);
data/sdl-net1.2-1.2.8/chatd.c:118: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 data[512];
data/sdl-net1.2-1.2.8/chatd.c:145: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(&people[which].peer.port,
data/sdl-net1.2-1.2.8/chatd.c:147: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(people[which].name,
data/sdl-net1.2-1.2.8/chat.cpp:93:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if ( strlen(name) > 255 ) {
data/sdl-net1.2-1.2.8/chat.cpp:96: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).
			n = strlen(name);
data/sdl-net1.2-1.2.8/chat.cpp:99:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(&hello[CHAT_HELLO_NAME], name, n);
data/sdl-net1.2-1.2.8/chatd.c:106: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).
	n = strlen((char *)people[about].name)+1;

ANALYSIS SUMMARY:

Hits = 28
Lines analyzed = 2621 in approximately 0.09 seconds (30311 lines/second)
Physical Source Lines of Code (SLOC) = 1627
Hits@level = [0]  22 [1]   4 [2]  17 [3]   7 [4]   0 [5]   0
Hits@level+ = [0+]  50 [1+]  28 [2+]  24 [3+]   7 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 30.7314 [1+] 17.2096 [2+] 14.7511 [3+] 4.3024 [4+]   0 [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.