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/rtaudio-5.1.0~ds1/RtAudio.cpp
Examining data/rtaudio-5.1.0~ds1/RtAudio.h
Examining data/rtaudio-5.1.0~ds1/contrib/go/rtaudio/rtaudio_stub.cpp
Examining data/rtaudio-5.1.0~ds1/contrib/go/rtaudio/rtaudio_stub.h
Examining data/rtaudio-5.1.0~ds1/contrib/python/pyrtaudio/rtaudiomodule.cpp
Examining data/rtaudio-5.1.0~ds1/rtaudio_c.cpp
Examining data/rtaudio-5.1.0~ds1/rtaudio_c.h
Examining data/rtaudio-5.1.0~ds1/tests/apinames.cpp
Examining data/rtaudio-5.1.0~ds1/tests/audioprobe.cpp
Examining data/rtaudio-5.1.0~ds1/tests/duplex.cpp
Examining data/rtaudio-5.1.0~ds1/tests/playraw.cpp
Examining data/rtaudio-5.1.0~ds1/tests/playsaw.cpp
Examining data/rtaudio-5.1.0~ds1/tests/record.cpp
Examining data/rtaudio-5.1.0~ds1/tests/testall.cpp
Examining data/rtaudio-5.1.0~ds1/tests/teststops.cpp

FINAL RESULTS:

data/rtaudio-5.1.0~ds1/RtAudio.cpp:7470:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf( name, "hw:%s,%d", cardname, subdevice );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:60:31:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
  #define MUTEX_INITIALIZE(A) InitializeCriticalSection(A)
data/rtaudio-5.1.0~ds1/RtAudio.cpp:62:31:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  #define MUTEX_LOCK(A)       EnterCriticalSection(A)
data/rtaudio-5.1.0~ds1/RtAudio.cpp:4963:21:  [3] (misc) LoadLibrary:
  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 AvrtDll = LoadLibrary( (LPCTSTR) "AVRT.dll" );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:1734:9:  [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( outBufferList->mBuffers[handle->iStream[0]].mData,
data/rtaudio-5.1.0~ds1/RtAudio.cpp:1749:11:  [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( outBufferList->mBuffers[handle->iStream[0]+i].mData,
data/rtaudio-5.1.0~ds1/RtAudio.cpp:1827:9:  [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( stream_.userBuffer[1],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:1839:11:  [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( (void *)&outBuffer[i*stream_.bufferSize],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2045:15:  [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.
      port = (char *) ports[ nChannels ];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2084:15:  [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.
      port = (char *) ports[ nPorts ];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2240:15:  [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.
      port = (char *) ports[ nPorts ];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2408: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 label[64];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2705:9:  [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( jackbuffer, &stream_.deviceBuffer[i*bufferBytes], bufferBytes );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2711:9:  [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( jackbuffer, &stream_.userBuffer[0][i*bufferBytes], bufferBytes );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2727:9:  [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( &stream_.deviceBuffer[i*bufferBytes], jackbuffer, bufferBytes );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2734:9:  [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( &stream_.userBuffer[1][i*bufferBytes], jackbuffer, bufferBytes );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2851: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 driverName[32];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:2971: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 driverName[32];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3560:11:  [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( handle->bufferInfos[i].buffers[bufferIndex],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3574:11:  [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( handle->bufferInfos[i].buffers[bufferIndex],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3596:11:  [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( &stream_.deviceBuffer[j++*bufferBytes],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3611:11:  [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( &stream_.userBuffer[1][bufferBytes*j++],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3862:9:  [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( &( ( char* ) buffer_ )[inIndex_], buffer, fromInSize * sizeof( char ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3863:9:  [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( buffer_, &( ( char* ) buffer )[fromInSize], fromZeroSize * sizeof( char ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3866:9:  [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( &( ( short* ) buffer_ )[inIndex_], buffer, fromInSize * sizeof( short ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3867:9:  [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( buffer_, &( ( short* ) buffer )[fromInSize], fromZeroSize * sizeof( short ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3870:9:  [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( &( ( S24* ) buffer_ )[inIndex_], buffer, fromInSize * sizeof( S24 ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3871:9:  [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( buffer_, &( ( S24* ) buffer )[fromInSize], fromZeroSize * sizeof( S24 ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3874:9:  [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( &( ( int* ) buffer_ )[inIndex_], buffer, fromInSize * sizeof( int ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3875:9:  [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( buffer_, &( ( int* ) buffer )[fromInSize], fromZeroSize * sizeof( int ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3878:9:  [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( &( ( float* ) buffer_ )[inIndex_], buffer, fromInSize * sizeof( float ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3879:9:  [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( buffer_, &( ( float* ) buffer )[fromInSize], fromZeroSize * sizeof( float ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3882:9:  [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( &( ( double* ) buffer_ )[inIndex_], buffer, fromInSize * sizeof( double ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3883:9:  [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( buffer_, &( ( double* ) buffer )[fromInSize], fromZeroSize * sizeof( double ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3924:9:  [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( buffer, &( ( char* ) buffer_ )[outIndex_], fromOutSize * sizeof( char ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3925:9:  [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( &( ( char* ) buffer )[fromOutSize], buffer_, fromZeroSize * sizeof( char ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3928:9:  [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( buffer, &( ( short* ) buffer_ )[outIndex_], fromOutSize * sizeof( short ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3929:9:  [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( &( ( short* ) buffer )[fromOutSize], buffer_, fromZeroSize * sizeof( short ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3932:9:  [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( buffer, &( ( S24* ) buffer_ )[outIndex_], fromOutSize * sizeof( S24 ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3933:9:  [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( &( ( S24* ) buffer )[fromOutSize], buffer_, fromZeroSize * sizeof( S24 ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3936:9:  [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( buffer, &( ( int* ) buffer_ )[outIndex_], fromOutSize * sizeof( int ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3937:9:  [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( &( ( int* ) buffer )[fromOutSize], buffer_, fromZeroSize * sizeof( int ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3940:9:  [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( buffer, &( ( float* ) buffer_ )[outIndex_], fromOutSize * sizeof( float ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3941:9:  [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( &( ( float* ) buffer )[fromOutSize], buffer_, fromZeroSize * sizeof( float ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3944:9:  [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( buffer, &( ( double* ) buffer_ )[outIndex_], fromOutSize * sizeof( double ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:3945:9:  [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( &( ( double* ) buffer )[fromOutSize], buffer_, fromZeroSize * sizeof( double ) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:4062: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( outBuffer, inBuffer, inputBufferSize );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:4078: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( rInByteBuffer, inBuffer, inputBufferSize );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:4130: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( outBuffer, rOutByteBuffer, rBytes );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:5222:13:  [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( stream_.userBuffer[INPUT],
data/rtaudio-5.1.0~ds1/RtAudio.cpp:5308:11:  [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( stream_.deviceBuffer,
data/rtaudio-5.1.0~ds1/RtAudio.cpp:6796:5:  [2] (buffer) CopyMemory:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    CopyMemory( buffer1, buffer, bufferSize1 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:6797:28:  [2] (buffer) CopyMemory:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    if ( buffer2 != NULL ) CopyMemory( buffer2, buffer+bufferSize1, bufferSize2 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:6925:7:  [2] (buffer) CopyMemory:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      CopyMemory( buffer, buffer1, bufferSize1 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:6926:30:  [2] (buffer) CopyMemory:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      if ( buffer2 != NULL ) CopyMemory( buffer+bufferSize1, buffer2, bufferSize2 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7148: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 name[64];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7155: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( name, "hw:%d", card );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7199: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 name[64];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7207: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( name, "hw:%d", card );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7227: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.
        sprintf( name, "hw:%d,%d", card, subdevice );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7241:7:  [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( name, "default" );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7506: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 name[64];
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7516:7:  [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( name, "hw:%d", card );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7529:11:  [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( name, "hw:%d,%d", card, subdevice );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:7542: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.
        strcpy( name, "default" );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:8998:17:  [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 mixerfd = open( "/dev/mixer", O_RDWR, 0 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:9022:17:  [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 mixerfd = open( "/dev/mixer", O_RDWR, 0 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:9142:17:  [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 mixerfd = open( "/dev/mixer", O_RDWR, 0 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:9223:8:  [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( ainfo.devnode, flags, 0 );
data/rtaudio-5.1.0~ds1/RtAudio.h:683: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.
  unsigned char c3[3];
data/rtaudio-5.1.0~ds1/RtAudio.h:780: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 *userBuffer[2];       // Playback and record, respectively.
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:15: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 errmsg[MAX_ERROR_MESSAGE_LENGTH];
data/rtaudio-5.1.0~ds1/rtaudio_c.h:172: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 name[MAX_NAME_LENGTH];
data/rtaudio-5.1.0~ds1/rtaudio_c.h:189: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 name[MAX_NAME_LENGTH];
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:59: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( outputBuffer, inputBuffer, *bytes );
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:76:29:  [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).
  channels = (unsigned int) atoi(argv[1]);
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:77:23:  [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).
  fs = (unsigned int) atoi(argv[2]);
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:79:30:  [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).
    iDevice = (unsigned int) atoi(argv[3]);
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:81:30:  [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).
    oDevice = (unsigned int) atoi(argv[4]);
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:83:30:  [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).
    iOffset = (unsigned int) atoi(argv[5]);
data/rtaudio-5.1.0~ds1/tests/duplex.cpp:85:30:  [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).
    oOffset = (unsigned int) atoi(argv[6]);
data/rtaudio-5.1.0~ds1/tests/playraw.cpp:106:29:  [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).
  channels = (unsigned int) atoi( argv[1]) ;
data/rtaudio-5.1.0~ds1/tests/playraw.cpp:107:23:  [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).
  fs = (unsigned int) atoi( argv[2] );
data/rtaudio-5.1.0~ds1/tests/playraw.cpp:110:29:  [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).
    device = (unsigned int) atoi( argv[4] );
data/rtaudio-5.1.0~ds1/tests/playraw.cpp:112:29:  [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).
    offset = (unsigned int) atoi( argv[5] );
data/rtaudio-5.1.0~ds1/tests/playraw.cpp:115:13:  [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).
  data.fd = fopen( file, "rb" );
data/rtaudio-5.1.0~ds1/tests/playsaw.cpp:155:29:  [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).
  channels = (unsigned int) atoi( argv[1] );
data/rtaudio-5.1.0~ds1/tests/playsaw.cpp:156:23:  [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).
  fs = (unsigned int) atoi( argv[2] );
data/rtaudio-5.1.0~ds1/tests/playsaw.cpp:158:29:  [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).
    device = (unsigned int) atoi( argv[3] );
data/rtaudio-5.1.0~ds1/tests/playsaw.cpp:160:29:  [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).
    offset = (unsigned int) atoi( argv[4] );
data/rtaudio-5.1.0~ds1/tests/record.cpp:83: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( iData->buffer+offset, inputBuffer, iData->bufferBytes );
data/rtaudio-5.1.0~ds1/tests/record.cpp:105:29:  [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).
  channels = (unsigned int) atoi( argv[1] );
data/rtaudio-5.1.0~ds1/tests/record.cpp:106:23:  [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).
  fs = (unsigned int) atoi( argv[2] );
data/rtaudio-5.1.0~ds1/tests/record.cpp:110:29:  [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).
    device = (unsigned int) atoi( argv[4] );
data/rtaudio-5.1.0~ds1/tests/record.cpp:112:29:  [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).
    offset = (unsigned int) atoi( argv[5] );
data/rtaudio-5.1.0~ds1/tests/record.cpp:165:8:  [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).
  fd = fopen( "record.raw", "wb" );
data/rtaudio-5.1.0~ds1/tests/testall.cpp:90: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( outputBuffer, inputBuffer, *bytes );
data/rtaudio-5.1.0~ds1/tests/testall.cpp:108:29:  [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).
  channels = (unsigned int) atoi( argv[1] );
data/rtaudio-5.1.0~ds1/tests/testall.cpp:109:23:  [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).
  fs = (unsigned int) atoi( argv[2] );
data/rtaudio-5.1.0~ds1/tests/testall.cpp:111:30:  [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).
    iDevice = (unsigned int) atoi( argv[3] );
data/rtaudio-5.1.0~ds1/tests/testall.cpp:113:30:  [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).
    oDevice = (unsigned int) atoi(argv[4]);
data/rtaudio-5.1.0~ds1/tests/testall.cpp:115:30:  [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).
    iOffset = (unsigned int) atoi(argv[5]);
data/rtaudio-5.1.0~ds1/tests/testall.cpp:117:30:  [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).
    oOffset = (unsigned int) atoi(argv[6]);
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:96:36:  [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).
  mydata.channels = (unsigned int) atoi( argv[1] );
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:97:23:  [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).
  fs = (unsigned int) atoi( argv[2] );
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:99:30:  [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).
    iDevice = (unsigned int) atoi( argv[3] );
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:101:30:  [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).
    oDevice = (unsigned int) atoi(argv[4]);
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:103:30:  [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).
    iOffset = (unsigned int) atoi(argv[5]);
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:105:30:  [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).
    oOffset = (unsigned int) atoi(argv[6]);
data/rtaudio-5.1.0~ds1/RtAudio.cpp:706: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).
  info.name.append( (const char *)mname, strlen(mname) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:728:41:  [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).
  info.name.append( (const char *)name, strlen(name) );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:1177:7:  [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( 5000 );
data/rtaudio-5.1.0~ds1/RtAudio.cpp:9879:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    result = read( handle->id[1], buffer, samples * formatBytes(format) );
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:65:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:94:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(result.name, info.name.c_str(), sizeof(result.name) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:102:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:156:11:  [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(options->name) > 0) {
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:169:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:182:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:193:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:204:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:223:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:234:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:244:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/rtaudio_c.cpp:254:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(audio->errmsg, err.what(), sizeof(audio->errmsg) - 1);
data/rtaudio-5.1.0~ds1/tests/playraw.cpp:52:33:  [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 SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
data/rtaudio-5.1.0~ds1/tests/playsaw.cpp:49:33:  [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 SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
data/rtaudio-5.1.0~ds1/tests/record.cpp:46:33:  [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 SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
data/rtaudio-5.1.0~ds1/tests/teststops.cpp:29:33:  [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 SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )

ANALYSIS SUMMARY:

Hits = 129
Lines analyzed = 14450 in approximately 0.37 seconds (38989 lines/second)
Physical Source Lines of Code (SLOC) = 10515
Hits@level = [0]  19 [1]  20 [2] 105 [3]   3 [4]   1 [5]   0
Hits@level+ = [0+] 148 [1+] 129 [2+] 109 [3+]   4 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 14.0751 [1+] 12.2682 [2+] 10.3661 [3+] 0.380409 [4+] 0.0951022 [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.