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/wildmidi-0.4.3/amiga/config.h Examining data/wildmidi-0.4.3/android/jni/config.h Examining data/wildmidi-0.4.3/djgpp/config.h Examining data/wildmidi-0.4.3/djgpp/dosdma.c Examining data/wildmidi-0.4.3/djgpp/dosdma.h Examining data/wildmidi-0.4.3/djgpp/dosirq.c Examining data/wildmidi-0.4.3/djgpp/dosirq.h Examining data/wildmidi-0.4.3/djgpp/dossb.c Examining data/wildmidi-0.4.3/djgpp/dossb.h Examining data/wildmidi-0.4.3/include/common.h Examining data/wildmidi-0.4.3/include/f_hmi.h Examining data/wildmidi-0.4.3/include/f_hmp.h Examining data/wildmidi-0.4.3/include/f_midi.h Examining data/wildmidi-0.4.3/include/f_mus.h Examining data/wildmidi-0.4.3/include/f_xmidi.h Examining data/wildmidi-0.4.3/include/file_io.h Examining data/wildmidi-0.4.3/include/filenames.h Examining data/wildmidi-0.4.3/include/getopt_long.h Examining data/wildmidi-0.4.3/include/gus_pat.h Examining data/wildmidi-0.4.3/include/internal_midi.h Examining data/wildmidi-0.4.3/include/lock.h Examining data/wildmidi-0.4.3/include/mus2mid.h Examining data/wildmidi-0.4.3/include/patches.h Examining data/wildmidi-0.4.3/include/reverb.h Examining data/wildmidi-0.4.3/include/sample.h Examining data/wildmidi-0.4.3/include/stdint/stdint.h Examining data/wildmidi-0.4.3/include/wildmidi_lib.h Examining data/wildmidi-0.4.3/include/wm_error.h Examining data/wildmidi-0.4.3/include/wm_tty.h Examining data/wildmidi-0.4.3/include/xmi2mid.h Examining data/wildmidi-0.4.3/macosx/config.h Examining data/wildmidi-0.4.3/os2/config.h Examining data/wildmidi-0.4.3/src/DevTest.c Examining data/wildmidi-0.4.3/src/amiga.c Examining data/wildmidi-0.4.3/src/f_hmi.c Examining data/wildmidi-0.4.3/src/f_hmp.c Examining data/wildmidi-0.4.3/src/f_midi.c Examining data/wildmidi-0.4.3/src/f_mus.c Examining data/wildmidi-0.4.3/src/f_xmidi.c Examining data/wildmidi-0.4.3/src/file_io.c Examining data/wildmidi-0.4.3/src/getopt_long.c Examining data/wildmidi-0.4.3/src/gus_pat.c Examining data/wildmidi-0.4.3/src/internal_midi.c Examining data/wildmidi-0.4.3/src/lock.c Examining data/wildmidi-0.4.3/src/mus2mid.c Examining data/wildmidi-0.4.3/src/patches.c Examining data/wildmidi-0.4.3/src/reverb.c Examining data/wildmidi-0.4.3/src/sample.c Examining data/wildmidi-0.4.3/src/wildmidi.c Examining data/wildmidi-0.4.3/src/wildmidi_lib.c Examining data/wildmidi-0.4.3/src/wm_error.c Examining data/wildmidi-0.4.3/src/wm_tty.c Examining data/wildmidi-0.4.3/src/xmi2mid.c Examining data/wildmidi-0.4.3/test/test.c FINAL RESULTS: data/wildmidi-0.4.3/include/wm_error.h:58:31: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) data/wildmidi-0.4.3/include/wm_error.h:65:31: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) data/wildmidi-0.4.3/src/DevTest.c:162:13: [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(buffer_file, home); data/wildmidi-0.4.3/src/DevTest.c:163:13: [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(buffer_file, filename + 1); data/wildmidi-0.4.3/src/DevTest.c:174:9: [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(buffer_file, buffer_dir); data/wildmidi-0.4.3/src/DevTest.c:177:9: [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(buffer_file, filename); data/wildmidi-0.4.3/src/DevTest.c:188:9: [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(buffer_file, filename); data/wildmidi-0.4.3/src/file_io.c:157:13: [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(buffer_file, home); data/wildmidi-0.4.3/src/file_io.c:158:13: [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(buffer_file, filename + 1); data/wildmidi-0.4.3/src/file_io.c:168:9: [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(buffer_file, buffer_dir); data/wildmidi-0.4.3/src/file_io.c:171:9: [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(buffer_file, filename); data/wildmidi-0.4.3/src/file_io.c:181:9: [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(buffer_file, filename); data/wildmidi-0.4.3/src/getopt_long.c:210:4: [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, ambig, (int)current_argv_len, current_argv); data/wildmidi-0.4.3/src/getopt_long.c:218:5: [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, noarg, (int)current_argv_len, data/wildmidi-0.4.3/src/getopt_long.c:248:5: [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, recargstring, data/wildmidi-0.4.3/src/getopt_long.c:266:4: [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, illoptstring, current_argv); data/wildmidi-0.4.3/src/getopt_long.c:428:4: [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, illoptchar, optchar); data/wildmidi-0.4.3/src/getopt_long.c:439:5: [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, recargchar, optchar); data/wildmidi-0.4.3/src/getopt_long.c:460:6: [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, recargchar, optchar); data/wildmidi-0.4.3/src/wildmidi_lib.c:250:9: [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(d, str); data/wildmidi-0.4.3/src/wildmidi_lib.c:451:29: [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(new_config, config_dir); data/wildmidi-0.4.3/src/wildmidi_lib.c:452:29: [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(&new_config[strlen(config_dir)], line_tokens[1]); data/wildmidi-0.4.3/src/wildmidi_lib.c:662:29: [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(tmp_patch->filename, config_dir); data/wildmidi-0.4.3/src/wildmidi_lib.c:663:29: [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(tmp_patch->filename, line_tokens[1]); data/wildmidi-0.4.3/src/wildmidi_lib.c:2088:13: [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(mdi->tmp_info->copyright, mdi->extra_info.copyright); data/wildmidi-0.4.3/src/wm_error.c:36: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, wmfmt, args); data/wildmidi-0.4.3/src/wm_error.c:85:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring,"Error (%s:%i) %s", data/wildmidi-0.4.3/src/wm_error.c:88:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring,"Error (%s:%i) %s (%s)", data/wildmidi-0.4.3/src/wm_error.c:93:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring,"System Error (%s:%i) %s : %s", data/wildmidi-0.4.3/src/wm_error.c:96:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring,"System Error (%s:%i) %s (%s) : %s", data/wildmidi-0.4.3/src/wm_error.c:110:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(errorstring, wmfmt, args); data/wildmidi-0.4.3/djgpp/dossb.c:286:8: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("BLASTER"); data/wildmidi-0.4.3/include/getopt_long.h:59:6: [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. int getopt_long(int, char * const *, const char *, data/wildmidi-0.4.3/include/getopt_long.h:65:6: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(int, char * const *, const char *); data/wildmidi-0.4.3/src/DevTest.c:153: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. home = getenv("HOME"); data/wildmidi-0.4.3/src/DevTest.c:2015:13: [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. i = getopt_long(argc, argv, "d:f:vh", long_options, &option_index); data/wildmidi-0.4.3/src/file_io.c:149: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. home = getenv("HOME"); data/wildmidi-0.4.3/src/getopt_long.c:306:22: [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. posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); data/wildmidi-0.4.3/src/getopt_long.c:480:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(int nargc, char * const *nargv, const char *options) data/wildmidi-0.4.3/src/getopt_long.c:498:1: [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. getopt_long(int nargc, char * const *nargv, const char *options, data/wildmidi-0.4.3/src/wildmidi.c:38:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. #define getopt dj_getopt /* hack */ data/wildmidi-0.4.3/src/wildmidi.c:40:8: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. #undef getopt data/wildmidi-0.4.3/src/wildmidi.c:568:5: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&waveCriticalSection); data/wildmidi-0.4.3/src/wildmidi.c:579:5: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(&waveCriticalSection); data/wildmidi-0.4.3/src/wildmidi.c:644:9: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&waveCriticalSection); data/wildmidi-0.4.3/src/wildmidi.c:1620:13: [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. i = getopt_long(argc, argv, "0vho:tx:g:f:lr:c:m:btak:p:ed:nsi:j:", long_options, data/wildmidi-0.4.3/djgpp/dosirq.c:113:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, irqtpl, irqend - irqtpl); data/wildmidi-0.4.3/djgpp/dossb.c:374:9: [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 (sb.open) data/wildmidi-0.4.3/djgpp/dossb.c:404:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!sb.open) data/wildmidi-0.4.3/djgpp/dossb.h:208:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). boolean open; /* Whenever the card has been opened */ data/wildmidi-0.4.3/src/DevTest.c:51:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #undef open data/wildmidi-0.4.3/src/DevTest.c:52:9: [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). #define open _open data/wildmidi-0.4.3/src/DevTest.c:144:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer_dir[1024]; data/wildmidi-0.4.3/src/DevTest.c:204: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 ((buffer_fd = open(buffer_file,(O_RDONLY | O_BINARY))) == -1) { data/wildmidi-0.4.3/src/DevTest.c:206: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 ((buffer_fd = open(buffer_file, O_RDONLY)) == -1) { data/wildmidi-0.4.3/src/DevTest.c:225:8: [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 check_notes[16][128]; data/wildmidi-0.4.3/src/DevTest.c:452: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(&sysex_store[sysex_store_ofs], midi_data, data/wildmidi-0.4.3/src/DevTest.c:2020:23: [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). verbose = atoi(optarg); data/wildmidi-0.4.3/src/f_midi.c:753: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(&((*out)[out_ofs]),foo,11); data/wildmidi-0.4.3/src/f_midi.c:761: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(&((*out)[out_ofs]),foo,7); data/wildmidi-0.4.3/src/f_midi.c:769: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(&((*out)[out_ofs]),foo,12); data/wildmidi-0.4.3/src/f_midi.c:777: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(&((*out)[out_ofs]),foo,10); data/wildmidi-0.4.3/src/f_midi.c:941: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(&(*out)[out_ofs], event->event_data.data.string, value); data/wildmidi-0.4.3/src/file_io.c:41:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #undef open data/wildmidi-0.4.3/src/file_io.c:42:9: [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). #define open _open data/wildmidi-0.4.3/src/file_io.c:142:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer_dir[1024]; data/wildmidi-0.4.3/src/file_io.c:260: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 ((buffer_fd = open(buffer_file,(O_RDONLY | O_BINARY))) == -1) { data/wildmidi-0.4.3/src/getopt_long.c:146:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char **) nargv)[pos] = nargv[cstart]; data/wildmidi-0.4.3/src/getopt_long.c:148:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char **)nargv)[cstart] = swap; data/wildmidi-0.4.3/src/internal_midi.c:2121:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2151:25: [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(&mdi->extra_info.copyright[strlen(mdi->extra_info.copyright) + 1], event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2156:25: [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(mdi->extra_info.copyright, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2162:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2190:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2218:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2246:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2274:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2302:21: [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(text, event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2417: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(sysex_store, event_data, sysex_len); data/wildmidi-0.4.3/src/mus2mid.c:101: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 ID[4]; /* identifier: "MUS" 0x1A */ data/wildmidi-0.4.3/src/mus2mid.c:111:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[4]; data/wildmidi-0.4.3/src/mus2mid.c:120:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[4]; data/wildmidi-0.4.3/src/mus2mid.c:239: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(header.ID, in, 4); data/wildmidi-0.4.3/src/mus2mid.c:420: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(ctx.dst_ptr, temp_buffer, out_local - temp_buffer); data/wildmidi-0.4.3/src/wildmidi.c:292:12: [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). return open(path, (O_RDWR | O_CREAT | O_TRUNC | O_BINARY), 0664); data/wildmidi-0.4.3/src/wildmidi.c:309:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int f = open(path, (O_RDONLY | O_BINARY)); data/wildmidi-0.4.3/src/wildmidi.c:313:12: [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). return open(path, (O_RDWR | O_CREAT | O_TRUNC | O_BINARY), 0664); data/wildmidi-0.4.3/src/wildmidi.c:371:12: [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). return open(path, (O_RDWR | O_CREAT | O_TRUNC), (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)); data/wildmidi-0.4.3/src/wildmidi.c:392:8: [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 midi_file[1024]; data/wildmidi-0.4.3/src/wildmidi.c:428:8: [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 wav_file[1024]; data/wildmidi-0.4.3/src/wildmidi.c:632: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(current->lpData + current->dwUser, &output_data[data_read], free_size); data/wildmidi-0.4.3/src/wildmidi.c:833:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&((char *)MixBuffers[next].pBuffer)[idx], output_data, output_size); data/wildmidi-0.4.3/src/wildmidi.c:833: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. memcpy(&((char *)MixBuffers[next].pBuffer)[idx], output_data, output_size); data/wildmidi-0.4.3/src/wildmidi.c:880: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(sb.dma_buff->linear + buff_tail, data, cnt); data/wildmidi-0.4.3/src/wildmidi.c:889: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(sb.dma_buff->linear + buff_tail, data, cnt); data/wildmidi-0.4.3/src/wildmidi.c:899: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(sb.dma_buff->linear, data, dma_pos); data/wildmidi-0.4.3/src/wildmidi.c:1087: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(AHIBuf[active], output_data, chunk); data/wildmidi-0.4.3/src/wildmidi.c:1141:8: [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 pcmname[64]; data/wildmidi-0.4.3/src/wildmidi.c:1156:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(pcmname, "default"); data/wildmidi-0.4.3/src/wildmidi.c:1277:8: [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 pcmname[64]; data/wildmidi-0.4.3/src/wildmidi.c:1292:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(pcmname, "/dev/dsp"); data/wildmidi-0.4.3/src/wildmidi.c:1295:21: [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 ((audio_fd = open(pcmname, O_WRONLY)) < 0) { data/wildmidi-0.4.3/src/wildmidi.c:1567:8: [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 config_file[1024]; data/wildmidi-0.4.3/src/wildmidi.c:1582: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 modes[5]; data/wildmidi-0.4.3/src/wildmidi.c:1601: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 lyrics[MAX_LYRIC_CHAR + 1]; data/wildmidi-0.4.3/src/wildmidi.c:1603: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 display_lyrics[MAX_DISPLAY_LYRICS + 1]; data/wildmidi-0.4.3/src/wildmidi.c:1632:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). res = atoi(optarg); data/wildmidi-0.4.3/src/wildmidi.c:1643:39: [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). master_volume = (uint8_t) atoi(optarg); data/wildmidi-0.4.3/src/wildmidi.c:1654:62: [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). WildMidi_SetCvtOption(WM_CO_XMI_TYPE, (uint16_t) atoi(optarg)); data/wildmidi-0.4.3/src/wildmidi.c:1657:63: [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). WildMidi_SetCvtOption(WM_CO_FREQUENCY, (uint16_t) atoi(optarg)); data/wildmidi-0.4.3/src/wildmidi.c:1695:35: [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). test_bank = (uint8_t) atoi(optarg); data/wildmidi-0.4.3/src/wildmidi.c:1698:36: [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). test_patch = (uint8_t) atoi(optarg); data/wildmidi-0.4.3/src/wildmidi.c:1828: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(test_data, midi_test[test_count].data, data/wildmidi-0.4.3/src/wildmidi.c:2043:21: [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(lyrics, &lyrics[last_lyric_length], MAX_LYRIC_CHAR - last_lyric_length); data/wildmidi-0.4.3/src/wildmidi.c:2045: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(&lyrics[MAX_DISPLAY_LYRICS], lyric, strlen(lyric)); data/wildmidi-0.4.3/src/wildmidi.c:2051: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(display_lyrics,lyrics,MAX_DISPLAY_LYRICS); data/wildmidi-0.4.3/src/wildmidi_lib.c:479:36: [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). patchid = (atoi(line_tokens[1]) & 0xFF) << 8; data/wildmidi-0.4.3/src/wildmidi_lib.c:489:37: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). patchid = ((atoi(line_tokens[1]) & 0xFF) << 8) | 0x80; data/wildmidi-0.4.3/src/wildmidi_lib.c:564:36: [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). | (atoi(line_tokens[0]) & 0x7F); data/wildmidi-0.4.3/src/wildmidi_lib.c:676:29: [2] (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 string. strcat(tmp_patch->filename, ".pat"); data/wildmidi-0.4.3/src/wildmidi_lib.c:693:55: [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). tmp_patch->amp = (atoi(&line_tokens[token_count][4]) << 10) / 100; data/wildmidi-0.4.3/src/wildmidi_lib.c:699:55: [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). tmp_patch->note = atoi(&line_tokens[token_count][5]); data/wildmidi-0.4.3/src/wildmidi_lib.c:707:55: [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). uint32_t env_no = atoi(&line_tokens[token_count][8]); data/wildmidi-0.4.3/src/wildmidi_lib.c:727:55: [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). uint32_t env_no = atoi(&line_tokens[token_count][9]); data/wildmidi-0.4.3/src/wm_error.c:41:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *errors[WM_ERR_MAX+1] = { data/wildmidi-0.4.3/src/xmi2mid.c:118: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(b, ctx->src_ptr, len); data/wildmidi-0.4.3/src/xmi2mid.c:200:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char mt32asgm[128] = { data/wildmidi-0.4.3/src/xmi2mid.c:333:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char mt32asgs[256] = { data/wildmidi-0.4.3/src/xmi2mid.c:936:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/wildmidi-0.4.3/src/xmi2mid.c:983:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/wildmidi-0.4.3/src/DevTest.c:53:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #undef read data/wildmidi-0.4.3/src/DevTest.c:54:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/wildmidi-0.4.3/src/DevTest.c:156:34: [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). buffer_file = malloc(strlen(filename) + strlen(home) + 1); data/wildmidi-0.4.3/src/DevTest.c:156:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buffer_file = malloc(strlen(filename) + strlen(home) + 1); data/wildmidi-0.4.3/src/DevTest.c:168:34: [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). buffer_file = malloc(strlen(filename) + strlen(buffer_dir) + 2); data/wildmidi-0.4.3/src/DevTest.c:168:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buffer_file = malloc(strlen(filename) + strlen(buffer_dir) + 2); data/wildmidi-0.4.3/src/DevTest.c:175: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). if (buffer_dir[strlen(buffer_dir) - 1] != '/') data/wildmidi-0.4.3/src/DevTest.c:176:13: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(buffer_file, "/"); data/wildmidi-0.4.3/src/DevTest.c:182:30: [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). buffer_file = malloc(strlen(filename) + 1); data/wildmidi-0.4.3/src/DevTest.c:213:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(buffer_fd, data, *size) != buffer_stat.st_size) { data/wildmidi-0.4.3/src/f_midi.c:930: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). value = strlen(event->event_data.data.string); data/wildmidi-0.4.3/src/file_io.c:43:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #undef read data/wildmidi-0.4.3/src/file_io.c:44:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/wildmidi-0.4.3/src/file_io.c:152:43: [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). buffer_file = (char *) malloc(strlen(filename) + strlen(home) + 1); data/wildmidi-0.4.3/src/file_io.c:152:62: [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). buffer_file = (char *) malloc(strlen(filename) + strlen(home) + 1); data/wildmidi-0.4.3/src/file_io.c:163:43: [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). buffer_file = (char *) malloc(strlen(filename) + strlen(buffer_dir) + 2); data/wildmidi-0.4.3/src/file_io.c:163:62: [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). buffer_file = (char *) malloc(strlen(filename) + strlen(buffer_dir) + 2); data/wildmidi-0.4.3/src/file_io.c:169: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). if (buffer_dir[strlen(buffer_dir) - 1] != '/') data/wildmidi-0.4.3/src/file_io.c:170:13: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(buffer_file, "/"); data/wildmidi-0.4.3/src/file_io.c:176:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buffer_file = (char *) malloc(strlen(filename) + 1); data/wildmidi-0.4.3/src/file_io.c:266:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(buffer_fd, data, *size) != (long) *size) { data/wildmidi-0.4.3/src/getopt_long.c:178: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). current_argv_len = strlen(current_argv); data/wildmidi-0.4.3/src/getopt_long.c:186:7: [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(long_options[i].name) == current_argv_len) { data/wildmidi-0.4.3/src/internal_midi.c:2150:97: [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). mdi->extra_info.copyright = (char *) realloc(mdi->extra_info.copyright,(strlen(mdi->extra_info.copyright) + 1 + tmp_length + 1)); data/wildmidi-0.4.3/src/internal_midi.c:2151:59: [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). memcpy(&mdi->extra_info.copyright[strlen(mdi->extra_info.copyright) + 1], event_data, tmp_length); data/wildmidi-0.4.3/src/internal_midi.c:2152:51: [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). mdi->extra_info.copyright[strlen(mdi->extra_info.copyright) + 1 + tmp_length] = '\0'; data/wildmidi-0.4.3/src/internal_midi.c:2153:51: [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). mdi->extra_info.copyright[strlen(mdi->extra_info.copyright)] = '\n'; data/wildmidi-0.4.3/src/lock.c:82:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(500); data/wildmidi-0.4.3/src/wildmidi.c:41:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. #define msleep(s) usleep((s)*1000) data/wildmidi-0.4.3/src/wildmidi.c:1650:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(wav_file, optarg, sizeof(wav_file)); data/wildmidi-0.4.3/src/wildmidi.c:1664:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(midi_file, optarg, sizeof(midi_file)); data/wildmidi-0.4.3/src/wildmidi.c:1672:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file, optarg, sizeof(config_file)); data/wildmidi-0.4.3/src/wildmidi.c:1681:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pcmname, optarg, sizeof(pcmname)); data/wildmidi-0.4.3/src/wildmidi.c:1762:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file, WILDMIDI_CFG, sizeof(config_file)); data/wildmidi-0.4.3/src/wildmidi.c:1881:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(STDIN_FILENO, &ch, 1) != 1) data/wildmidi-0.4.3/src/wildmidi.c:1981:25: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(midi_file, real_file, strlen(real_file)); data/wildmidi-0.4.3/src/wildmidi.c:1981:55: [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). strncpy(midi_file, real_file, strlen(real_file)); data/wildmidi-0.4.3/src/wildmidi.c:1982: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). midi_file[strlen(real_file)-4] = '.'; data/wildmidi-0.4.3/src/wildmidi.c:1983: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). midi_file[strlen(real_file)-3] = 'm'; data/wildmidi-0.4.3/src/wildmidi.c:1984: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). midi_file[strlen(real_file)-2] = 'i'; data/wildmidi-0.4.3/src/wildmidi.c:1985: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). midi_file[strlen(real_file)-1] = 'd'; data/wildmidi-0.4.3/src/wildmidi.c:2045:60: [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). memcpy(&lyrics[MAX_DISPLAY_LYRICS], lyric, strlen(lyric)); data/wildmidi-0.4.3/src/wildmidi.c:2046:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). last_lyric_length = strlen(lyric); data/wildmidi-0.4.3/src/wildmidi_lib.c:247: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 l = strlen(str) + 5; data/wildmidi-0.4.3/src/wildmidi_lib.c:304: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). int line_length = (int) strlen(line_data); data/wildmidi-0.4.3/src/wildmidi_lib.c:392:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_dir, config_file, (dir_end - config_file + 1)); data/wildmidi-0.4.3/src/wildmidi_lib.c:429:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!IS_DIR_SEPARATOR(config_dir[strlen(config_dir) - 1])) { data/wildmidi-0.4.3/src/wildmidi_lib.c:430:40: [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). config_dir[strlen(config_dir) + 1] = '\0'; data/wildmidi-0.4.3/src/wildmidi_lib.c:431:40: [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). config_dir[strlen(config_dir)] = DIR_SEPARATOR_CHAR; data/wildmidi-0.4.3/src/wildmidi_lib.c:442:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). new_config = (char *) malloc(strlen(config_dir) + strlen(line_tokens[1]) + 1); data/wildmidi-0.4.3/src/wildmidi_lib.c:442:79: [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). new_config = (char *) malloc(strlen(config_dir) + strlen(line_tokens[1]) + 1); data/wildmidi-0.4.3/src/wildmidi_lib.c:452:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strcpy(&new_config[strlen(config_dir)], line_tokens[1]); data/wildmidi-0.4.3/src/wildmidi_lib.c:653:67: [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). tmp_patch->filename = (char *) malloc(strlen(config_dir) + strlen(line_tokens[1]) + 5); data/wildmidi-0.4.3/src/wildmidi_lib.c:653:88: [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). tmp_patch->filename = (char *) malloc(strlen(config_dir) + strlen(line_tokens[1]) + 5); data/wildmidi-0.4.3/src/wildmidi_lib.c:2080:52: [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). mdi->tmp_info->copyright = (char *) malloc(strlen(mdi->extra_info.copyright) + 1); ANALYSIS SUMMARY: Hits = 185 Lines analyzed = 19057 in approximately 0.59 seconds (32437 lines/second) Physical Source Lines of Code (SLOC) = 14457 Hits@level = [0] 397 [1] 55 [2] 84 [3] 15 [4] 31 [5] 0 Hits@level+ = [0+] 582 [1+] 185 [2+] 130 [3+] 46 [4+] 31 [5+] 0 Hits/KSLOC@level+ = [0+] 40.2573 [1+] 12.7966 [2+] 8.99218 [3+] 3.18185 [4+] 2.14429 [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.