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/dvblast-3.4/asi-deltacast.c Examining data/dvblast-3.4/asi-deltacast.h Examining data/dvblast-3.4/asi.c Examining data/dvblast-3.4/asi.h Examining data/dvblast-3.4/comm.c Examining data/dvblast-3.4/comm.h Examining data/dvblast-3.4/config.h Examining data/dvblast-3.4/demux.c Examining data/dvblast-3.4/dvb.c Examining data/dvblast-3.4/dvblast.c Examining data/dvblast-3.4/dvblast.h Examining data/dvblast-3.4/dvblastctl.c Examining data/dvblast-3.4/en50221.c Examining data/dvblast-3.4/en50221.h Examining data/dvblast-3.4/mrtg-cnt.c Examining data/dvblast-3.4/mrtg-cnt.h Examining data/dvblast-3.4/output.c Examining data/dvblast-3.4/udp.c Examining data/dvblast-3.4/util.c FINAL RESULTS: data/dvblast-3.4/asi.c:93:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( psz_file, sizeof(psz_file), psz_fmt, i_link ); data/dvblast-3.4/asi.c:119:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( psz_file, sizeof(psz_file), psz_fmt, i_link ); data/dvblast-3.4/asi.c:161:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( psz_dev, sizeof(psz_dev), ASI_DEVICE, i_asi_adapter ); data/dvblast-3.4/demux.c:2268: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. __attribute__ ((format(printf, 2, 3))) data/dvblast-3.4/demux.c:2274:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(psz_fmt, psz_format); data/dvblast-3.4/demux.c:2277:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(psz_fmt, args); data/dvblast-3.4/dvb.c:1231:14: [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. switch ( system ) data/dvblast-3.4/dvb.c:1235:35: [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. p->props[DELSYS].u.data = system; data/dvblast-3.4/dvb.c:1255:35: [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. p->props[DELSYS].u.data = system; data/dvblast-3.4/dvb.c:1293:35: [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. p->props[DELSYS].u.data = system; data/dvblast-3.4/dvb.c:1341:35: [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. p->props[DELSYS].u.data = system; data/dvblast-3.4/dvblast.c:432:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( psz_format, psz_base ); data/dvblast-3.4/dvblast.h:290: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. __attribute__ ((format(printf, 2, 3))) void msg_Info( void *_unused, const char *psz_format, ... ); data/dvblast-3.4/dvblast.h:291: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. __attribute__ ((format(printf, 2, 3))) void msg_Err( void *_unused, const char *psz_format, ... ); data/dvblast-3.4/dvblast.h:292: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. __attribute__ ((format(printf, 2, 3))) void msg_Warn( void *_unused, const char *psz_format, ... ); data/dvblast-3.4/dvblast.h:293: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. __attribute__ ((format(printf, 2, 3))) void msg_Dbg( void *_unused, const char *psz_format, ... ); data/dvblast-3.4/dvblast.h:294: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. __attribute__ ((format(printf, 2, 3))) void msg_Raw( void *_unused, const char *psz_format, ... ); data/dvblast-3.4/dvblastctl.c:81: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. __attribute__ ((format(printf, 2, 3))) data/dvblast-3.4/dvblastctl.c:87:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(psz_fmt, psz_format); data/dvblast-3.4/dvblastctl.c:89:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(psz_fmt, args); data/dvblast-3.4/dvblastctl.c:93: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. __attribute__ ((format(printf, 1, 2))) data/dvblast-3.4/dvblastctl.c:107: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, psz_fmt, args ); data/dvblast-3.4/dvblastctl.c:899:13: [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. printf(s "\n"); data/dvblast-3.4/dvblastctl.c:912:13: [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. printf( STRINGIFY(x) "\n" ); data/dvblast-3.4/dvblastctl.c:933:13: [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. printf(s); data/dvblast-3.4/util.c:142:9: [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, psz_fmt, args ); data/dvblast-3.4/util.c:167:9: [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, psz_fmt, args ); data/dvblast-3.4/util.c:192:9: [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, psz_fmt, args ); data/dvblast-3.4/util.c:217:9: [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, psz_fmt, args ); data/dvblast-3.4/util.c:237: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, psz_fmt, args ); data/dvblast-3.4/util.c:385:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( &p_outline[53], "%16s", p_hrdata ); data/dvblast-3.4/dvblast.c:815:18: [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 ( (c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:5:f:F:R:s:S:k:v:pb:I:m:P:K:G:H:X:O:uwUTL:E:d:3D:A:lg:zCWYeM:N:j:J:B:x:Q:6:7:hVZ:y:0:1:2:9:", long_options, NULL)) != -1 ) data/dvblast-3.4/dvblast.c:1273: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( time(NULL) * getpid() ); data/dvblast-3.4/dvblastctl.c:421: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. if ( (c = getopt_long(i_argc, ppsz_argv, "r:t:x:j:h", long_options, NULL)) == -1 ) data/dvblast-3.4/dvblastctl.c:491:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *tmpdir = getenv("TMPDIR"); data/dvblast-3.4/asi-deltacast.c:200: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((*pp_current)->p_ts, p_asibuf + (i * TS_SIZE), TS_SIZE); data/dvblast-3.4/asi.c:87: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 psz_file[MAXLEN], psz_data[MAXLEN]; data/dvblast-3.4/asi.c:96: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). if ( (i_fd = open( psz_file, O_RDONLY )) < 0 ) data/dvblast-3.4/asi.c:115: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 psz_file[MAXLEN], psz_data[MAXLEN]; data/dvblast-3.4/asi.c:125: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). if ( (i_fd = open( psz_file, O_WRONLY )) < 0 ) data/dvblast-3.4/asi.c:138: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 psz_dev[MAXLEN]; data/dvblast-3.4/asi.c:163:22: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( (i_handle = open( psz_dev, O_RDONLY, 0 )) < 0 ) data/dvblast-3.4/asi.h:183:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char PCR[6]; data/dvblast-3.4/comm.c:214: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( p_answer + COMM_HEADER_SIZE, p_packed_section, i_packed_section_size ); data/dvblast-3.4/comm.c:252: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( p_answer + COMM_HEADER_SIZE, p_packed_section, i_packed_section_size ); data/dvblast-3.4/demux.c: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(p_output->config.pi_confpids, p_config->pi_confpids, data/dvblast-3.4/demux.c:912: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_output->config.pi_pids, pi_pids, sizeof(uint16_t) * i_nb_pids ); data/dvblast-3.4/demux.c:1167: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( *ppi_wanted_pids, pi_pids, sizeof(uint16_t) * i_nb_pids ); data/dvblast-3.4/demux.c:1613: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( p_desc, p_current_desc, data/dvblast-3.4/demux.c:1838: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( descs_get_desc( sdtn_get_descs(p_service), 0 ), data/dvblast-3.4/demux.c:1886: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( p_new_desc, p_desc, i_desc_len ); data/dvblast-3.4/demux.c:2210: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(psz_string, p_string, i_length); data/dvblast-3.4/demux.c:2271: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 psz_fmt[strlen(psz_format) + 2]; data/dvblast-3.4/demux.c:3406: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( p_flat_section + i_pos, p_eit, psi_length ); data/dvblast-3.4/dvb.c:95: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 psz_tmp[128]; data/dvblast-3.4/dvb.c:101:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( psz_tmp, "/dev/dvb/adapter%d/frontend%d", i_adapter, i_fenum ); data/dvblast-3.4/dvb.c:102:27: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if( (i_frontend = open(psz_tmp, O_RDWR | O_NONBLOCK)) < 0 ) data/dvblast-3.4/dvb.c:116:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( psz_tmp, "/dev/dvb/adapter%d/dvr%d", i_adapter, i_fenum ); data/dvblast-3.4/dvb.c:118: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). if( (i_dvr = open(psz_tmp, O_RDONLY | O_NONBLOCK)) < 0 ) data/dvblast-3.4/dvb.c:231: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 psz_tmp[128]; data/dvblast-3.4/dvb.c:234:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( psz_tmp, "/dev/dvb/adapter%d/demux%d", i_adapter, i_fenum ); data/dvblast-3.4/dvb.c:235:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if( (i_fd = open(psz_tmp, O_RDWR)) < 0 ) data/dvblast-3.4/dvblast.c:190: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_config->pi_ssrc, pi_ssrc_global, 4 * sizeof(uint8_t) ); data/dvblast-3.4/dvblast.c:288: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_config->connect_addr, p_ai->ai_addr, p_ai->ai_addrlen ); data/dvblast-3.4/dvblast.c:303: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( &p_config->bind_addr, p_ai->ai_addr, p_ai->ai_addrlen ); data/dvblast-3.4/dvblast.c:368: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( p_config->pi_ssrc, &i_addr, 4 * sizeof(uint8_t) ); data/dvblast-3.4/dvblast.c:429: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 psz_format[i_len]; data/dvblast-3.4/dvblast.c:434:14: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. j += sprintf( psz_format + j, "%u,", p_config->pi_pids[i] ); data/dvblast-3.4/dvblast.c:444: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 psz_line[2048]; data/dvblast-3.4/dvblast.c:453: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). if ( (p_file = fopen( psz_conf_file, "r" )) == NULL ) data/dvblast-3.4/dvblast.c:488:13: [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( atoi( psz_token ) == 1 ) data/dvblast-3.4/dvblast.c:833:34: [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). i_verbose -= atoi( optarg ); /* e.g. -q2 */ data/dvblast-3.4/dvblast.c:865: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( pi_ssrc_global, &maddr.s_addr, 4 * sizeof(uint8_t) ); data/dvblast-3.4/dvblastctl.c:60:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char psz_client_socket[PATH_MAX] = {0}; data/dvblast-3.4/dvblastctl.c:84: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 psz_fmt[strlen(psz_format) + 2]; data/dvblast-3.4/dvblastctl.c:97: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 psz_fmt[1024]; data/dvblast-3.4/dvblastctl.c:115: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(psz_string, p_string, i_length); data/dvblast-3.4/dvblastctl.c:220: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 start_str[24], duration_str[10]; data/dvblast-3.4/dvblastctl.c:227:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(duration_str, "%02d:%02d:%02d", hour, min, sec); data/dvblast-3.4/dvblastctl.c:496:18: [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 tmp_fd = mkstemp(psz_client_socket); data/dvblast-3.4/dvblastctl.c:549:26: [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). uint16_t i_sid = atoi(p_arg1); data/dvblast-3.4/dvblastctl.c:557: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). i_pid = (uint16_t)atoi(p_arg1); data/dvblast-3.4/dvblastctl.c:567:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). p_cmd->i_slot = atoi(p_arg1); data/dvblast-3.4/dvblastctl.c:594:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). p_cmd->i_slot = atoi(p_arg1); data/dvblast-3.4/dvblastctl.c:598:46: [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). p_cmd->object.u.menu_answ.i_choice = atoi(p_arg2); data/dvblast-3.4/dvblastctl.c:606:21: [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). p_data[0] = atoi(p_arg1); data/dvblast-3.4/en50221.c:329: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( p, p_content, i_length ); data/dvblast-3.4/en50221.c:429: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( &p_recv->p_data[ p_recv->i_size ], p_session, i_session_size ); data/dvblast-3.4/en50221.c:502: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, p_data, i_size ); data/dvblast-3.4/en50221.c:919: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( p, p_data, i_size ); data/dvblast-3.4/en50221.c:935: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( ca_msg.msg, p_apdu, i_size + p - p_apdu ); data/dvblast-3.4/en50221.c:1041: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( psz_name, d, l ); data/dvblast-3.4/en50221.c:1150: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( p_info, p_desc, data/dvblast-3.4/en50221.c:1982: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 psz_tmp[128]; data/dvblast-3.4/en50221.c:1987:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( psz_tmp, "/dev/dvb/adapter%d/ca%d", i_adapter, i_canum ); data/dvblast-3.4/en50221.c:1988: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). if( (i_ca_handle = open(psz_tmp, O_RDWR | O_NONBLOCK)) < 0 ) data/dvblast-3.4/en50221.h:104: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_answer, *pp_pointer, i_size ); \ data/dvblast-3.4/en50221.h:111: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_answer, p_object, sizeof(en50221_mmi_object_t) ); data/dvblast-3.4/mrtg-cnt.c:60:15: [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 signed char i_pid_seq[PIDS]; data/dvblast-3.4/mrtg-cnt.c:169: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). if ((mrtg_fh = fopen(mrtg_file, "wb")) == NULL) { data/dvblast-3.4/output.c:91:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ipsrc_str[16], ipdst_str[16]; data/dvblast-3.4/output.c:269: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_output->config.connect_addr, &p_config->connect_addr, data/dvblast-3.4/output.c:271: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_output->config.bind_addr, &p_config->bind_addr, data/dvblast-3.4/output.c:633: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_output->config.pi_ssrc, p_config->pi_ssrc, 4 * sizeof(uint8_t) ); data/dvblast-3.4/udp.c:308: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 psz_addr[256], psz_port[42]; data/dvblast-3.4/udp.c:314: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( &last_addr, &addr, mh.msg_namelen ); data/dvblast-3.4/udp.c:380: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.s_addr, pi_new_ssrc, 4 * sizeof(uint8_t) ); data/dvblast-3.4/udp.c:382: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( pi_ssrc, pi_new_ssrc, 4 * sizeof(uint8_t) ); data/dvblast-3.4/util.c:140: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 psz_fmt[MAX_MSG]; data/dvblast-3.4/util.c:165: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 psz_fmt[MAX_MSG]; data/dvblast-3.4/util.c:190: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 psz_fmt[MAX_MSG]; data/dvblast-3.4/util.c:215: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 psz_fmt[MAX_MSG]; data/dvblast-3.4/util.c:233: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 psz_fmt[MAX_MSG]; data/dvblast-3.4/util.c:281: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_dst->p, p_src->p, p_src->i); data/dvblast-3.4/util.c:360:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( p_outline, "%03x: ", i ); data/dvblast-3.4/util.c:366:17: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( &p_outline[5 + (3 * j)], "%02x ", p_data[i + j] ); data/dvblast-3.4/util.c:370:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( &p_hrdata[j], "%c", p_data[i + j] ); data/dvblast-3.4/util.c:380:17: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( &p_outline[5 + (3 * j)], " " ); data/dvblast-3.4/util.c:400: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 psz_port_buffer[6]; data/dvblast-3.4/util.c:444:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( psz_port_buffer, "%u", i_default_port ); data/dvblast-3.4/util.c:485: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_flat_section, p_section, psi_length ); data/dvblast-3.4/util.c:521: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( p_flat_section + i_pos, p_section, psi_length ); data/dvblast-3.4/util.c:565: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( p_section_local, p_section, i_section_len ); data/dvblast-3.4/asi.c:99:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i_ret = read( i_fd, psz_data, sizeof(psz_data) ); data/dvblast-3.4/asi.c:128:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i_ret = write( i_fd, psz_data, strlen(psz_data) + 1 ); data/dvblast-3.4/comm.c:66:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( sun_server.sun_path, psz_srv_socket, sizeof(sun_server.sun_path) ); data/dvblast-3.4/demux.c:2271:18: [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). char psz_fmt[strlen(psz_format) + 2]; data/dvblast-3.4/demux.c:2276: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(psz_fmt, "\n"); data/dvblast-3.4/dvblast.c:198:25: [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 ( !psz_string || strlen( psz_string ) == 0 ) data/dvblast-3.4/dvblast.c:217:18: [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). *pi_length = strlen(psz_input); data/dvblast-3.4/dvblast.c:316:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define IS_OPTION( option ) (!strncasecmp( psz_string, option, strlen(option) )) data/dvblast-3.4/dvblast.c:317:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define ARG_OPTION( option ) (psz_string + strlen(option)) data/dvblast-3.4/dvblast.c:428:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t i_len = strlen(psz_base) + 6 * p_config->i_nb_pids + 1; data/dvblast-3.4/dvblast.c:430: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). int i, j = strlen(psz_base); data/dvblast-3.4/dvblastctl.c:84:18: [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). char psz_fmt[strlen(psz_format) + 2]; data/dvblast-3.4/dvblastctl.c:88:5: [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(psz_fmt, "\n"); data/dvblast-3.4/dvblastctl.c:512:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( sun_client.sun_path, psz_client_socket, data/dvblast-3.4/dvblastctl.c:522:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( sun_server.sun_path, psz_srv_socket, sizeof(sun_server.sun_path) ); data/dvblast-3.4/en50221.c:365:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i_size = read( i_ca_handle, p_data, MAX_TPDU_SIZE ); data/dvblast-3.4/en50221.c:1636:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i_size = 1 + strlen( p_object->u.answ.psz_answ ); data/dvblast-3.4/en50221.c:1639:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( (char *)&p_data[1], p_object->u.answ.psz_answ, i_size - 1 ); data/dvblast-3.4/en50221.c:1728:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( p_mmi->last_object.u.enq.psz_text, (char *)d, l ); data/dvblast-3.4/en50221.h:119: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). strlen(p_object->u.enq.psz_text) + 1 ); data/dvblast-3.4/en50221.h:124: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). strlen(p_object->u.answ.psz_answ) + 1 ); data/dvblast-3.4/en50221.h:130: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). strlen(p_object->u.menu.psz_title) + 1 ); data/dvblast-3.4/en50221.h:132: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). strlen(p_object->u.menu.psz_subtitle) + 1 ); data/dvblast-3.4/en50221.h:134: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). strlen(p_object->u.menu.psz_bottom) + 1 ); data/dvblast-3.4/en50221.h:146: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). strlen(p_object->u.menu.ppsz_choices[i]) + 1 ); data/dvblast-3.4/output.c:95:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ipsrc_str, inet_ntoa(insrc), 16); data/dvblast-3.4/output.c:96:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ipdst_str, inet_ntoa(indst), 16); data/dvblast-3.4/udp.c:116:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define IS_OPTION( option ) (!strncasecmp( psz_string, option, strlen(option) )) data/dvblast-3.4/udp.c:117:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define ARG_OPTION( option ) (psz_string + strlen(option)) data/dvblast-3.4/udp.c:133:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(psz_ifname) >= IFNAMSIZ) { data/dvblast-3.4/udp.c:259:46: [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). psz_ifname, strlen(psz_ifname)+1 ) < 0 ) { data/dvblast-3.4/util.c:374:21: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf( &p_hrdata[j], "." ); data/dvblast-3.4/util.c:381:17: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf( &p_hrdata[j], " " ); data/dvblast-3.4/util.c:440:35: [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). *ppsz_end = _psz_string + strlen(_psz_string); ANALYSIS SUMMARY: Hits = 157 Lines analyzed = 13814 in approximately 0.37 seconds (37777 lines/second) Physical Source Lines of Code (SLOC) = 10589 Hits@level = [0] 177 [1] 34 [2] 88 [3] 4 [4] 31 [5] 0 Hits@level+ = [0+] 334 [1+] 157 [2+] 123 [3+] 35 [4+] 31 [5+] 0 Hits/KSLOC@level+ = [0+] 31.5422 [1+] 14.8267 [2+] 11.6158 [3+] 3.30532 [4+] 2.92757 [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.