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/libshairport-1.2.1~git20120510.cbed0c1/src/alac.c
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.h
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport_private.h
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.h
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.h
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/alac.h
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c
Examining data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.c

FINAL RESULTS:

data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:51:3:  [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.
  vsnprintf(dbg, sizeof(dbg), format, args);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:198:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(tKnownHwid, arg+6);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:288:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(tHWID_Hex, tKnownHwid);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1156:5:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
    strcat(tName, pHWStr);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1161:5:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    execlp("avahi-publish-service", "avahi-publish-service", tName,
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1164:5:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    execlp("dns-sd", "dns-sd", "-R", tName,
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:266:3:  [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/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:270:5:  [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 ( time(NULL) );
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:279:24:  [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.
          int tVal = ((random() % 80) + 33);
data/libshairport-1.2.1~git20120510.cbed0c1/src/alac.c:443: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_out+1, error_buffer+1, (output_size-1) * 4);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:71:17:  [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 unsigned char aeskey[16], aesiv[16];
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:223: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).
        fmtp[i++] = atoi(arg);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:232: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 line[128];
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:309:27:  [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).
            controlport = atoi(*++argv);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:312:26:  [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).
            timingport = atoi(*++argv);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:315: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).
            dataport = atoi(*++argv);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:351:32:  [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).
            fancy_resampling = atoi(*++argv);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:398: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.
    unsigned char packet[MAX_PACKET];
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:401: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.
    unsigned char iv[16];
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:407: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(packet+i, buf+i, len & 0xf);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:473: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 packet[MAX_PACKET];
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:536: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 req[8];    // *not* a standard RTCP NACK
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:659: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(bq->a, a, 2*sizeof(double));
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:660: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(bq->b, b, 3*sizeof(double));
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:888:31:  [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).
                pipe_handle = open(pipename, O_WRONLY);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:48: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 dbg[2048];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:122: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 tPassword[56] = "";
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:123: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 tHWID[HWID_SIZE] = {0,51,52,53,54,55};
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:145: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 tHWID_Hex[HWID_SIZE * 2 + 1];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:146: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 tKnownHwid[32];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:150: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 tServerName[56] = "ShairPort";
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:179:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      tPort = atoi(*++argv);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:184:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      tPort = atoi(arg+14);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:188:39:  [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).
      __shairport_buffer_start_fill = atoi(*++argv);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:193:39:  [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).
      __shairport_buffer_start_fill = atoi(arg + 9);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:261:14:  [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).
      tIdx = open(DEVNULL, O_RDWR);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:283: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(tHWID_Hex+(tIdx*2), "%02X",tHWID[tIdx]);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:462: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 ipbin[INET6_ADDRSTRLEN];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:464: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 ipbin[INET_ADDRSTRLEN];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:468: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 ipstr[64];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:479: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(ipbin, &s->sin_addr, 4);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:488:18:  [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 bin[sizeof(struct sockaddr_in6)];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:490: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(&addr.s, &s->sin6_addr, sizeof(struct sockaddr_in6));
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:496: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(ipbin, &addr.bin[12], 4);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:502: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(ipbin, &s->sin6_addr, 16);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:573: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 tReadBuf[MAX_SIZE];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:686: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 tTrim[tFoundSize + 2];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:694: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.
    unsigned char tChalResp[38];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:696: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(tChalResp, tChallenge, tChallengeDecodeSize);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:699: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(tChalResp+tCurSize, pIpBin, pIpBinLen);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:702: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(tChalResp+tCurSize, pHWID, HWID_SIZE);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:719: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.
    unsigned char tTo[tSize];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:757:33:  [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 tContentSize = atoi(tContent);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:816:7:  [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 tEncodedAesIV[tSize + 2];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:823:7:  [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 tEncodedAesKey[tKeySize + 2]; // +1 for nl, +1 for \0
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:867: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 tPort[8] = "6000";  // get this from dup()'d stdout of child pid
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:876:7:  [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 tCPortStr[8] = "59010";
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:877:7:  [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 tTPortStr[8] = "59012";
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:886:26:  [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).
      int tControlport = atoi(tCPortStr);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:887: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).
      int tTimingport = atoi(tTPortStr);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:933:7:  [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 tFromHairtunes[80];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1011:22:  [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).
      iContentSize = atoi(tContent);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1025: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, pConn->recv.data + pConn->recv.marker, iContentSize);                                                                                                                                     
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1145: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 tName[100 + HWID_SIZE + 3];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1154: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 tPort[SERVLEN];
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1155: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(tPort, "%d", pPort);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1207: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(tTmpBuf, pBuf->data, pBuf->current);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1213: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(pBuf->data + pBuf->current, pNewBuf, pNofNewBuf);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1246: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(pTrimDest, pChar, pSize);
data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.c:159: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 tService[SERVLEN];
data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.c:160: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(tService, "%d", pPort); // copies port to string
data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.c:174: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 tAddr[INET6_ADDRSTRLEN];
data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.c:229: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(input, pInput, pLength);
data/libshairport-1.2.1~git20120510.cbed0c1/src/socketlib.c:273: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(buff, bptr->data, bptr->length-1);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:237:13:  [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(line);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:239: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).
            in_line = strlen(line) - 1;
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:454:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        abuf = audio_buffer + BUFIDX(read);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:456:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            rtp_request_resend(read, read);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:456:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            rtp_request_resend(read, read);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:732:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    seq_t read;
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:761:55:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    volatile abuf_t *curframe = audio_buffer + BUFIDX(read);
data/libshairport-1.2.1~git20120510.cbed0c1/src/hairtunes.c:849:21:  [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(30000);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:161:8:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
       strncpy(tServerName, *++argv, 55);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:166:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(tServerName, arg+9, 55);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:170:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(tPassword, *++argv, 55);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:175:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(tPassword, arg+11, 55);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:297:45:  [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).
  __shairport_xprintf("HWID_Hex(%d): %s\n", strlen(tHWID_Hex), tHWID_Hex);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:420:14:  [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 tLen = strlen(tReadBuf);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:574:3:  [1] (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 character.
  strcpy(tReadBuf, "");
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:583:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      tRetval = read(pSock, tReadBuf, MAX_SIZE);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:630:16:  [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).
    tFound += (strlen(pField) + pLenAfterField);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:688:83:  [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).
    __shairport_xprintf("HeaderChallenge:  [%s] len: %d  sizeFound: %d\n", tTrim, strlen(tTrim), tFoundSize);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:724:16:  [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 tLen = strlen(tResponse);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:818:96:  [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).
      __shairport_xprintf("AESIV: [%.*s] Size: %d  Strlen: %d\n", tSize, tEncodedAesIV, tSize, strlen(tEncodedAesIV));
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:825:93:  [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).
      __shairport_xprintf("AES KEY: [%s] Size: %d  Strlen: %d\n", tEncodedAesKey, tKeySize, strlen(tEncodedAesKey));
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:934:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int tRead = read(tComms->out[0], tFromHairtunes, 80);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1146: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(pServerName) > tMaxServerName)
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1157:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(tName, "@");
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1158:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
    strncat(tName, pServerName, tMaxServerName);
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1194:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  addNToShairBuffer(pBuf, pNewBuf, strlen(pNewBuf));
data/libshairport-1.2.1~git20120510.cbed0c1/src/shairport.c:1299:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if(strlen(pPassword) >0)

ANALYSIS SUMMARY:

Hits = 101
Lines analyzed = 4027 in approximately 0.12 seconds (33749 lines/second)
Physical Source Lines of Code (SLOC) = 3124
Hits@level = [0]  44 [1]  27 [2]  65 [3]   3 [4]   6 [5]   0
Hits@level+ = [0+] 145 [1+] 101 [2+]  74 [3+]   9 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 46.4149 [1+] 32.3303 [2+] 23.6876 [3+] 2.88092 [4+] 1.92061 [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.