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/libmms-0.6.4/src/mms.h Examining data/libmms-0.6.4/src/bswap.h Examining data/libmms-0.6.4/src/mms_config.h Examining data/libmms-0.6.4/src/mmsh.c Examining data/libmms-0.6.4/src/asfheader.h Examining data/libmms-0.6.4/src/mmsio.h Examining data/libmms-0.6.4/src/mmsx.c Examining data/libmms-0.6.4/src/mmsh.h Examining data/libmms-0.6.4/src/uri.c Examining data/libmms-0.6.4/src/mms-common-funcs.h Examining data/libmms-0.6.4/src/utf.c Examining data/libmms-0.6.4/src/mms-common.h Examining data/libmms-0.6.4/src/mmsx.h Examining data/libmms-0.6.4/src/uri.h Examining data/libmms-0.6.4/src/mms.c Examining data/libmms-0.6.4/src/utf.h FINAL RESULTS: data/libmms-0.6.4/src/mms.c:64: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(stderr, "mms: " __VA_ARGS__) data/libmms-0.6.4/src/mms.c:775:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(this->str, "NSPlayer/7.0.0.1956; {%s}; Host: %s", this->guid, data/libmms-0.6.4/src/mmsh.c:67: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(stderr, "mmsh: " __VA_ARGS__) data/libmms-0.6.4/src/mmsh.c:502:3: [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 (this->str, SCRATCH_SIZE, mmsh_FirstRequest, this->uri, data/libmms-0.6.4/src/mmsh.c:552:7: [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 (this->str, SCRATCH_SIZE, mmsh_SeekableRequest, this->uri, data/libmms-0.6.4/src/mmsh.c:559:7: [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 (this->str, SCRATCH_SIZE, mmsh_LiveRequest, this->uri, data/libmms-0.6.4/src/uri.c:918:11: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(ret, tmp); data/libmms-0.6.4/src/uri.c:923:11: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(ret, uri->query); data/libmms-0.6.4/src/utf.c:28: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(stderr, "mms: " __VA_ARGS__) data/libmms-0.6.4/src/mms.c:63:9: [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("LIBMMS_DEBUG")) \ data/libmms-0.6.4/src/mms.c:622:3: [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)); data/libmms-0.6.4/src/mmsh.c:66:9: [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("LIBMMS_DEBUG")) \ data/libmms-0.6.4/src/mmsh.c:607: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. if ((proxy_env = getenv("http_proxy")) != NULL) data/libmms-0.6.4/src/mmsx.c:41:25: [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 *try_mms_first = getenv("LIBMMS_TRY_MMS_FIRST"); data/libmms-0.6.4/src/utf.c:27:9: [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("LIBMMS_DEBUG")) \ data/libmms-0.6.4/src/mms.c:122: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 scmd[CMD_HEADER_LEN + CMD_BODY_LEN]; data/libmms-0.6.4/src/mms.c:126: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 str[1024]; /* scratch buffer to built strings */ data/libmms-0.6.4/src/mms.c:150: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 guid[37]; data/libmms-0.6.4/src/mms.c:218: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 port_str[16]; data/libmms-0.6.4/src/mms.c:227:3: [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(port_str, "%d", port); data/libmms-0.6.4/src/mms.c:619: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 digit[16] = "0123456789ABCDEF"; data/libmms-0.6.4/src/mms.c:1125: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, this->asf_header, len); data/libmms-0.6.4/src/mms.c:1145: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[total], &this->asf_header[this->asf_header_read], n); data/libmms-0.6.4/src/mms.c:1169: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[total], &this->buf[this->buf_read], n); data/libmms-0.6.4/src/mms.c:1188: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(this->scmd_body, &time_sec, 8); data/libmms-0.6.4/src/mms.c:1226: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(saved_buf, this->buf, this->buf_size); data/libmms-0.6.4/src/mms.c:1236: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(this->buf, saved_buf, saved_buf_size); data/libmms-0.6.4/src/mmsh.c:180: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 str[SCRATCH_SIZE]; /* scratch buffer to built strings */ data/libmms-0.6.4/src/mmsh.c:206: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 guid[37]; data/libmms-0.6.4/src/mmsh.c:265: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 httpstatus[51]; data/libmms-0.6.4/src/mmsh.c:483: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 stream_selection[10 * ASF_MAX_NUM_STREAMS]; /* 10 chars per stream */ data/libmms-0.6.4/src/mmsh.c:787: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, this->asf_header, len); data/libmms-0.6.4/src/mmsh.c:812: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[total], &this->asf_header[this->asf_header_read], n); data/libmms-0.6.4/src/mmsh.c:848: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[total], &this->buf[this->buf_read], n); data/libmms-0.6.4/src/mms-common.h:30:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define io_read(io, args...) ((io) ? (io)->read(io->read_data , ## args) : mms_default_io.read(NULL , ## args)) data/libmms-0.6.4/src/mms-common.h:30:91: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define io_read(io, args...) ((io) ? (io)->read(io->read_data , ## args) : mms_default_io.read(NULL , ## args)) data/libmms-0.6.4/src/mms.c:185:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = (off_t)read(socket, buf + len, num - len); data/libmms-0.6.4/src/mms.c:314:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (io->read) { data/libmms-0.6.4/src/mms.c:315:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mms_default_io.read = io->read; data/libmms-0.6.4/src/mms.c:318:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mms_default_io.read = fallback_io.read; data/libmms-0.6.4/src/mmsh.c:226:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). length = strlen(cmd); data/libmms-0.6.4/src/mmsio.h:98:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mms_io_read_func read; data/libmms-0.6.4/src/uri.c:902: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). len += strlen(tmp); data/libmms-0.6.4/src/uri.c:906: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). len += strlen(uri->query) + 1; /* + '?' */ data/libmms-0.6.4/src/uri.c:912:11: [1] (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 character. strcpy(ret, "/"); data/libmms-0.6.4/src/uri.c:922:11: [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(ret, "?"); ANALYSIS SUMMARY: Hits = 46 Lines analyzed = 5151 in approximately 0.16 seconds (31993 lines/second) Physical Source Lines of Code (SLOC) = 3388 Hits@level = [0] 4 [1] 12 [2] 19 [3] 6 [4] 9 [5] 0 Hits@level+ = [0+] 50 [1+] 46 [2+] 34 [3+] 15 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 14.758 [1+] 13.5773 [2+] 10.0354 [3+] 4.42739 [4+] 2.65643 [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.