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/driftnet-1.3.0+dfsg/src/common/log.c
Examining data/driftnet-1.3.0+dfsg/src/common/log.h
Examining data/driftnet-1.3.0+dfsg/src/common/tmpdir.c
Examining data/driftnet-1.3.0+dfsg/src/common/tmpdir.h
Examining data/driftnet-1.3.0+dfsg/src/common/util.c
Examining data/driftnet-1.3.0+dfsg/src/common/util.h
Examining data/driftnet-1.3.0+dfsg/src/compat/compat.h
Examining data/driftnet-1.3.0+dfsg/src/display/display.c
Examining data/driftnet-1.3.0+dfsg/src/display/display.h
Examining data/driftnet-1.3.0+dfsg/src/display/gif.c
Examining data/driftnet-1.3.0+dfsg/src/display/img.c
Examining data/driftnet-1.3.0+dfsg/src/display/img.h
Examining data/driftnet-1.3.0+dfsg/src/display/jpeg.c
Examining data/driftnet-1.3.0+dfsg/src/display/png.c
Examining data/driftnet-1.3.0+dfsg/src/driftnet.c
Examining data/driftnet-1.3.0+dfsg/src/driftnet.h
Examining data/driftnet-1.3.0+dfsg/src/http_display/httpd.c
Examining data/driftnet-1.3.0+dfsg/src/http_display/httpd.h
Examining data/driftnet-1.3.0+dfsg/src/http_display/web_data.h
Examining data/driftnet-1.3.0+dfsg/src/media/audio.c
Examining data/driftnet-1.3.0+dfsg/src/media/audio.h
Examining data/driftnet-1.3.0+dfsg/src/media/http.c
Examining data/driftnet-1.3.0+dfsg/src/media/http.h
Examining data/driftnet-1.3.0+dfsg/src/media/image.c
Examining data/driftnet-1.3.0+dfsg/src/media/image.h
Examining data/driftnet-1.3.0+dfsg/src/media/media.c
Examining data/driftnet-1.3.0+dfsg/src/media/media.h
Examining data/driftnet-1.3.0+dfsg/src/media/mpeghdr.c
Examining data/driftnet-1.3.0+dfsg/src/media/mpeghdr.h
Examining data/driftnet-1.3.0+dfsg/src/media/playaudio.c
Examining data/driftnet-1.3.0+dfsg/src/media/playaudio.h
Examining data/driftnet-1.3.0+dfsg/src/media/pngformat.h
Examining data/driftnet-1.3.0+dfsg/src/media/tests/test_unit.c
Examining data/driftnet-1.3.0+dfsg/src/network/connection.c
Examining data/driftnet-1.3.0+dfsg/src/network/connection.h
Examining data/driftnet-1.3.0+dfsg/src/network/layer2.c
Examining data/driftnet-1.3.0+dfsg/src/network/layer2.h
Examining data/driftnet-1.3.0+dfsg/src/network/layer3.c
Examining data/driftnet-1.3.0+dfsg/src/network/layer3.h
Examining data/driftnet-1.3.0+dfsg/src/network/network.h
Examining data/driftnet-1.3.0+dfsg/src/network/pcap_engine.c
Examining data/driftnet-1.3.0+dfsg/src/network/pcap_engine.h
Examining data/driftnet-1.3.0+dfsg/src/options.c
Examining data/driftnet-1.3.0+dfsg/src/options.h
Examining data/driftnet-1.3.0+dfsg/src/pid.c
Examining data/driftnet-1.3.0+dfsg/src/pid.h
Examining data/driftnet-1.3.0+dfsg/src/uid.c
Examining data/driftnet-1.3.0+dfsg/src/uid.h

FINAL RESULTS:

data/driftnet-1.3.0+dfsg/src/common/log.c:53:13:  [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.
        n = vsnprintf(msg, size, fmt, ap);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:95:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(name, TEMPFILE_PREFIX"%08x%08x.%s", (unsigned int)time(NULL), rand(), extension);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:117:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    n = snprintf(template, len, "%s"TEMPLATE_FILENAME, sys_tmpdir);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:179:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
					sprintf(buf, "%s/%s", tmpdir.path, de->d_name);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:211:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    } else if (access(dir, R_OK | W_OK) != 0) {
data/driftnet-1.3.0+dfsg/src/common/util.c:82: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(t, s);
data/driftnet-1.3.0+dfsg/src/display/display.c:256:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(name, "%s%d%s", savedimg_prefix, num++, strrchr(ir->filename, '.'));
data/driftnet-1.3.0+dfsg/src/display/display.c:351:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(path, "%s/%s", get_tmpdir(), name);
data/driftnet-1.3.0+dfsg/src/media/playaudio.c:185:17:  [4] (shell) execl:
  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.
                execl("/bin/sh", "/bin/sh", "-c", audio_mpeg_player, NULL);
data/driftnet-1.3.0+dfsg/src/options.c:173:17:  [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(options.filterexpr, *a);
data/driftnet-1.3.0+dfsg/src/pid.c:55:5:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    snprintf(template, len, "%s"PID_FILENAME_WINDOWS, sys_tmpdir);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:83:17:  [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 (!(systmp = getenv("TMPDIR")))
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:84:18:  [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 (!(systmp = getenv("TEMP")))
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:85:28:  [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 (!(systmp = getenv("TMP")))
data/driftnet-1.3.0+dfsg/src/options.c:50:17:  [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, optstring)) != -1) {
data/driftnet-1.3.0+dfsg/src/common/log.c:92:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char time_s[80];
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:93:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char name[TMPNAMELEN] = {0};
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:232:11:  [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).
    fd1 = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0666);
data/driftnet-1.3.0+dfsg/src/display/display.c:168: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(*row1, *row2, width * sizeof(pel));
data/driftnet-1.3.0+dfsg/src/display/display.c:248: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/driftnet-1.3.0+dfsg/src/display/display.c:260:11:  [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).
    fd1 = open(ir->filename, O_RDONLY);
data/driftnet-1.3.0+dfsg/src/display/display.c:266:11:  [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).
    fd2 = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666);
data/driftnet-1.3.0+dfsg/src/display/display.c:336: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 name[TMPNAMELEN];
data/driftnet-1.3.0+dfsg/src/display/img.c:163: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).
    I->fp = fopen(name, "rb");
data/driftnet-1.3.0+dfsg/src/display/img.c:231: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(dest->data[y2] + dx, src->data[y] + sx, w * sizeof(pel));
data/driftnet-1.3.0+dfsg/src/display/png.c:39: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 sig[PNG_SIG_LEN];
data/driftnet-1.3.0+dfsg/src/driftnet.c:186: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(url, "%.*s", pathlen, path);
data/driftnet-1.3.0+dfsg/src/driftnet.c:203: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(url, "http://%.*s%.*s", hostlen, host, pathlen, path);
data/driftnet-1.3.0+dfsg/src/http_display/httpd.c:237: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((char *)amsg.payload + LWS_PRE, text, text_len);
data/driftnet-1.3.0+dfsg/src/media/image.c:177: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 length[2];
data/driftnet-1.3.0+dfsg/src/media/image.c:289: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 *end_data, *data, chunk_code[PNG_CODE_LEN + 1];
data/driftnet-1.3.0+dfsg/src/media/image.c:298: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(&chunk, data, sizeof chunk);
data/driftnet-1.3.0+dfsg/src/media/image.c:301: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(chunk_code, chunk.code, PNG_CODE_LEN);
data/driftnet-1.3.0+dfsg/src/media/image.c:348: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 buf[262144];
data/driftnet-1.3.0+dfsg/src/media/image.c:353:18:  [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 fd = open(*a, O_RDONLY);
data/driftnet-1.3.0+dfsg/src/media/mpeghdr.c:154: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], *p;
data/driftnet-1.3.0+dfsg/src/media/playaudio.c:68: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(A->data, data, len);
data/driftnet-1.3.0+dfsg/src/media/pngformat.h:24:13:  [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 code[PNG_CODE_LEN];
data/driftnet-1.3.0+dfsg/src/media/tests/test_unit.c:119:11:  [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).
    fd1 = open(file_path, O_RDONLY, 0666);
data/driftnet-1.3.0+dfsg/src/network/connection.c:102:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buf[CONNECTION_STRING_LEN];
data/driftnet-1.3.0+dfsg/src/network/connection.c:198:2:  [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->src, src, sizeof(struct sockaddr_storage));
data/driftnet-1.3.0+dfsg/src/network/connection.c:199:2:  [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->dst, dst, sizeof(struct sockaddr_storage));
data/driftnet-1.3.0+dfsg/src/network/connection.c:244:2:  [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->data + off, data, len);
data/driftnet-1.3.0+dfsg/src/network/layer2.c:40:11:  [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   h_dest[ETH_ALEN];
data/driftnet-1.3.0+dfsg/src/network/layer2.c:41:11:  [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   h_source[ETH_ALEN];
data/driftnet-1.3.0+dfsg/src/network/layer3.c:41:4:  [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(tcp, pkt + *offset, sizeof(struct tcphdr));
data/driftnet-1.3.0+dfsg/src/network/layer3.c:75: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(&ps->sin_addr.s_addr, &ip->ip_src, sizeof(struct in_addr));
data/driftnet-1.3.0+dfsg/src/network/layer3.c:79: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(&pd->sin_addr.s_addr, &ip->ip_dst, sizeof(struct in_addr));
data/driftnet-1.3.0+dfsg/src/network/layer3.c:103: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(&ps->sin6_addr, &ip6->ip6_src, sizeof(struct in6_addr));
data/driftnet-1.3.0+dfsg/src/network/layer3.c:107: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(&pd->sin6_addr, &ip6->ip6_dst, sizeof(struct in6_addr));
data/driftnet-1.3.0+dfsg/src/network/pcap_engine.c:70: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 errbuf[PCAP_ERRBUF_SIZE];
data/driftnet-1.3.0+dfsg/src/network/pcap_engine.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 ebuf[PCAP_ERRBUF_SIZE];
data/driftnet-1.3.0+dfsg/src/network/pcap_engine.c:107: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 ebuf[PCAP_ERRBUF_SIZE];
data/driftnet-1.3.0+dfsg/src/network/pcap_engine.c:195: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 ebuf[PCAP_ERRBUF_SIZE];
data/driftnet-1.3.0+dfsg/src/options.c:97:40:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                options.max_tmpfiles = atoi(optarg);
data/driftnet-1.3.0+dfsg/src/options.c:146:44:  [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).
                options.http_server_port = atoi(optarg);
data/driftnet-1.3.0+dfsg/src/options.c:171:13:  [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(options.filterexpr, "tcp and (");
data/driftnet-1.3.0+dfsg/src/pid.c:64: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[PID_BUFSIZE];
data/driftnet-1.3.0+dfsg/src/pid.c:71:18:  [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).
    pidfile_fd = open(pid_filepath, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:111: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).
    len  = strlen(sys_tmpdir);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:112: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).
    len += strlen(TEMPLATE_FILENAME);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:172:27:  [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).
			buf = xmalloc(buflen = strlen(tmpdir.path) + 64);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:176:19:  [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 (buflen < strlen(tmpdir.path) + strlen(de->d_name) + 1)
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:176: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).
					if (buflen < strlen(tmpdir.path) + strlen(de->d_name) + 1)
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:177: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).
						buf = xrealloc(buf, buflen = strlen(tmpdir.path) + strlen(de->d_name) + 64);
data/driftnet-1.3.0+dfsg/src/common/tmpdir.c:177:58:  [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).
						buf = xrealloc(buf, buflen = strlen(tmpdir.path) + strlen(de->d_name) + 64);
data/driftnet-1.3.0+dfsg/src/common/util.c:81:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    t = xmalloc(strlen(s) + 1);
data/driftnet-1.3.0+dfsg/src/common/util.c:112:5:  [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(microsecs); /* obsolete: POSIX.1-2001 */
data/driftnet-1.3.0+dfsg/src/common/util.c:125: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).
    len  = strlen(base);
data/driftnet-1.3.0+dfsg/src/common/util.c:126: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).
    len += strlen(filename);
data/driftnet-1.3.0+dfsg/src/display/display.c:253:24:  [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).
        name = xcalloc(strlen(savedimg_prefix) + 16, 1);
data/driftnet-1.3.0+dfsg/src/display/display.c:274:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((l = read(fd1, buf, sizeof buf)) > 0) {
data/driftnet-1.3.0+dfsg/src/display/display.c:323:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        l = read(fd, p, (char*)buf + len - p);
data/driftnet-1.3.0+dfsg/src/display/display.c:341:24:  [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).
        path = xmalloc(strlen(get_tmpdir()) + TMPNAMELEN);
data/driftnet-1.3.0+dfsg/src/display/img.c:176:53:  [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 (q = filedrvs[i].suffices; *q; q += strlen(q) + 1)
data/driftnet-1.3.0+dfsg/src/http_display/httpd.c:227: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).
    size_t text_len = strlen(text);
data/driftnet-1.3.0+dfsg/src/media/image.c:354:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        read(fd, buf + rand() % 256, 261000);
data/driftnet-1.3.0+dfsg/src/media/mpeghdr.c:156:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(0, buf, sizeof buf);
data/driftnet-1.3.0+dfsg/src/media/tests/test_unit.c:139:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if(read(fd1, image_data, file_len) < 0)
data/driftnet-1.3.0+dfsg/src/network/connection.c:111: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).
	len = strlen(buf);
data/driftnet-1.3.0+dfsg/src/network/connection.c:116: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).
	len = strlen(buf);
data/driftnet-1.3.0+dfsg/src/network/connection.c:150: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).
    plen = strlen(buf);
data/driftnet-1.3.0+dfsg/src/options.c:169:72:  [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 (a = argv + optind, l = sizeof("tcp and ()"); *a; l += strlen(*a) + 1, ++a);
data/driftnet-1.3.0+dfsg/src/options.c:174:31:  [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.
                if (*(a + 1)) strcat(options.filterexpr, " ");
data/driftnet-1.3.0+dfsg/src/options.c:176:13:  [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(options.filterexpr, ")");
data/driftnet-1.3.0+dfsg/src/pid.c:49: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).
    len  = strlen(sys_tmpdir);
data/driftnet-1.3.0+dfsg/src/pid.c:50: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).
    len += strlen(PID_FILENAME_WINDOWS);
data/driftnet-1.3.0+dfsg/src/pid.c:124:32:  [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 (write(pidfile_fd, buf, strlen(buf)) != strlen(buf)) {
data/driftnet-1.3.0+dfsg/src/pid.c:124:48:  [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 (write(pidfile_fd, buf, strlen(buf)) != strlen(buf)) {

ANALYSIS SUMMARY:

Hits = 89
Lines analyzed = 6724 in approximately 0.20 seconds (33073 lines/second)
Physical Source Lines of Code (SLOC) = 4063
Hits@level = [0]  22 [1]  30 [2]  44 [3]   4 [4]  11 [5]   0
Hits@level+ = [0+] 111 [1+]  89 [2+]  59 [3+]  15 [4+]  11 [5+]   0
Hits/KSLOC@level+ = [0+] 27.3197 [1+] 21.905 [2+] 14.5213 [3+] 3.69185 [4+] 2.70736 [5+]   0
Dot directories skipped = 2 (--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.