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/tcpflow-1.5.2+repack1/src/scan_python.cpp Examining data/tcpflow-1.5.2+repack1/src/scan_netviz.cpp Examining data/tcpflow-1.5.2+repack1/src/datalink_wifi.h Examining data/tcpflow-1.5.2+repack1/src/util.cpp Examining data/tcpflow-1.5.2+repack1/src/hold/tcp_options.cpp Examining data/tcpflow-1.5.2+repack1/src/scan_tcpdemux.cpp Examining data/tcpflow-1.5.2+repack1/src/tcpdemux.h Examining data/tcpflow-1.5.2+repack1/src/mime_map.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/legend_view.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/address_histogram.h Examining data/tcpflow-1.5.2+repack1/src/netviz/plot_view.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/legend_view.h Examining data/tcpflow-1.5.2+repack1/src/netviz/time_histogram_view.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/net_map.h Examining data/tcpflow-1.5.2+repack1/src/netviz/time_histogram_view.h Examining data/tcpflow-1.5.2+repack1/src/netviz/port_histogram_view.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/address_histogram.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/port_histogram.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/address_histogram_view.h Examining data/tcpflow-1.5.2+repack1/src/netviz/plot_view.h Examining data/tcpflow-1.5.2+repack1/src/netviz/port_histogram_view.h Examining data/tcpflow-1.5.2+repack1/src/netviz/one_page_report.h Examining data/tcpflow-1.5.2+repack1/src/netviz/packetfall.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/packetfall.h Examining data/tcpflow-1.5.2+repack1/src/netviz/one_page_report.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/net_map.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/port_histogram.h Examining data/tcpflow-1.5.2+repack1/src/netviz/time_histogram.cpp Examining data/tcpflow-1.5.2+repack1/src/netviz/time_histogram.h Examining data/tcpflow-1.5.2+repack1/src/netviz/address_histogram_view.cpp Examining data/tcpflow-1.5.2+repack1/src/tcpip.h Examining data/tcpflow-1.5.2+repack1/src/scan_md5.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/ip6.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/util.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/ethertype.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/udp.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/llc.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/ether.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/ieee802_11_radio.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/cpack.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/cpack.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/prism.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/oui.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/tcp.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/icmp.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/types.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/radiotap.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/util.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap_tcpdemux.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/TimeVal.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/os.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/sample.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/arp.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/ip.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/extract.h Examining data/tcpflow-1.5.2+repack1/src/wifipcap/TimeVal.cpp Examining data/tcpflow-1.5.2+repack1/src/wifipcap/ipproto.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/sbuf_private.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/unicode_escape.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/utils.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/plugin.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/atomic_set_map.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/utf8.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/sbuf_stream.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/sbuf_stream.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/pcap_fake.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/bulk_extractor_i.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/histogram.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/beregex.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_set.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/utils.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/cppmutex.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/net_ethernet.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/word_and_context_list.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/word_and_context_list.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/histogram.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/unicode_escape.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/beregex.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/aftimer.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp Examining data/tcpflow-1.5.2+repack1/src/be13_api/pcap_fake.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/utf8/unchecked.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/utf8/checked.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/utf8/core.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_set.h Examining data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_sql.cpp Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_demo.cpp Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/cpu_info.c Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/iblkfind.cpp Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_reader.h Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/cppmutex.h Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/cpu_stat.cpp Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_reader.cpp Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/hash_t.h Examining data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp Examining data/tcpflow-1.5.2+repack1/src/tcpdemux.cpp Examining data/tcpflow-1.5.2+repack1/src/scan_wifiviz.cpp Examining data/tcpflow-1.5.2+repack1/src/iptree.h Examining data/tcpflow-1.5.2+repack1/src/stest.cpp Examining data/tcpflow-1.5.2+repack1/src/inet_ntop.h Examining data/tcpflow-1.5.2+repack1/src/radiotap_old.c Examining data/tcpflow-1.5.2+repack1/src/pcap_writer.h Examining data/tcpflow-1.5.2+repack1/src/flow.cpp Examining data/tcpflow-1.5.2+repack1/src/tcpflow.cpp Examining data/tcpflow-1.5.2+repack1/src/template_demo.cpp Examining data/tcpflow-1.5.2+repack1/src/mime_map.h Examining data/tcpflow-1.5.2+repack1/src/inet_ntop.c Examining data/tcpflow-1.5.2+repack1/src/datalink.cpp Examining data/tcpflow-1.5.2+repack1/src/tcpflow.h Examining data/tcpflow-1.5.2+repack1/src/datalink_wifi.cpp Examining data/tcpflow-1.5.2+repack1/src/tcpip.cpp Examining data/tcpflow-1.5.2+repack1/src/intrusive_list.h Examining data/tcpflow-1.5.2+repack1/src/scan_http.cpp FINAL RESULTS: data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:346:16: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if(chown(outfilename,pw->pw_uid,pw->pw_gid)){ data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:137: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. snprintf(buf,sizeof(buf),db_insert_stmt,name.c_str()); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:537:24: [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. void feature_recorder::printf(const char *fmt, ...) data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:546:5: [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(p.buf,maxsize,fmt,ap); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:893:9: [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. if (access(dirname2.c_str(),R_OK)!=0){ data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:908:9: [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. if (access(dirname2.c_str(),R_OK)!=0){ data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:971:9: [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. if (access(dirname2.c_str(),R_OK)!=0){ data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:982:9: [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. if (access(dirname2.c_str(),R_OK)!=0){ data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.h:322:18: [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. virtual void printf(const char *fmt_,...) __attribute__((format(printf, 2, 3))); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.h:322:69: [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. virtual void printf(const char *fmt_,...) __attribute__((format(printf, 2, 3))); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_set.cpp:50:35: [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. if ((outdir != NO_OUTDIR) && (access(outdir.c_str(),W_OK)!=0)) { data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_sql.cpp:133:9: [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(buf,sizeof(buf),stmts[i],ap); data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:228:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(dst,fmt,*bin); // convert the next byte data/tcpflow-1.5.2+repack1/src/be13_api/utils.cpp:37:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,fmt,ap); data/tcpflow-1.5.2+repack1/src/be13_api/utils.cpp:50:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,fmt,ap); data/tcpflow-1.5.2+repack1/src/be13_api/utils.cpp:63:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,fmt, args); data/tcpflow-1.5.2+repack1/src/be13_api/utils.cpp:74:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,fmt,ap); data/tcpflow-1.5.2+repack1/src/be13_api/utils.h:44:75: [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. [[noreturn]] void err(int eval,const char *fmt,...) __attribute__((format(printf, 2, 0))); data/tcpflow-1.5.2+repack1/src/be13_api/utils.h:45:76: [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. [[noreturn]] void errx(int eval,const char *fmt,...) __attribute__((format(printf, 2, 0))); data/tcpflow-1.5.2+repack1/src/be13_api/utils.h:46:55: [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. void warn(const char *fmt, ...) __attribute__((format(printf, 1, 0))); data/tcpflow-1.5.2+repack1/src/be13_api/utils.h:47:55: [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. void warnx(const char *fmt,...) __attribute__((format(printf, 1, 0))); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:99:4: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). mktemp(tmpl); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:335:20: [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. int size = vsnprintf(buf,sizeof(buf),fmt,ap); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:338:16: [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). *ret = strcpy((char *) malloc(strlen(buf)+1), buf); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:345:20: [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. void dfxml_writer::printf(const char *fmt,...) data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h:146:10: [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. void printf(const char *fmt,...) __attribute__((format(printf, 2, 3))); // "2" because this is "1" data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h:146:60: [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. void printf(const char *fmt,...) __attribute__((format(printf, 2, 3))); // "2" because this is "1" data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h:174:31: [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. __attribute__((format(printf, 4, 5))); // "4" because this is "1"; data/tcpflow-1.5.2+repack1/src/scan_http.cpp:403:22: [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. exit(system(cmd.c_str())); data/tcpflow-1.5.2+repack1/src/scan_http.cpp:407:13: [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. system(cmd.c_str()); data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:274:13: [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. if(!system(NULL)) { data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:293:16: [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. if(system(invocation.c_str())) { data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:447:20: [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. if(access(file_path.c_str(), R_OK)) { data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:839:12: [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. if(access(input_fname.c_str(),R_OK)) die("cannot read: %s: %s",input_fname.c_str(),strerror(errno)); data/tcpflow-1.5.2+repack1/src/tcpflow.h:312:63: [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. void debug_real(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); data/tcpflow-1.5.2+repack1/src/tcpflow.h:313:101: [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. [[noreturn]] void die(const char *fmt, ...) __attribute__ ((__noreturn__)) __attribute__ ((format (printf, 1, 2))); data/tcpflow-1.5.2+repack1/src/util.cpp:25:5: [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(buf,sizeof(buf),fmt,ap); data/tcpflow-1.5.2+repack1/src/util.cpp:134:24: [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. if(access(mpath.c_str(),X_OK)<0){ data/tcpflow-1.5.2+repack1/src/util.cpp:156:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/tcpflow-1.5.2+repack1/src/wifipcap/util.cpp:11: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. #define snprintf sprintf_s data/tcpflow-1.5.2+repack1/src/wifipcap/util.cpp:50:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf (b, format,argptr); data/tcpflow-1.5.2+repack1/src/wifipcap/util.cpp:75:8: [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. (void)snprintf(buf, bufsize, fmt, v); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:62:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, fmt, data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1632:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "zcat %s", name); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1634:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "bzcat %s", name); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1639:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "cat %s", name); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1641:15: [4] (shell) popen: 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. FILE *pipe = popen(cmd, "r"); data/tcpflow-1.5.2+repack1/src/be13_api/plugin.cpp:212:26: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. HINSTANCE hinstLib = LoadLibrary(TEXT(fn.c_str())); data/tcpflow-1.5.2+repack1/src/be13_api/unicode_escape.cpp:282:18: [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 ((ch = getopt(argc,argv,"r:h")) != -1){ data/tcpflow-1.5.2+repack1/src/netviz/one_page_report.cpp:316:8: [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(getenv("DEBUG")) { data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:354:17: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (chroot(chroot_dir) != 0 || chdir ("/") != 0) { data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:597:19: [3] (buffer) getopt_long: 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 ((arg = getopt_long(argc, argv, "aA:Bb:cCd:DE:e:E:F:f:gHhIi:lL:m:o:pqR:r:S:sT:U:Vvw:x:X:z:Z0J", longopts, NULL)) != EOF) { data/tcpflow-1.5.2+repack1/src/be13_api/aftimer.h: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[64]; data/tcpflow-1.5.2+repack1/src/be13_api/aftimer.h:171: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[64]; data/tcpflow-1.5.2+repack1/src/be13_api/bulk_extractor_i.h:928: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[256]; data/tcpflow-1.5.2+repack1/src/be13_api/bulk_extractor_i.h:939: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[256]; data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:63:5: [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). open(); // open if we are created data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:129:24: [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). void feature_recorder::open() data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:135: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. char buf[1024]; data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:145:13: [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). ios.open(fname.c_str(),std::ios_base::in|std::ios_base::out|std::ios_base::ate); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:164:13: [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). ios.open(fname.c_str(),std::ios_base::out); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:408: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). o.open(ofname.c_str()); // open the file data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:914:16: [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(fname.c_str(),O_CREAT|O_BINARY|O_RDWR,0666); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.cpp:991:16: [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(fname.c_str(),O_APPEND|O_CREAT|O_BINARY|O_RDWR,0666); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder.h:275: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). virtual void open(); data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_sql.cpp:129: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. char buf[65536]; data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_sql.cpp:368: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. char feature[64]; data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_sql.cpp:370: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. char context[64]; data/tcpflow-1.5.2+repack1/src/be13_api/pcap_fake.cpp:31: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 err_buf[128]; data/tcpflow-1.5.2+repack1/src/be13_api/pcap_fake.cpp:49:47: [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). FILE *fp = strcmp(fname,"-")==0 ? stdin : fopen(fname,"rb"); data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:24: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 fd = open(fname.c_str(),O_RDONLY|O_BINARY,0); data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:113: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[4]; data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:129: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. char b[64]; data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:246: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. char hex[17]; data/tcpflow-1.5.2+repack1/src/be13_api/unicode_escape.cpp:55: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[10]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_reader.cpp:143:38: [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). self.volumeobject->block_size = atoi(cdata.c_str()); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:96:5: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int mkstemp(char *tmpl) data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:100:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret=open(tmpl,O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED, _S_IREAD|_S_IWRITE); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:248: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). outf.open(cstr(outfilename),ios_base::out); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:334: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. char buf[65536]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:415: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[256]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:464: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. char hostname[1024]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:481: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[256]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:556: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 delta[16]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:570: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 total[16]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:689: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. char buf[64]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:696: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. char buf[64]; data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h:201: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. char buf[64]; data/tcpflow-1.5.2+repack1/src/dfxml/src/hash_t.h:82: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(this->digest,provided,size()); data/tcpflow-1.5.2+repack1/src/dfxml/src/hash_t.h:116:2: [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[SIZE*2+1]; data/tcpflow-1.5.2+repack1/src/dfxml/src/hash_t.h:274: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). int fd = open(fname,O_RDONLY data/tcpflow-1.5.2+repack1/src/flow.cpp:74:6: [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/tcpflow-1.5.2+repack1/src/hold/tcp_options.cpp:541: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(&hdr, ip6, sizeof(&hdr)); data/tcpflow-1.5.2+repack1/src/iptree.h:279:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(addr,addr_,addrlen); data/tcpflow-1.5.2+repack1/src/iptree.h:311: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(cache[cachenext].addr,addr,addrlen); data/tcpflow-1.5.2+repack1/src/iptree.h:350:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void *)addr,addr_,sizeof(addr)); data/tcpflow-1.5.2+repack1/src/iptree.h:356:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void *)this->addr,n.addr,sizeof(this->addr)); data/tcpflow-1.5.2+repack1/src/iptree.h:391:40: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memset(addr0,0,sizeof(addr0)); memcpy(addr0,addr,(depth+7)/8); data/tcpflow-1.5.2+repack1/src/iptree.h:392:40: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memset(addr1,0,sizeof(addr1)); memcpy(addr1,addr,(depth+7)/8); data/tcpflow-1.5.2+repack1/src/iptree.h:411: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. char buf[64]; data/tcpflow-1.5.2+repack1/src/iptree.h:432: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. char buf[1024]; data/tcpflow-1.5.2+repack1/src/iptree.h:437: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. char buf[128]; data/tcpflow-1.5.2+repack1/src/pcap_writer.h:36:10: [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). void open(const std::string &fname) { data/tcpflow-1.5.2+repack1/src/pcap_writer.h:37:16: [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). fcap = fopen(fname.c_str(),"wb"); // write the output data/tcpflow-1.5.2+repack1/src/pcap_writer.h:51:20: [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). FILE *f2 = fopen(ifname.c_str(),"rb"); data/tcpflow-1.5.2+repack1/src/pcap_writer.h:67: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). pcw->open(ofname); data/tcpflow-1.5.2+repack1/src/pcap_writer.h:73: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). pcw->open(ofname); data/tcpflow-1.5.2+repack1/src/scan_http.cpp:292: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 decompressed[65536]; // where decompressed data goes data/tcpflow-1.5.2+repack1/src/stest.cpp:59: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. char buf[30]; data/tcpflow-1.5.2+repack1/src/stest.cpp:60:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf,"1990-10-10T12:12:12"); data/tcpflow-1.5.2+repack1/src/stest.cpp:65:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf,"1990-10-10T13:00:00"); data/tcpflow-1.5.2+repack1/src/tcpdemux.cpp:108:13: [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(filename.c_str(),oflag,mask); data/tcpflow-1.5.2+repack1/src/tcpdemux.cpp:407:26: [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(it->second->saved_filename.c_str(),O_RDONLY | O_BINARY); data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:425: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 error[PCAP_ERRBUF_SIZE]; data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:465: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. char errbuf[PCAP_ERRBUF_SIZE]; data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:610:37: [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). demux.opt.max_bytes_per_flow = atoi(optarg); data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:630:19: [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). if ((debug = atoi(optarg)) < 0) { data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:665: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). int mnew = atoi(optarg); data/tcpflow-1.5.2+repack1/src/tcpflow.cpp:685: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). demux.opt.max_seek = atoi(optarg); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:209:16: [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). idx_file.open(flow_index_pathname.c_str(),std::ios::trunc|std::ios::in|std::ios::out); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:212:16: [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). idx_file.open(flow_index_pathname.c_str(),std::ios::ate|std::ios::in|std::ios::out); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:238: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. const char *color[3] = { "\033[0;32m", "\033[0;34m", "\033[0;31m" }; data/tcpflow-1.5.2+repack1/src/tcpip.cpp:274: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. char b[64]; data/tcpflow-1.5.2+repack1/src/tcpip.cpp:327: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). printf("%d%s", atoi(hoststr.c_str()), (src_pos_counter != 4 ? "." : "")); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:343:54: [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). printf("\",\"src_port\":%d,\"dst_host\":\"", atoi(flow_pathname.substr(src_pos + 1, src_end_pos - src_pos).c_str())); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:352: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). printf("%d%s", atoi(hoststr.c_str()), (dst_pos_counter != 4 ? "." : "")); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:368:53: [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). printf("\",\"dst_port\":%d,\"payload\": [", atoi(flow_pathname.substr(dst_pos + 1, dst_end_pos - dst_pos).c_str())); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:420: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 buffer[BUFFERSIZE]; data/tcpflow-1.5.2+repack1/src/tcpip.h:38: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(addr,a,16); data/tcpflow-1.5.2+repack1/src/tcpip.h:69: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[INET6_ADDRSTRLEN]; data/tcpflow-1.5.2+repack1/src/util.cpp:22: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[65536]; data/tcpflow-1.5.2+repack1/src/util.cpp:63: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[256]; data/tcpflow-1.5.2+repack1/src/wifipcap/sample.cpp:80: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. char errbuf[PCAP_ERRBUF_SIZE]; data/tcpflow-1.5.2+repack1/src/wifipcap/sample.cpp:107:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). bool live = argc == 3 && atoi(argv[2]) == 1; data/tcpflow-1.5.2+repack1/src/wifipcap/util.cpp:45: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 buf[8][512]; data/tcpflow-1.5.2+repack1/src/wifipcap/util.cpp:86: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[4][128]; data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:61: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[24]; data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:518:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pbody->ssid, p + offset, 2); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:526:17: [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(&pbody->ssid.ssid, p + offset, data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:539:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pbody->challenge, p + offset, 2); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:547:17: [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(&pbody->challenge.text, p + offset, data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:560:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(pbody->rates), p + offset, 2); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:567:17: [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(&pbody->rates.rate, p + offset, data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:579:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pbody->ds, p + offset, 3); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:589:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pbody->cf, p + offset, 8); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:599:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pbody->tim, p + offset, 2); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:603:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pbody->tim.count, p + offset, 3); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:612:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pbody->tim.bitmap, p + (pbody->tim.length - 3), data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:647: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(&pbody.timestamp, p, IEEE802_11_TSTAMP_LEN); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:741: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(&pbody.ap, p+offset, IEEE802_11_AP_LEN); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:793: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(&pbody.timestamp, p, IEEE802_11_TSTAMP_LEN); data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1629:2: [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 cmd[256]; data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1630:2: [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[256]; data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1654:2: [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[256]; data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.h:176: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 ssid[33]; /* 32 + 1 for null */ data/tcpflow-1.5.2+repack1/src/be13_api/feature_recorder_sql.cpp:109:33: [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). sqlite3_prepare_v2(db3,sql, strlen(sql), &stmt, NULL); data/tcpflow-1.5.2+repack1/src/be13_api/pcap_fake.cpp:152: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(expression)==0){ data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:56:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t r = (size_t)read(fd,(void *)buf,st.st_size); data/tcpflow-1.5.2+repack1/src/be13_api/sbuf.cpp:132: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). spaces += strlen(b); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.cpp:338:39: [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). *ret = strcpy((char *) malloc(strlen(buf)+1), buf); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h:213: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). int len = strlen(buf); data/tcpflow-1.5.2+repack1/src/dfxml/src/dfxml_writer.h:216:9: [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(buf,"Z"); data/tcpflow-1.5.2+repack1/src/stest.cpp:54: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(sqlite3_prepare_v2(db, zSql, strlen(zSql), &s, NULL)!=SQLITE_OK ){ data/tcpflow-1.5.2+repack1/src/stest.cpp:61:38: [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(sqlite3_bind_text(s,1,buf,strlen(buf),SQLITE_TRANSIENT)!=SQLITE_OK){ data/tcpflow-1.5.2+repack1/src/stest.cpp:66:38: [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(sqlite3_bind_text(s,2,buf,strlen(buf),SQLITE_TRANSIENT)!=SQLITE_OK){ data/tcpflow-1.5.2+repack1/src/stest.cpp:71:38: [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(sqlite3_bind_text(s,3,buf,strlen(buf),SQLITE_TRANSIENT)!=SQLITE_OK){ data/tcpflow-1.5.2+repack1/src/stest.cpp:76:38: [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(sqlite3_bind_text(s,4,buf,strlen(buf),SQLITE_TRANSIENT)!=SQLITE_OK){ data/tcpflow-1.5.2+repack1/src/tcpdemux.cpp:66: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(sqlite3_prepare_v2(db, zSql, strlen(zSql), &insert_stmt, NULL)!=SQLITE_OK ){ data/tcpflow-1.5.2+repack1/src/tcpdemux.cpp:413:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t r = read(fd,buf,tcp_datalen); data/tcpflow-1.5.2+repack1/src/tcpip.cpp:435:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buffer, bytes_this_time) != bytes_this_time) data/tcpflow-1.5.2+repack1/src/util.cpp:77: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). size_t debug_prefix_size = strlen(pfx) + 16; data/tcpflow-1.5.2+repack1/src/util.cpp:234:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd,buf,length); // should explore return code data/tcpflow-1.5.2+repack1/src/wifipcap/wifipcap.cpp:1624: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). int slen = strlen(name); ANALYSIS SUMMARY: Hits = 173 Lines analyzed = 27601 in approximately 0.74 seconds (37284 lines/second) Physical Source Lines of Code (SLOC) = 18849 Hits@level = [0] 148 [1] 18 [2] 103 [3] 5 [4] 46 [5] 1 Hits@level+ = [0+] 321 [1+] 173 [2+] 155 [3+] 52 [4+] 47 [5+] 1 Hits/KSLOC@level+ = [0+] 17.0301 [1+] 9.17821 [2+] 8.22325 [3+] 2.75877 [4+] 2.4935 [5+] 0.0530532 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.