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/proxycheck-0.49a/pxy.c
Examining data/proxycheck-0.49a/event.c
Examining data/proxycheck-0.49a/memmem.c
Examining data/proxycheck-0.49a/proxylogger.c
Examining data/proxycheck-0.49a/pxy.h
Examining data/proxycheck-0.49a/event.h
Examining data/proxycheck-0.49a/proxycheck.c

FINAL RESULTS:

data/proxycheck-0.49a/proxycheck.c:75:11:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  int l = sprintf(buf, "%s: ", progname);
data/proxycheck-0.49a/proxycheck.c:78:8:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
  l += vsprintf(buf + l, fmt, ap);
data/proxycheck-0.49a/proxycheck.c:81:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    l += sprintf(buf + l, ": %s\n", strerror(errno));
data/proxycheck-0.49a/proxycheck.c:95:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      len = sprintf(buf, "%s:%s:%d: ",
data/proxycheck-0.49a/proxycheck.c:100:12:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    len += vsprintf(buf + len, fmt, ap);
data/proxycheck-0.49a/proxycheck.c:114:16:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    bs = buf + sprintf(buf, "%s:%s:%d: %s ",
data/proxycheck-0.49a/proxycheck.c:225:11:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  int l = sprintf(buf, "%s: ", progname);
data/proxycheck-0.49a/proxycheck.c:228:8:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
  l += vsprintf(buf + l, fmt, ap);
data/proxycheck-0.49a/proxycheck.c:230:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  l += sprintf(buf + l, "\n%s: `%s -h' for help\n", progname, progname);
data/proxycheck-0.49a/proxycheck.c:717:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    int l = sprintf(buf, "%s %s:%d ",
data/proxycheck-0.49a/proxycheck.c:722:14:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        l += sprintf(buf + l, " %s", info);
data/proxycheck-0.49a/proxycheck.c:727:12:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      l += sprintf(buf + l, " [%s]", c->detail);
data/proxycheck-0.49a/proxycheck.c:809:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(pxybuf, "%s\r\n", sendstr) :
data/proxycheck-0.49a/proxycheck.c:810:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(pxybuf, "%s:%s:%d\r\n",
data/proxycheck-0.49a/proxycheck.c:860:3:  [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(pxyaddr, inet_ntoa(c->pxyaddr));
data/proxycheck-0.49a/proxycheck.c:861:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  l = sprintf(buf,
data/proxycheck-0.49a/proxycheck.c:876:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    l += sprintf(buf + l, "Proxy info: %s\r\n", c->detail);
data/proxycheck-0.49a/proxycheck.c:882:11:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  int l = sprintf(pxybuf,
data/proxycheck-0.49a/proxycheck.c:953:30:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      l = c->appstate == 1 ? sprintf(pxybuf, "MAIL FROM:<%s>\r\n", dsblfrom) :
data/proxycheck-0.49a/proxycheck.c:954:30:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
          c->appstate == 2 ? sprintf(pxybuf, "RCPT TO:<%s>\r\n", dsblrcpt) :
data/proxycheck-0.49a/proxycheck.c:1004:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(pxybuf, "%s:25", dstspec);
data/proxycheck-0.49a/proxycheck.c:1027:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    l = sprintf(pxybuf, "%s\n%s\n", dsbluser, dsblpass);
data/proxycheck-0.49a/proxycheck.c:1038: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(dsblcookie, arg);
data/proxycheck-0.49a/proxylogger.c:73:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    int l = sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d %s",
data/proxycheck-0.49a/proxylogger.c:78:12:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      l += sprintf(buf + l, " %s:%s:%d", proto, inet_ntoa(pxyaddr), pxyport);
data/proxycheck-0.49a/proxylogger.c:84:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    int l = sprintf(buf, "%s [%s]\r\n", saylast, inet_ntoa(peer.sin_addr));
data/proxycheck-0.49a/proxylogger.c:154:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  wl = sprintf(buf, "%s [%s]\r\n", say, inet_ntoa(peer.sin_addr));
data/proxycheck-0.49a/pxy.c:92:7:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
  l = vsprintf(pxybuf, fmt, ap);
data/proxycheck-0.49a/pxy.c:311:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    int l = sprintf(b,
data/proxycheck-0.49a/pxy.c:494:11:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      l = sprintf(pxybuf, "%s:%d\r\n", inet_ntoa(c->dstaddr), c->dstport);
data/proxycheck-0.49a/pxy.c:496:14:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        l += sprintf(pxybuf + l, "telnet %s %d\r\n",
data/proxycheck-0.49a/pxy.h:20:48:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
# define PRINTFLIKE(f,v) __attribute__((format(printf,f,v)))
data/proxycheck-0.49a/event.c:576:12:  [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.
  method = getenv("EV_METHOD");
data/proxycheck-0.49a/proxycheck.c:378:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((c = getopt(argc, argv, "vd:c:p:Db:t:m:M:i:nasxh")) != EOF)
data/proxycheck-0.49a/proxycheck.c:991:13:  [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 *v = getenv(name);
data/proxycheck-0.49a/proxycheck.c:1012:15:  [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.
  if (!(arg = getenv("DSBL_COOKIE"))) {
data/proxycheck-0.49a/proxylogger.c:134:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((l = getopt(argc, argv, "t:l:s:S:n")) != EOF)
data/proxycheck-0.49a/event.c:181: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).
  int dpfd = open("/dev/poll", O_RDWR);
data/proxycheck-0.49a/event.c:934: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[10];
data/proxycheck-0.49a/memmem.c:51:29:  [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.
    if (begin[0] == ((const char *) needle)[0] &&
data/proxycheck-0.49a/proxycheck.c:74:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[1024];
data/proxycheck-0.49a/proxycheck.c:91: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 buf[512];
data/proxycheck-0.49a/proxycheck.c:110: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 buf[90];
data/proxycheck-0.49a/proxycheck.c:130:17:  [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.
          bp += sprintf(bp, "\\%o", (unsigned char)*s);
data/proxycheck-0.49a/proxycheck.c:176: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(&a->s_addr, he->h_addr_list[0], 4);
data/proxycheck-0.49a/proxycheck.c:224: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[256];
data/proxycheck-0.49a/proxycheck.c:519: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 buf[8192];
data/proxycheck-0.49a/proxycheck.c:522:19:  [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).
    else if ((f = fopen(readin, "r")) == NULL)
data/proxycheck-0.49a/proxycheck.c:716: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 buf[8192]; /* do not use pxybuf due to info pointing to it */
data/proxycheck-0.49a/proxycheck.c:720:12:  [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.
      l += sprintf(buf + l, "open");
data/proxycheck-0.49a/proxycheck.c:725:12:  [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.
      l += sprintf(buf + l, "closed");
data/proxycheck-0.49a/proxycheck.c:854: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 dsblcookie[DSBL_COOKIE_LEN+1];
data/proxycheck-0.49a/proxycheck.c:858: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 pxyaddr[sizeof("255.255.255.255")];
data/proxycheck-0.49a/proxycheck.c:877:8:  [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.
  l += sprintf(buf + l, "DSBL END\r\n\r\n.\r\n");
data/proxycheck-0.49a/proxycheck.c:891:8:  [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.
  l += sprintf(pxybuf + l, "QUIT\r\n");
data/proxycheck-0.49a/proxycheck.c:955: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(pxybuf, "DATA\r\n");
data/proxycheck-0.49a/proxylogger.c:41:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char buf[2048];
data/proxycheck-0.49a/proxylogger.c:70:27:  [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).
  if (logfile && (logfd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0644)) > 0) {
data/proxycheck-0.49a/proxylogger.c:136: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).
    case 't': timeout = atoi(optarg); break;
data/proxycheck-0.49a/proxylogger.c:156: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(w, buf, wl);
data/proxycheck-0.49a/pxy.c:21:1:  [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 pxybuf[8193];
data/proxycheck-0.49a/pxy.c:133: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(pxybuf, c->buf->buf, l);
data/proxycheck-0.49a/pxy.c:162: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(c->buf->buf, buf, len);
data/proxycheck-0.49a/pxy.c:367: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(pxybuf+4, &c->dstaddr.s_addr, 4);
data/proxycheck-0.49a/pxy.c:368: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(pxybuf+8, &p, 2);
data/proxycheck-0.49a/pxy.c:409: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(pxybuf+2, &p, 2);
data/proxycheck-0.49a/pxy.c:410: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(pxybuf+4, &c->dstaddr.s_addr, 4);
data/proxycheck-0.49a/pxy.h:29:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[128-3*sizeof(unsigned)]; /* the buffer itself */
data/proxycheck-0.49a/pxy.h:32: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.
extern char pxybuf[8193];
data/proxycheck-0.49a/event.c:935:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int l = read(fd, buf, sizeof(buf));
data/proxycheck-0.49a/proxycheck.c:845:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!(expstr = arg) || !(explen = strlen(arg)))
data/proxycheck-0.49a/proxycheck.c:1035:12:  [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).
  else if (strlen(arg) != DSBL_COOKIE_LEN)
data/proxycheck-0.49a/proxylogger.c:167:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while((r = read(0, buf + l, sizeof(buf) - l - 1)) > 0) {
data/proxycheck-0.49a/pxy.c:108:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  l = read(c->fd, buf, l);
data/proxycheck-0.49a/pxy.c:174:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  for (e = buf + l - strlen(str); buf <= e; ++buf) {
data/proxycheck-0.49a/pxy.c:446:29:  [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 (memmem(buf, l, *sp, strlen(*sp)))

ANALYSIS SUMMARY:

Hits = 76
Lines analyzed = 3151 in approximately 0.10 seconds (30161 lines/second)
Physical Source Lines of Code (SLOC) = 2616
Hits@level = [0]  12 [1]   7 [2]  32 [3]   5 [4]  32 [5]   0
Hits@level+ = [0+]  88 [1+]  76 [2+]  69 [3+]  37 [4+]  32 [5+]   0
Hits/KSLOC@level+ = [0+] 33.6391 [1+] 29.052 [2+] 26.3761 [3+] 14.1437 [4+] 12.2324 [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.