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/tstools-1.13~git20151030/ac3.c Examining data/tstools-1.13~git20151030/ac3_fns.h Examining data/tstools-1.13~git20151030/accessunit.c Examining data/tstools-1.13~git20151030/accessunit_defns.h Examining data/tstools-1.13~git20151030/accessunit_fns.h Examining data/tstools-1.13~git20151030/adts.c Examining data/tstools-1.13~git20151030/adts_defns.h Examining data/tstools-1.13~git20151030/adts_fns.h Examining data/tstools-1.13~git20151030/audio.c Examining data/tstools-1.13~git20151030/audio_defns.h Examining data/tstools-1.13~git20151030/audio_fns.h Examining data/tstools-1.13~git20151030/avs.c Examining data/tstools-1.13~git20151030/avs_defns.h Examining data/tstools-1.13~git20151030/avs_fns.h Examining data/tstools-1.13~git20151030/bitdata.c Examining data/tstools-1.13~git20151030/bitdata_defns.h Examining data/tstools-1.13~git20151030/bitdata_fns.h Examining data/tstools-1.13~git20151030/compat.h Examining data/tstools-1.13~git20151030/es.c Examining data/tstools-1.13~git20151030/es2ts.c Examining data/tstools-1.13~git20151030/es_defns.h Examining data/tstools-1.13~git20151030/es_fns.h Examining data/tstools-1.13~git20151030/esmerge.c Examining data/tstools-1.13~git20151030/esreport.c Examining data/tstools-1.13~git20151030/ethernet.c Examining data/tstools-1.13~git20151030/ethernet.h Examining data/tstools-1.13~git20151030/filter.c Examining data/tstools-1.13~git20151030/filter_defns.h Examining data/tstools-1.13~git20151030/filter_fns.h Examining data/tstools-1.13~git20151030/fmtx.c Examining data/tstools-1.13~git20151030/fmtx.h Examining data/tstools-1.13~git20151030/h222.c Examining data/tstools-1.13~git20151030/h222_defns.h Examining data/tstools-1.13~git20151030/h222_fns.h Examining data/tstools-1.13~git20151030/h262.c Examining data/tstools-1.13~git20151030/h262_defns.h Examining data/tstools-1.13~git20151030/h262_fns.h Examining data/tstools-1.13~git20151030/ipv4.c Examining data/tstools-1.13~git20151030/ipv4.h Examining data/tstools-1.13~git20151030/l2audio.c Examining data/tstools-1.13~git20151030/l2audio_fns.h Examining data/tstools-1.13~git20151030/m2ts2ts.c Examining data/tstools-1.13~git20151030/misc.c Examining data/tstools-1.13~git20151030/misc_defns.h Examining data/tstools-1.13~git20151030/misc_fns.h Examining data/tstools-1.13~git20151030/nalunit.c Examining data/tstools-1.13~git20151030/nalunit_defns.h Examining data/tstools-1.13~git20151030/nalunit_fns.h Examining data/tstools-1.13~git20151030/pcap.c Examining data/tstools-1.13~git20151030/pcap.h Examining data/tstools-1.13~git20151030/pes.c Examining data/tstools-1.13~git20151030/pes_defns.h Examining data/tstools-1.13~git20151030/pes_fns.h Examining data/tstools-1.13~git20151030/pidint.c Examining data/tstools-1.13~git20151030/pidint_defns.h Examining data/tstools-1.13~git20151030/pidint_fns.h Examining data/tstools-1.13~git20151030/printing.c Examining data/tstools-1.13~git20151030/printing_defns.h Examining data/tstools-1.13~git20151030/printing_fns.h Examining data/tstools-1.13~git20151030/ps.c Examining data/tstools-1.13~git20151030/ps2ts.c Examining data/tstools-1.13~git20151030/ps_defns.h Examining data/tstools-1.13~git20151030/ps_fns.h Examining data/tstools-1.13~git20151030/psdots.c Examining data/tstools-1.13~git20151030/psreport.c Examining data/tstools-1.13~git20151030/reverse.c Examining data/tstools-1.13~git20151030/reverse_defns.h Examining data/tstools-1.13~git20151030/reverse_fns.h Examining data/tstools-1.13~git20151030/rtp2264.c Examining data/tstools-1.13~git20151030/stream_type.c Examining data/tstools-1.13~git20151030/test_es_unit_list.c Examining data/tstools-1.13~git20151030/test_nal_unit_list.c Examining data/tstools-1.13~git20151030/test_pes.c Examining data/tstools-1.13~git20151030/test_printing.c Examining data/tstools-1.13~git20151030/ts.c Examining data/tstools-1.13~git20151030/ts2es.c Examining data/tstools-1.13~git20151030/ts2ps.c Examining data/tstools-1.13~git20151030/ts_defns.h Examining data/tstools-1.13~git20151030/ts_fns.h Examining data/tstools-1.13~git20151030/tsdvbsub.c Examining data/tstools-1.13~git20151030/tsfilter.c Examining data/tstools-1.13~git20151030/tsinfo.c Examining data/tstools-1.13~git20151030/tsplay.c Examining data/tstools-1.13~git20151030/tsplay_defns.h Examining data/tstools-1.13~git20151030/tsplay_fns.h Examining data/tstools-1.13~git20151030/tsplay_innards.c Examining data/tstools-1.13~git20151030/tsreport.c Examining data/tstools-1.13~git20151030/tsserve.c Examining data/tstools-1.13~git20151030/tswrite_defns.h Examining data/tstools-1.13~git20151030/tswrite_fns.h Examining data/tstools-1.13~git20151030/version.h Examining data/tstools-1.13~git20151030/video_defns.h Examining data/tstools-1.13~git20151030/esdots.c Examining data/tstools-1.13~git20151030/esfilter.c Examining data/tstools-1.13~git20151030/esreverse.c Examining data/tstools-1.13~git20151030/pcapreport.c Examining data/tstools-1.13~git20151030/ts_packet_insert.c Examining data/tstools-1.13~git20151030/tswrite.c FINAL RESULTS: data/tstools-1.13~git20151030/compat.h:97: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 _snprintf data/tstools-1.13~git20151030/compat.h:97:18: [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 _snprintf data/tstools-1.13~git20151030/filter.c:207:67: [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. access_unit_context_p access, data/tstools-1.13~git20151030/filter.c:213:38: [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. (*fcontext)->access_unit_context = access; data/tstools-1.13~git20151030/filter.c:230:61: [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. access_unit_context_p access, data/tstools-1.13~git20151030/filter.c:236:38: [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. (*fcontext)->access_unit_context = access; data/tstools-1.13~git20151030/filter_fns.h:84:67: [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. access_unit_context_p access, data/tstools-1.13~git20151030/filter_fns.h:97:61: [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. access_unit_context_p access, data/tstools-1.13~git20151030/fmtx.h:41:9: [4] (buffer) _stprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define _stprintf sprintf data/tstools-1.13~git20151030/fmtx.h:41:19: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define _stprintf sprintf data/tstools-1.13~git20151030/fmtx.h:42:9: [4] (format) _sntprintf: 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 _sntprintf snprintf data/tstools-1.13~git20151030/fmtx.h:42:20: [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 _sntprintf snprintf data/tstools-1.13~git20151030/printing.c:61:10: [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. (void) vfprintf(stdout, format, arg_ptr); data/tstools-1.13~git20151030/printing.c:68:10: [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. (void) vfprintf(stderr, format, arg_ptr); data/tstools-1.13~git20151030/test_printing.c:47:10: [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. (void) vfprintf(stdout, format, arg_ptr); data/tstools-1.13~git20151030/test_printing.c:52:10: [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. (void) vfprintf(stdout, format, arg_ptr); data/tstools-1.13~git20151030/tsreport.c:410:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(file,OFFSET_T_FORMAT ",read," LLU_FORMAT ",,,,\n", data/tstools-1.13~git20151030/tsreport.c:695:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(file,OFFSET_T_FORMAT ",%s," LLU_FORMAT ",%d,%s,", data/tstools-1.13~git20151030/tsreport.c:703:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(file,LLU_FORMAT ",",stats[index].pts & report_mask); data/tstools-1.13~git20151030/tsreport.c:705:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(file,LLU_FORMAT,stats[index].dts & report_mask); data/tstools-1.13~git20151030/tsreport.c:707:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(file,LLU_FORMAT,stats[index].pts & report_mask); data/tstools-1.13~git20151030/tsreport.c:714:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(file,LLU_FORMAT,escr & report_mask); data/tstools-1.13~git20151030/tswrite.c:2064:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(global_perturb_seed); data/tstools-1.13~git20151030/es.c:360:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(new->data, data, data_len); data/tstools-1.13~git20151030/es.c:914:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(data[offset]),&(es->reader->packet->es_data[from]), data/tstools-1.13~git20151030/es.c:925:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(data[offset]),&(es->reader->packet->es_data[from]), data/tstools-1.13~git20151030/es.c:1100:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( &((*data)[3]), data/tstools-1.13~git20151030/es.c:1170:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr->data,unit->data,unit->data_len); data/tstools-1.13~git20151030/esfilter.c:1076:24: [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). output.es_output = fopen(output_name,"wb"); data/tstools-1.13~git20151030/esreverse.c:647:24: [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). output.es_output = fopen(output_name,"wb"); data/tstools-1.13~git20151030/ethernet.c:54:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pkt->dst_addr, p, 6); data/tstools-1.13~git20151030/ethernet.c:56:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pkt->src_addr, p, 6); data/tstools-1.13~git20151030/fmtx.c:40:8: [2] (buffer) TCHAR: 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 TCHAR fmtx_buffers[FMTX_BUFFERS_COUNT][FMTX_BUFFER_SIZE]; data/tstools-1.13~git20151030/m2ts2ts.c:452:14: [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). output = fopen(output_name, "wb"); data/tstools-1.13~git20151030/misc.c:365:15: [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). filedes = open(filename,flags,00777); data/tstools-1.13~git20151030/misc.c:370:15: [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). filedes = open(filename,flags); data/tstools-1.13~git20151030/misc.c:1330:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ipaddr.sin_addr.s_addr, hp->h_addr, hp->h_length); data/tstools-1.13~git20151030/misc.c:1343:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ipaddr.sin_addr.s_addr, hp->h_addr, hp->h_length); data/tstools-1.13~git20151030/misc.c:1477:10: [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[64]; data/tstools-1.13~git20151030/nalunit.c:1193: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 what[SARRAYSIZE]; data/tstools-1.13~git20151030/nalunit.c:1370: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 what[SARRAYSIZE2]; data/tstools-1.13~git20151030/pcap.c:532:28: [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 *fptr = (filename ? fopen(filename, "rb") : stdin); data/tstools-1.13~git20151030/pcapreport.c:341: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(p, prefix, n); data/tstools-1.13~git20151030/pcapreport.c:375:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pbuf[32], pbuf2[32]; data/tstools-1.13~git20151030/pcapreport.c:376:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char identifier[64]; data/tstools-1.13~git20151030/pcapreport.c:401: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(name, base_name, base_len + 1); data/tstools-1.13~git20151030/pcapreport.c:412: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(name, ctx->base_name, base_len); data/tstools-1.13~git20151030/pcapreport.c:511:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out_buf, st->tmp_buf, nr_bytes); data/tstools-1.13~git20151030/pcapreport.c:605: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(&st->tmp_buf[st->tmp_len], data, pktlen); data/tstools-1.13~git20151030/pcapreport.c:780:39: [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). if ((st->csv_file = fopen(st->csv_name, "wt")) == NULL) data/tstools-1.13~git20151030/pcapreport.c:839:25: [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). st->output_file = fopen(st->output_name, "wb"); data/tstools-1.13~git20151030/pcapreport.c:928:25: [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). st->output_file = fopen(st->output_name, "wb"); data/tstools-1.13~git20151030/pcapreport.c:1146:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pbuf[32]; data/tstools-1.13~git20151030/pcapreport.c:1164:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pbuf1[64], pbuf2[64]; data/tstools-1.13~git20151030/pcapreport.c:1365: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(frag->pkt + ip->frag_offset * 8, in_data, frag_len); data/tstools-1.13~git20151030/pcapreport.c:1503:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *onechararg[26] = data/tstools-1.13~git20151030/pes.c:125: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(data->data,bytes,bytes_len); data/tstools-1.13~git20151030/pes.c:136: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(&(data->data[data->data_len]),bytes,bytes_len); data/tstools-1.13~git20151030/pidint.c:449:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pmt->program_info,program_info,program_info_length); data/tstools-1.13~git20151030/pidint.c:510:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pmt->streams[pmt->num_streams].ES_info,ES_info,ES_info_length); data/tstools-1.13~git20151030/ps.c:413:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(buffer[offset]),ps->data_ptr,num_bytes_left); data/tstools-1.13~git20151030/ps.c:422:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(buffer[offset]),ps->data_ptr,num_bytes_wanted); data/tstools-1.13~git20151030/reverse.c:313:14: [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). tempfile = fopen(tempfilename,"a+"); data/tstools-1.13~git20151030/rtp2264.c:148:15: [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). if ((f_in = fopen(fname_in, "rb")) == NULL) data/tstools-1.13~git20151030/rtp2264.c:154: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). if ((f_out = fopen(fname_out, "wb")) == NULL) data/tstools-1.13~git20151030/test_pes.c:260:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(old_data,packet->data,packet->data_len); data/tstools-1.13~git20151030/ts.c:251: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(&(TS_packet[TS_hdr_len]),pes_hdr,pes_hdr_len); data/tstools-1.13~git20151030/ts.c:254: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(&(TS_packet[TS_hdr_len+pes_hdr_len]),data,data_len); data/tstools-1.13~git20151030/ts.c:1026: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(data+12,pmt->program_info,pmt->program_info_length); data/tstools-1.13~git20151030/ts.c:1039: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(data+offset+5,pmt->streams[ii].ES_info,len); data/tstools-1.13~git20151030/ts.c:1574: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(tsreader->pcrbuf->TS_buffer[ii],data,TS_PACKET_SIZE); data/tstools-1.13~git20151030/ts.c:2328:16: [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 const char * const sample_rate_txt[8] = { data/tstools-1.13~git20151030/ts.c:2334:16: [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 const char * const dsurmod_txt[4] = { data/tstools-1.13~git20151030/ts.c:2337:16: [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 const char * const num_channels_txt[16] = { data/tstools-1.13~git20151030/ts.c:2341:16: [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 const char * const priority_txt[4] = { data/tstools-1.13~git20151030/ts.c:2476:16: [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 const char * const prog_interlace[4] = { data/tstools-1.13~git20151030/ts.c:2836: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. char lang[4]; data/tstools-1.13~git20151030/ts.c:2873: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. char temp_c[50]; // twice as much as I need... data/tstools-1.13~git20151030/ts.c:2983: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(*data,packet_data,*data_len); data/tstools-1.13~git20151030/ts.c:3001:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*data + *data_used, packet_data, packet_data_len); data/tstools-1.13~git20151030/ts.c:3008:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*data + *data_used, packet_data, space_left); data/tstools-1.13~git20151030/ts.c:3435:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[SARRAYSIZE]; data/tstools-1.13~git20151030/ts2es.c:83:12: [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). output = fopen(output_name,"wb"); data/tstools-1.13~git20151030/ts2es.c:651: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). output = fopen(output_name,"wb"); data/tstools-1.13~git20151030/ts2ps.c:458: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). output = fopen(output_name,"wb"); data/tstools-1.13~git20151030/ts_packet_insert.c:75:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr,in_data,in_len); data/tstools-1.13~git20151030/ts_packet_insert.c:368:19: [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 in_file = open(in_file_path,O_RDONLY); data/tstools-1.13~git20151030/ts_packet_insert.c:377: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). out_file = open(output_file_path,O_WRONLY | O_TRUNC | O_CREAT,0644); data/tstools-1.13~git20151030/tsdvbsub.c:362:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dvbd->data + dvbd->data_len, data, len); data/tstools-1.13~git20151030/tsfilter.c:100:28: [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). max_pkts = atoi(args[ii+1]); data/tstools-1.13~git20151030/tsreport.c:274:12: [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 = fopen(output_name,"w"); data/tstools-1.13~git20151030/tsreport.c:323: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). file_cnt = fopen("continuity_counter.txt","w"); data/tstools-1.13~git20151030/tsreport.c:586:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ss->last_pkt, packet, 188); data/tstools-1.13~git20151030/tsserve.c:103:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *input_names[MAX_INPUT_FILES]; // The files to read from data/tstools-1.13~git20151030/tsserve.c:1649:25: [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 int obey_command(char this_command, data/tstools-1.13~git20151030/tsserve.c:1650:25: [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 last_command, data/tstools-1.13~git20151030/tswrite.c:1390:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(data[*length]),packet,TS_PACKET_SIZE); data/tstools-1.13~git20151030/tswrite.c:2532:23: [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). new->where.file = fopen(name,"wb"); data/tstools-1.13~git20151030/es.c:474:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t len = read(es->input,&es->read_ahead,ES_READ_AHEAD_SIZE); data/tstools-1.13~git20151030/misc.c:263:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). length = read(input,&(data[total]),num_bytes-total); data/tstools-1.13~git20151030/pcapreport.c:337:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t n = strlen(prefix); data/tstools-1.13~git20151030/pcapreport.c:378: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). const size_t base_len = strlen(base_name); data/tstools-1.13~git20151030/pcapreport.c:1726: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). const size_t len = strlen(input_name); data/tstools-1.13~git20151030/pcapreport.c:1731:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const size_t extlen = strlen(strip_exts[i]); data/tstools-1.13~git20151030/pes.c:2944:21: [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 (prefix && strlen(prefix) > 0) data/tstools-1.13~git20151030/pes.c:3001: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). if (prefix && strlen(prefix) > 0) data/tstools-1.13~git20151030/ps.c:108:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t len = read(ps->input,&ps->data,PS_READ_AHEAD_SIZE); data/tstools-1.13~git20151030/stream_type.c:257:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). length = read(input,&first_byte,1); data/tstools-1.13~git20151030/ts.c:1401:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). length = read(tsreader->file, data/tstools-1.13~git20151030/ts_packet_insert.c:113:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rv = read(file, buf, TS_PACKET_SIZE); data/tstools-1.13~git20151030/ts_packet_insert.c:154:15: [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 (i=0; i<strlen(string);i++) data/tstools-1.13~git20151030/ts_packet_insert.c:411:49: [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). strlen(out_string)+1, data/tstools-1.13~git20151030/tswrite.c:1572:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t length = read(command_socket,&thing,1); data/tstools-1.13~git20151030/tswrite.c:3644:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(argv[ii+3]) != 1) ANALYSIS SUMMARY: Hits = 114 Lines analyzed = 58759 in approximately 1.59 seconds (37054 lines/second) Physical Source Lines of Code (SLOC) = 37970 Hits@level = [0] 177 [1] 16 [2] 75 [3] 1 [4] 22 [5] 0 Hits@level+ = [0+] 291 [1+] 114 [2+] 98 [3+] 23 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 7.66395 [1+] 3.00237 [2+] 2.58098 [3+] 0.605741 [4+] 0.579405 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.