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/bitstormlite-0.2q/src/RateMeasure.cpp
Examining data/bitstormlite-0.2q/src/sha1.cpp
Examining data/bitstormlite-0.2q/src/BTTask.h
Examining data/bitstormlite-0.2q/src/bdict.cpp
Examining data/bitstormlite-0.2q/src/xmlnode.cpp
Examining data/bitstormlite-0.2q/src/UPnpNat.h
Examining data/bitstormlite-0.2q/src/PeerLink.cpp
Examining data/bitstormlite-0.2q/src/UDPTracker.h
Examining data/bitstormlite-0.2q/src/PieceRequest.cpp
Examining data/bitstormlite-0.2q/src/gettext.h
Examining data/bitstormlite-0.2q/src/Storage.cpp
Examining data/bitstormlite-0.2q/src/blist.cpp
Examining data/bitstormlite-0.2q/src/utils.h
Examining data/bitstormlite-0.2q/src/LiteWindow.h
Examining data/bitstormlite-0.2q/src/BTTask.cpp
Examining data/bitstormlite-0.2q/src/PieceRequest.h
Examining data/bitstormlite-0.2q/src/bstring.h
Examining data/bitstormlite-0.2q/src/xmlnode.h
Examining data/bitstormlite-0.2q/src/RateMeasure.h
Examining data/bitstormlite-0.2q/src/Storage.h
Examining data/bitstormlite-0.2q/src/TorrentFile.h
Examining data/bitstormlite-0.2q/src/UPnpNat.cpp
Examining data/bitstormlite-0.2q/src/log.h
Examining data/bitstormlite-0.2q/src/bobject.h
Examining data/bitstormlite-0.2q/src/EpollReactor.h
Examining data/bitstormlite-0.2q/src/NewTaskWindow.h
Examining data/bitstormlite-0.2q/src/EpollReactor.cpp
Examining data/bitstormlite-0.2q/src/blist.h
Examining data/bitstormlite-0.2q/src/PeerAcceptor.h
Examining data/bitstormlite-0.2q/src/PeerLink.h
Examining data/bitstormlite-0.2q/src/bdict.h
Examining data/bitstormlite-0.2q/src/LiteWindow.cpp
Examining data/bitstormlite-0.2q/src/TrackerManager.h
Examining data/bitstormlite-0.2q/src/PeerManager.cpp
Examining data/bitstormlite-0.2q/src/ThreadMutex.cpp
Examining data/bitstormlite-0.2q/src/UDPTracker.cpp
Examining data/bitstormlite-0.2q/src/main.cpp
Examining data/bitstormlite-0.2q/src/TCPTracker.h
Examining data/bitstormlite-0.2q/src/Socket.h
Examining data/bitstormlite-0.2q/src/binteger.h
Examining data/bitstormlite-0.2q/src/TrackerManager.cpp
Examining data/bitstormlite-0.2q/src/TorrentFile.cpp
Examining data/bitstormlite-0.2q/src/PeerAcceptor.cpp
Examining data/bitstormlite-0.2q/src/sha1.h
Examining data/bitstormlite-0.2q/src/TCPTracker.cpp
Examining data/bitstormlite-0.2q/src/PeerManager.h
Examining data/bitstormlite-0.2q/src/Socket.cpp
Examining data/bitstormlite-0.2q/src/ThreadMutex.h
Examining data/bitstormlite-0.2q/src/BitSet.h
Examining data/bitstormlite-0.2q/src/NewTaskWindow.cpp
Examining data/bitstormlite-0.2q/src/BitSet.cpp
Examining data/bitstormlite-0.2q/src/BitStorm.h

FINAL RESULTS:

data/bitstormlite-0.2q/src/LiteWindow.cpp:410:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s", "∞");
data/bitstormlite-0.2q/src/LiteWindow.cpp:414:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s", "0.00");
data/bitstormlite-0.2q/src/TCPTracker.cpp:278:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(result, "%s?info_hash=%s&peer_id=%s&port=%u&compact=1&uploaded=%llu&downloaded=%llu&left=%llu&event=%s",
data/bitstormlite-0.2q/src/UPnpNat.cpp:387:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(str, "http://%s:%d", ip.c_str(), port);
data/bitstormlite-0.2q/src/utils.h:328:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:%u", ip, port);
data/bitstormlite-0.2q/src/UDPTracker.cpp:106:4:  [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.
			srand(GetTickCount());
data/bitstormlite-0.2q/src/BTTask.cpp:268:6:  [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[21];
data/bitstormlite-0.2q/src/BTTask.cpp:269:6:  [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(buf, "-BM0002-");
data/bitstormlite-0.2q/src/LiteWindow.cpp:365: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[128];
data/bitstormlite-0.2q/src/LiteWindow.cpp:366: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(buf, "%01.2f%%", p*100);
data/bitstormlite-0.2q/src/LiteWindow.cpp:396: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(buf, "%u/%u/%u",
data/bitstormlite-0.2q/src/LiteWindow.cpp:406: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(buf, "%01.2f", shareRate);
data/bitstormlite-0.2q/src/NewTaskWindow.cpp:196: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[1024];
data/bitstormlite-0.2q/src/PeerLink.cpp:454: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[68];
data/bitstormlite-0.2q/src/PeerLink.cpp:468: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[5];
data/bitstormlite-0.2q/src/PeerLink.cpp:487: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[5];
data/bitstormlite-0.2q/src/PeerLink.cpp: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 header[5];	
data/bitstormlite-0.2q/src/PeerLink.cpp:525: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[9];
data/bitstormlite-0.2q/src/PeerLink.cpp:535: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[17];
data/bitstormlite-0.2q/src/PeerLink.cpp:548: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[13];
data/bitstormlite-0.2q/src/PeerLink.cpp:563: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[17];
data/bitstormlite-0.2q/src/Storage.cpp:72:17:  [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* stream = fopen(_psfPath.c_str(), "w");
data/bitstormlite-0.2q/src/Storage.cpp:98:17:  [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* stream = fopen(_psfPath.c_str(), "w");
data/bitstormlite-0.2q/src/Storage.cpp:109: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 infoHash[20];
data/bitstormlite-0.2q/src/Storage.cpp:135: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).
	int psf = open(_psfPath.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRWXG | S_IRWXO);
data/bitstormlite-0.2q/src/Storage.cpp:658:16:  [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 handle = open(filePath.c_str(), O_RDWR | O_CREAT | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRWXG | S_IRWXO);
data/bitstormlite-0.2q/src/TCPTracker.cpp:227: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 ipBuf[256];
data/bitstormlite-0.2q/src/TCPTracker.cpp:277: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 result[1024];
data/bitstormlite-0.2q/src/TorrentFile.cpp:128:11:  [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 fd= open(filePath,O_RDONLY);
data/bitstormlite-0.2q/src/TorrentFile.cpp:136: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[2048];
data/bitstormlite-0.2q/src/TorrentFile.h:64:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char _infoHash[20];
data/bitstormlite-0.2q/src/UDPTracker.cpp:48:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char info_hash[20];
data/bitstormlite-0.2q/src/UDPTracker.cpp:49: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 peer_id[20];
data/bitstormlite-0.2q/src/UDPTracker.cpp:256: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(pkg.info_hash, _trackerManager->getBTTask()->getTorrentFile()->getInfoHash(), 20);
data/bitstormlite-0.2q/src/UDPTracker.cpp:257: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(pkg.peer_id,  _trackerManager->getBTTask()->getPeerID().c_str(), 20);
data/bitstormlite-0.2q/src/UDPTracker.cpp:320: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 ipBuf[256];
data/bitstormlite-0.2q/src/UPnpNat.cpp:328: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[1024];
data/bitstormlite-0.2q/src/UPnpNat.cpp:381: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 str[1024];
data/bitstormlite-0.2q/src/UPnpNat.cpp:683: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[1024];
data/bitstormlite-0.2q/src/bdict.h:117: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/bitstormlite-0.2q/src/bdict.h:124:4:  [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(buf,"%u",iter->first.length());
data/bitstormlite-0.2q/src/binteger.h:81: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[1024];
data/bitstormlite-0.2q/src/binteger.h:83: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(buf,"i%llde",m_value);
data/bitstormlite-0.2q/src/bstring.h:60:24:  [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).
			unsigned int strLen=atoi(temp);
data/bitstormlite-0.2q/src/bstring.h:72: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/bitstormlite-0.2q/src/bstring.h:74: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(buf,"%u:",m_value.length());
data/bitstormlite-0.2q/src/gettext.h:195: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 msg_ctxt_id[msgctxt_len + msgid_len];
data/bitstormlite-0.2q/src/gettext.h:197: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[1024];
data/bitstormlite-0.2q/src/gettext.h:205: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.
      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
data/bitstormlite-0.2q/src/gettext.h:207: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.
      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
data/bitstormlite-0.2q/src/gettext.h:241: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 msg_ctxt_id[msgctxt_len + msgid_len];
data/bitstormlite-0.2q/src/gettext.h:243: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[1024];
data/bitstormlite-0.2q/src/gettext.h:251: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.
      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
data/bitstormlite-0.2q/src/gettext.h:253: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.
      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
data/bitstormlite-0.2q/src/sha1.cpp:111: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(((unsigned char *) ctx->wbuf) + pos, sp, freeb);
data/bitstormlite-0.2q/src/sha1.cpp:119: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(((unsigned char *) ctx->wbuf) + pos, sp, length);
data/bitstormlite-0.2q/src/sha1.cpp:175:60:  [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.
void sha1_block(const void * data, size_t length, unsigned char output[20])
data/bitstormlite-0.2q/src/sha1.h:25:59:  [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.
void sha1_block(const void* data, size_t length, unsigned char output[20]); 
data/bitstormlite-0.2q/src/utils.h:132:25:  [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=(unsigned short)atoi(str_port.c_str());
data/bitstormlite-0.2q/src/utils.h:159:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char buf[20];
data/bitstormlite-0.2q/src/utils.h:251: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[128];
data/bitstormlite-0.2q/src/utils.h:255: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(buf, "%u sec", second);
data/bitstormlite-0.2q/src/utils.h:263: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(buf, "%u min %u sec", min, sec);
data/bitstormlite-0.2q/src/utils.h:270: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(buf, "%u hou %u min %u sec", hou, min, sec);
data/bitstormlite-0.2q/src/utils.h:276: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[128];
data/bitstormlite-0.2q/src/utils.h:280: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(buf, "%d B", (int)count);
data/bitstormlite-0.2q/src/utils.h:287: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(buf, "%01.2f KB", fcount);
data/bitstormlite-0.2q/src/utils.h:294: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(buf, "%01.2f MB", fcount);
data/bitstormlite-0.2q/src/utils.h:299: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(buf, "%01.2f GB", fcount);
data/bitstormlite-0.2q/src/utils.h:327: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[128];
data/bitstormlite-0.2q/src/PeerLink.cpp:458:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
	strncpy(buf+1, "BitTorrent protocol", 19);
data/bitstormlite-0.2q/src/PeerLink.cpp:460:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buf+28, (const char*)_manager->getBTTask()->getTorrentFile()->getInfoHash(), 20);
data/bitstormlite-0.2q/src/PeerLink.cpp:461:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buf+48, (const char*)_manager->getBTTask()->getPeerID().c_str(), 20);
data/bitstormlite-0.2q/src/Storage.cpp:170:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				int ret = fgetc(stream);
data/bitstormlite-0.2q/src/Storage.cpp:609:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		readlen = read(sFileInfo.handle, buf+len-left, readlen);
data/bitstormlite-0.2q/src/TorrentFile.cpp:142:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret=read(fd,buf,sizeof(buf));
data/bitstormlite-0.2q/src/TrackerManager.cpp:193: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(100*1000);
data/bitstormlite-0.2q/src/UPnpNat.cpp:191:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if(g_strstr_len(buf, strlen(buf), HTTP_OK) == NULL)
data/bitstormlite-0.2q/src/UPnpNat.cpp:196:39:  [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((startDescURL = g_strstr_len(buf, strlen(buf), "http://")) == NULL)
data/bitstormlite-0.2q/src/UPnpNat.cpp:201:42:  [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).
	endDescURL = g_strstr_len(startDescURL, strlen(startDescURL), "\r");
data/bitstormlite-0.2q/src/UPnpNat.cpp:204:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		endDescURL = g_strstr_len(startDescURL, strlen(startDescURL), "\n");
data/bitstormlite-0.2q/src/UPnpNat.cpp:443:35:  [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).
   send(getHandle(), httpRequest, strlen(httpRequest), 0);
data/bitstormlite-0.2q/src/UPnpNat.cpp:464: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(g_strstr_len(httpResponse, strlen(httpResponse), HTTP_OK) == NULL)
data/bitstormlite-0.2q/src/UPnpNat.cpp:470:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if((xmlRoot = g_strstr_len(httpResponse, strlen(httpResponse), "<root")) == NULL)
data/bitstormlite-0.2q/src/UPnpNat.cpp:785: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).
					strlen(soapMessage));
data/bitstormlite-0.2q/src/UPnpNat.cpp:789:48:  [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 ret = send(getHandle(), totalSendMessage, strlen(totalSendMessage), 0);	
data/bitstormlite-0.2q/src/UPnpNat.cpp:791:24:  [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).
	LOG_DEBUG("msg len="<<strlen(totalSendMessage)<<" send return "<<ret);
data/bitstormlite-0.2q/src/binteger.h:68:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
					strncpy(temp,&buf[1],i-1);
data/bitstormlite-0.2q/src/bstring.h:58:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(temp,buf,i);
data/bitstormlite-0.2q/src/gettext.h:191:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t msgctxt_len = strlen (msgctxt) + 1;
data/bitstormlite-0.2q/src/gettext.h:192:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t msgid_len = strlen (msgid) + 1;
data/bitstormlite-0.2q/src/gettext.h:237:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t msgctxt_len = strlen (msgctxt) + 1;
data/bitstormlite-0.2q/src/gettext.h:238:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t msgid_len = strlen (msgid) + 1;
data/bitstormlite-0.2q/src/utils.h:340:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t len = strlen(input_text);
data/bitstormlite-0.2q/src/utils.h:367:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t len = strlen(input_text);
data/bitstormlite-0.2q/src/xmlnode.cpp:95:37:  [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).
	real_size = size == (size_t(-1)) ? strlen(data) : size;
data/bitstormlite-0.2q/src/xmlnode.cpp:399:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t real_size = size == (size_t(-1)) ? strlen(str) : size;

ANALYSIS SUMMARY:

Hits = 97
Lines analyzed = 11943 in approximately 0.29 seconds (41490 lines/second)
Physical Source Lines of Code (SLOC) = 8688
Hits@level = [0]   6 [1]  27 [2]  64 [3]   1 [4]   5 [5]   0
Hits@level+ = [0+] 103 [1+]  97 [2+]  70 [3+]   6 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 11.8554 [1+] 11.1648 [2+] 8.05709 [3+] 0.690608 [4+] 0.575506 [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.