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/p8-platform-2.1.0.1+dfsg1/src/os.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/posix/os-socket.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/posix/os-threads.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/posix/os-types.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/sockets/cdevsocket.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/sockets/socket.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/sockets/tcp.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/threads/mutex.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/threads/threads.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/threads/atomics.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/buffer.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/timeutils.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/util.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/util/atomic.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/dlfcn-win32.cpp
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/dlfcn-win32.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/inttypes.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/os-socket.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/os-threads.cpp
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/os-threads.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/os-types.h
Examining data/p8-platform-2.1.0.1+dfsg1/src/windows/stdint.h

FINAL RESULTS:

data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1589:16:  [4] (buffer) vsprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    using std::vsprintf;
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1590:16:  [4] (buffer) vswprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    using std::vswprintf;
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1600:12:  [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.
    return vsnprintf(pA, nCount, pFmtA, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1604:12:  [4] (format) vswprintf:
  Potential format string problem (CWE-134). Make format string constant.
    return vswprintf(pW, nCount, pFmtW, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1623:12:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    return vsprintf(pA, pFmtA, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1651:16:  [4] (format) vswprintf:
  Potential format string problem (CWE-134). Make format string constant.
        return vswprintf(pW, nCount, pFmtW, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1659:16:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
        return vsprintf( (char *)pW, (char *)pFmtW, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1664:16:  [4] (format) vswprintf:
  Potential format string problem (CWE-134). Make format string constant.
        return vswprintf(pW, pFmtW, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1694:14:  [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.
      return vsnprintf(pA, nCount, pFmtA, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:1702:14:  [4] (format) vswprintf:
  Potential format string problem (CWE-134). Make format string constant.
      return vswprintf(pW, nCount, pFmtW, vl);
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:241:19:  [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.
    int nActual = vsnprintf(cstr, size, fmt, argCopy);
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:295:19:  [4] (format) vswprintf:
  Potential format string problem (CWE-134). Make format string constant.
    int nActual = vswprintf(cstr, size, fmt, argCopy);
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-types.h:88:9:  [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.
#ifndef snprintf
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-types.h:89:9:  [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.
#define snprintf _snprintf
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-types.h:89:18:  [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.
#define snprintf _snprintf
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:1061:5:  [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(time(NULL));
data/p8-platform-2.1.0.1+dfsg1/src/windows/dlfcn-win32.cpp:139:19:  [3] (misc) LoadLibraryEx:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
        hModule = LoadLibraryEx( (LPSTR) lpFileName, NULL,
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-threads.h:41:54:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
  #define MutexCreate(mutex)                       ::InitializeCriticalSection(mutex = new CRITICAL_SECTION)
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-threads.h:43:54:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  #define MutexLock(mutex)                         ::EnterCriticalSection(mutex)
data/p8-platform-2.1.0.1+dfsg1/src/posix/os-socket.h:276: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     service[33];
data/p8-platform-2.1.0.1+dfsg1/src/posix/os-socket.h:281: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(service, "%d", iPort);
data/p8-platform-2.1.0.1+dfsg1/src/sockets/cdevsocket.h:70:20:  [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).
        m_socket = open(m_strName.c_str(), O_RDWR );
data/p8-platform-2.1.0.1+dfsg1/src/util/StdString.h:815:7:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
      MultiByteToWideChar(acp, 0, pSrcA, nSrc, pDstW, nDst);
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:804: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(days[0].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:806: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(days[0].c_str())*100+atoi(days[1].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:806:38:  [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(days[0].c_str())*100+atoi(days[1].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:808: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(days[0].c_str())*10000+atoi(days[1].c_str())*100+atoi(days[2].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:808:40:  [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(days[0].c_str())*10000+atoi(days[1].c_str())*100+atoi(days[2].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:808:66:  [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(days[0].c_str())*10000+atoi(days[1].c_str())*100+atoi(days[2].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:820:17:  [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 60 * atoi(strCopy.c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:829:21:  [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).
      timeInSecs += atoi(secs[i].c_str());
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:1053: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 UuidStrTmp[40];
data/p8-platform-2.1.0.1+dfsg1/src/windows/dlfcn-win32.cpp:70: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 last_name[MAX_PATH];
data/p8-platform-2.1.0.1+dfsg1/src/windows/dlfcn-win32.cpp:116: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.
        char lpFileName[MAX_PATH];
data/p8-platform-2.1.0.1+dfsg1/src/windows/dlfcn-win32.cpp:231: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.
    static char lpBuffer[65535];
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-socket.h:229: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     service[33];
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-socket.h:234: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(service, "%d", iPort);
data/p8-platform-2.1.0.1+dfsg1/src/posix/os-socket.h:156:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      returnv = read(socket, (char*)data + iBytesRead, len - iBytesRead);
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:611: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).
  size_t len2 = strlen(s2);
data/p8-platform-2.1.0.1+dfsg1/src/util/StringUtils.cpp:635: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).
  size_t len2 = strlen(s2);
data/p8-platform-2.1.0.1+dfsg1/src/util/timeutils.h:54:11:  [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.
  #define usleep(t) Sleep((DWORD)(t)/1000)
data/p8-platform-2.1.0.1+dfsg1/src/windows/os-types.h:56:16:  [1] (buffer) wcslen:
  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).
#define WcsLen wcslen

ANALYSIS SUMMARY:

Hits = 42
Lines analyzed = 9701 in approximately 0.30 seconds (31949 lines/second)
Physical Source Lines of Code (SLOC) = 6440
Hits@level = [0]   6 [1]   5 [2]  18 [3]   4 [4]  15 [5]   0
Hits@level+ = [0+]  48 [1+]  42 [2+]  37 [3+]  19 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 7.45342 [1+] 6.52174 [2+] 5.74534 [3+] 2.95031 [4+] 2.32919 [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.