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/monkeysphere-0.44/src/agent-transfer/main.c
Examining data/monkeysphere-0.44/src/agent-transfer/ssh-agent-proto.h

FINAL RESULTS:

data/monkeysphere-0.44/src/agent-transfer/main.c:121:9:  [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.
    if (execlp ("gpgconf", "gpgconf", "--list-dirs", "agent-socket", NULL)) {
data/monkeysphere-0.44/src/agent-transfer/main.c:770:15:  [4] (shell) system:
  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.
      int r = system ("gpgconf --launch gpg-agent");
data/monkeysphere-0.44/src/agent-transfer/main.c:409:11:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    val = getenv(env);
data/monkeysphere-0.44/src/agent-transfer/main.c:590:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  char *sock_name = getenv("SSH_AUTH_SOCK");
data/monkeysphere-0.44/src/agent-transfer/main.c:103:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[BUFSIZE];
data/monkeysphere-0.44/src/agent-transfer/main.c:252: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 (wknew + e->wrapped_len, data, data_sz);
data/monkeysphere-0.44/src/agent-transfer/main.c:475:34:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define w32(a) { tmp = htonl(a); memcpy(msgbuf + offset, &tmp, sizeof(tmp)); offset += sizeof(tmp); }
data/monkeysphere-0.44/src/agent-transfer/main.c:476:67:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define wstr(a) { slen = (a ? strlen (a) : 0); w32 (slen); if (a) memcpy (msgbuf + offset, a, slen); offset += slen; }
data/monkeysphere-0.44/src/agent-transfer/main.c:507: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 (msgbuf + offset, qdata+1, 32); offset += 32;
data/monkeysphere-0.44/src/agent-transfer/main.c:510: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 (msgbuf + offset, ddata, 32); offset += 32;
data/monkeysphere-0.44/src/agent-transfer/main.c:511: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 (msgbuf + offset, qdata+1, 32); offset += 32;
data/monkeysphere-0.44/src/agent-transfer/main.c:658: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).
        args->seconds = atoi (argv[ptr + 1]);
data/monkeysphere-0.44/src/agent-transfer/main.c:280: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).
    if ((sz != strlen (str)*8) || !data || \
data/monkeysphere-0.44/src/agent-transfer/main.c:281:28:  [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).
        memcmp (data, str, strlen(str)))   \
data/monkeysphere-0.44/src/agent-transfer/main.c:463:9:  [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).
    4 + strlen(key_type) + /* type of key */
data/monkeysphere-0.44/src/agent-transfer/main.c:465:20:  [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).
    4 + (comment ? strlen (comment) : 0) +
data/monkeysphere-0.44/src/agent-transfer/main.c:476:31:  [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).
#define wstr(a) { slen = (a ? strlen (a) : 0); w32 (slen); if (a) memcpy (msgbuf + offset, a, slen); offset += slen; }
data/monkeysphere-0.44/src/agent-transfer/main.c:530:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bytesread = read (fd, &tmp, sizeof (tmp));
data/monkeysphere-0.44/src/agent-transfer/main.c:540:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bytesread = read (fd, &resp, sizeof (resp));
data/monkeysphere-0.44/src/agent-transfer/main.c:597:7:  [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(sock_name) + 1 > sizeof(sockaddr.sun_path)) {
data/monkeysphere-0.44/src/agent-transfer/main.c:603:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(sockaddr.sun_path, sock_name, sizeof(sockaddr.sun_path) - 1);
data/monkeysphere-0.44/src/agent-transfer/main.c:667: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).
        if (strlen (argv[ptr]) != KEYGRIP_LENGTH) {

ANALYSIS SUMMARY:

Hits = 22
Lines analyzed = 921 in approximately 0.05 seconds (17973 lines/second)
Physical Source Lines of Code (SLOC) = 719
Hits@level = [0]  49 [1]  10 [2]   8 [3]   2 [4]   2 [5]   0
Hits@level+ = [0+]  71 [1+]  22 [2+]  12 [3+]   4 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 98.7483 [1+] 30.5981 [2+] 16.6898 [3+] 5.56328 [4+] 2.78164 [5+]   0
Dot directories skipped = 3 (--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.