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/phasex-0.14.97/src/alsa_pcm.c Examining data/phasex-0.14.97/src/alsa_pcm.h Examining data/phasex-0.14.97/src/alsa_seq.h Examining data/phasex-0.14.97/src/bank.c Examining data/phasex-0.14.97/src/bank.h Examining data/phasex-0.14.97/src/bpm.c Examining data/phasex-0.14.97/src/bpm.h Examining data/phasex-0.14.97/src/buffer.c Examining data/phasex-0.14.97/src/buffer.h Examining data/phasex-0.14.97/src/debug.h Examining data/phasex-0.14.97/src/driver.c Examining data/phasex-0.14.97/src/driver.h Examining data/phasex-0.14.97/src/engine.c Examining data/phasex-0.14.97/src/engine.h Examining data/phasex-0.14.97/src/filter.c Examining data/phasex-0.14.97/src/filter.h Examining data/phasex-0.14.97/src/gtkknob.c Examining data/phasex-0.14.97/src/gtkknob.h Examining data/phasex-0.14.97/src/gui_alsa.c Examining data/phasex-0.14.97/src/gui_alsa.h Examining data/phasex-0.14.97/src/gui_bank.c Examining data/phasex-0.14.97/src/gui_bank.h Examining data/phasex-0.14.97/src/gui_jack.c Examining data/phasex-0.14.97/src/gui_jack.h Examining data/phasex-0.14.97/src/gui_layout.c Examining data/phasex-0.14.97/src/gui_layout.h Examining data/phasex-0.14.97/src/gui_main.c Examining data/phasex-0.14.97/src/gui_main.h Examining data/phasex-0.14.97/src/gui_menubar.c Examining data/phasex-0.14.97/src/gui_menubar.h Examining data/phasex-0.14.97/src/gui_midimap.c Examining data/phasex-0.14.97/src/gui_midimap.h Examining data/phasex-0.14.97/src/gui_navbar.c Examining data/phasex-0.14.97/src/gui_navbar.h Examining data/phasex-0.14.97/src/gui_param.c Examining data/phasex-0.14.97/src/gui_param.h Examining data/phasex-0.14.97/src/gui_patch.c Examining data/phasex-0.14.97/src/gui_patch.h Examining data/phasex-0.14.97/src/gui_session.c Examining data/phasex-0.14.97/src/gui_session.h Examining data/phasex-0.14.97/src/help.c Examining data/phasex-0.14.97/src/help.h Examining data/phasex-0.14.97/src/jack.c Examining data/phasex-0.14.97/src/jack.h Examining data/phasex-0.14.97/src/jack_midi.c Examining data/phasex-0.14.97/src/jack_midi.h Examining data/phasex-0.14.97/src/jack_transport.c Examining data/phasex-0.14.97/src/jack_transport.h Examining data/phasex-0.14.97/src/lash.c Examining data/phasex-0.14.97/src/lash.h Examining data/phasex-0.14.97/src/midi_event.c Examining data/phasex-0.14.97/src/midi_event.h Examining data/phasex-0.14.97/src/midi_process.c Examining data/phasex-0.14.97/src/midi_process.h Examining data/phasex-0.14.97/src/mididefs.h Examining data/phasex-0.14.97/src/midimap.c Examining data/phasex-0.14.97/src/midimap.h Examining data/phasex-0.14.97/src/param.c Examining data/phasex-0.14.97/src/param.h Examining data/phasex-0.14.97/src/param_cb.c Examining data/phasex-0.14.97/src/param_cb.h Examining data/phasex-0.14.97/src/param_parse.c Examining data/phasex-0.14.97/src/param_parse.h Examining data/phasex-0.14.97/src/param_strings.c Examining data/phasex-0.14.97/src/param_strings.h Examining data/phasex-0.14.97/src/patch.c Examining data/phasex-0.14.97/src/patch.h Examining data/phasex-0.14.97/src/phasex.h Examining data/phasex-0.14.97/src/rawmidi.c Examining data/phasex-0.14.97/src/rawmidi.h Examining data/phasex-0.14.97/src/session.c Examining data/phasex-0.14.97/src/session.h Examining data/phasex-0.14.97/src/settings.c Examining data/phasex-0.14.97/src/settings.h Examining data/phasex-0.14.97/src/string_util.c Examining data/phasex-0.14.97/src/string_util.h Examining data/phasex-0.14.97/src/timekeeping.c Examining data/phasex-0.14.97/src/timekeeping.h Examining data/phasex-0.14.97/src/wave.c Examining data/phasex-0.14.97/src/wave.h Examining data/phasex-0.14.97/src/alsa_seq.c Examining data/phasex-0.14.97/src/debug.c Examining data/phasex-0.14.97/src/phasex.c FINAL RESULTS: data/phasex-0.14.97/src/alsa_pcm.c:277:40: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. snd_pcm_access_t access, data/phasex-0.14.97/src/alsa_pcm.c:322:53: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. err = snd_pcm_hw_params_set_access(handle, params, access); data/phasex-0.14.97/src/alsa_pcm.c:751:38: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. alsa_pcm_set_hwparams(new_pcm_info, access, 0); data/phasex-0.14.97/src/alsa_pcm.c:778:39: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. alsa_pcm_set_hwparams(new_pcm_info, access, 1); data/phasex-0.14.97/src/alsa_seq.c:260:4: [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(port_str_list, seq_port->alsa_name); data/phasex-0.14.97/src/debug.h:114: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 (main_debug_queue.msgs[main_debug_queue.insert_index].msg, \ data/phasex-0.14.97/src/debug.h:132: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 (main_debug_queue.msgs[main_debug_queue.insert_index].msg, \ data/phasex-0.14.97/src/debug.h:152: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 (main_debug_queue.msgs[main_debug_queue.insert_index].msg, \ data/phasex-0.14.97/src/gui_alsa.c:74:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(label_text, "[%s] %s: %s", data/phasex-0.14.97/src/gui_alsa.c:126:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(label_text, "[%s] %s: %s", data/phasex-0.14.97/src/gui_alsa.c:172:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(label_text, "[%s] %s: %s", data/phasex-0.14.97/src/gui_alsa.c:210:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(label_text, "[%s] %s: %s", data/phasex-0.14.97/src/help.c:338:5: [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(textbuf, linebuf); data/phasex-0.14.97/src/phasex.c:275:8: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(cmd) == -1) { data/phasex-0.14.97/src/phasex.c:318:8: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(cmd) == -1) { data/phasex-0.14.97/src/settings.c:830:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_LIGHT_KNOB_DIR); data/phasex-0.14.97/src/settings.c:835:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_detent_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_LIGHT_DETENT_KNOB_DIR); data/phasex-0.14.97/src/settings.c:842:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_DARK_KNOB_DIR); data/phasex-0.14.97/src/settings.c:847:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_detent_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_DARK_DETENT_KNOB_DIR); data/phasex-0.14.97/src/settings.c:2108:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_LIGHT_KNOB_DIR); data/phasex-0.14.97/src/settings.c:2113:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_detent_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_LIGHT_DETENT_KNOB_DIR); data/phasex-0.14.97/src/settings.c:2128:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_DARK_KNOB_DIR); data/phasex-0.14.97/src/settings.c:2133:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(setting_detent_knob_dir, "%s/%s", PIXMAP_DIR, DEFAULT_DARK_DETENT_KNOB_DIR); data/phasex-0.14.97/src/phasex.c:258: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. home = getenv("HOME"); data/phasex-0.14.97/src/phasex.c:544:7: [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. c = getopt_long(argc, argv, opts, long_opts, NULL); data/phasex-0.14.97/src/settings.c:4508:66: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(button1), g_get_home_dir()); data/phasex-0.14.97/src/settings.c:4553:66: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(button1), g_get_home_dir()); data/phasex-0.14.97/src/settings.c:4598:66: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(button1), g_get_home_dir()); data/phasex-0.14.97/src/alsa_pcm.c:90:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[32]; data/phasex-0.14.97/src/alsa_pcm.c:114: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(name, "hw:%d", card_num); data/phasex-0.14.97/src/alsa_pcm.c:977: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 *capture_samples[alsa_pcm_capture_channels]; data/phasex-0.14.97/src/alsa_pcm.c:982: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 *playback_samples[alsa_pcm_playback_channels]; data/phasex-0.14.97/src/alsa_pcm.c:996:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char c[4]; data/phasex-0.14.97/src/alsa_pcm.c:1014:39: [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. capture_samples[chn] = (((unsigned char *) capture_areas[chn].addr) + data/phasex-0.14.97/src/alsa_pcm.c:1032:39: [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. playback_samples[chn] = (((unsigned char *) playback_areas[chn].addr) + data/phasex-0.14.97/src/alsa_pcm.h:40:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alsa_name[32]; data/phasex-0.14.97/src/alsa_pcm.h:64:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pcm_name[32]; data/phasex-0.14.97/src/alsa_seq.c:409:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char port_str_list[128] = "\0"; data/phasex-0.14.97/src/alsa_seq.c:410:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char client_name[32]; data/phasex-0.14.97/src/alsa_seq.c:411:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char port_name[32]; data/phasex-0.14.97/src/alsa_seq.c:469:18: [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). src_client = atoi(p); data/phasex-0.14.97/src/alsa_seq.c:470:18: [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). src_port = atoi(q + 1); data/phasex-0.14.97/src/alsa_seq.c:587:4: [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(port_str_list, "autohw,"); data/phasex-0.14.97/src/alsa_seq.c:598:4: [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(port_str_list, "autosw,"); data/phasex-0.14.97/src/alsa_seq.h:38:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alsa_name[16]; data/phasex-0.14.97/src/bank.c:135:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/phasex-0.14.97/src/bank.c:150:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((bank_f = fopen(bank_file, "rt")) == NULL) { data/phasex-0.14.97/src/bank.c:151:17: [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 ((bank_f = fopen(user_bank_file, "rt")) == NULL) { data/phasex-0.14.97/src/bank.c:152:18: [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 ((bank_f = fopen(sys_bank_file, "rt")) == NULL) { data/phasex-0.14.97/src/bank.c:172:14: [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). part_num = atoi(p) - 1; data/phasex-0.14.97/src/bank.c:192:10: [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). prog = atoi(p) - 1; data/phasex-0.14.97/src/bank.c:325:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((bank_f = fopen(bank_file, "wt")) == NULL) { data/phasex-0.14.97/src/bank.c:378:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/bank.c:401:22: [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). else if (((prog = atoi(patch_name)) > 0) && (prog <= PATCH_BANK_SIZE)) { data/phasex-0.14.97/src/debug.h:80:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[DEBUG_MESSAGE_SIZE]; data/phasex-0.14.97/src/engine.h:253:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char _padding[36]; data/phasex-0.14.97/src/engine.h:294:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char _padding[16]; data/phasex-0.14.97/src/gui_alsa.c:64:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char label_text[80]; data/phasex-0.14.97/src/gui_bank.c:78:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/gui_bank.c:415:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX] = "\0"; data/phasex-0.14.97/src/gui_bank.c:468:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/gui_bank.c:572:4: [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(filename, "Untitled-%04d", data/phasex-0.14.97/src/gui_bank.c:923:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char patchfile[PATH_MAX]; data/phasex-0.14.97/src/gui_bank.c:1074:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp_name[16]; data/phasex-0.14.97/src/gui_bank.c:1090:2: [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(tmp_name, "Untitled-%04d", (get_visible_program_number() + 1)); data/phasex-0.14.97/src/gui_bank.h:45: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. extern char *modified_label_text[2]; data/phasex-0.14.97/src/gui_main.c:655:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/gui_main.c:795:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char knob_file[PATH_MAX]; data/phasex-0.14.97/src/gui_main.c:796:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char window_title[10]; data/phasex-0.14.97/src/gui_navbar.c:82: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 *modified_label_text[2] = { " ", "!" }; data/phasex-0.14.97/src/gui_navbar.c:156:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char label_text[64]; data/phasex-0.14.97/src/gui_navbar.h:53: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. extern char *modified_label_text[2]; data/phasex-0.14.97/src/gui_patch.c:104:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpname[PATCH_NAME_LEN]; data/phasex-0.14.97/src/gui_session.c:73:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char directory[PATH_MAX]; data/phasex-0.14.97/src/gui_session.c:111:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/gui_session.c:189:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char directory[PATH_MAX] = "\0"; data/phasex-0.14.97/src/gui_session.c:239:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char directory[PATH_MAX]; data/phasex-0.14.97/src/gui_session.c:344:4: [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(directory, "Untitled-%04d", visible_sess_num); data/phasex-0.14.97/src/help.c:111:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((license_file = fopen(PHASEX_LICENSE_FILE, "r")) == NULL) { data/phasex-0.14.97/src/help.c:114:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((license_file = fopen(ALT_LICENSE_FILE, "r")) == NULL) { data/phasex-0.14.97/src/help.c:130:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((license_file = fopen(GPLv3_LICENSE_FILE, "r")) == NULL) { data/phasex-0.14.97/src/help.c:133:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((license_file = fopen(ALT_GPLv3_FILE, "r")) == NULL) { data/phasex-0.14.97/src/help.c:258:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char linebuf[256]; data/phasex-0.14.97/src/help.c:274:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((help_f = fopen(PARAM_HELPFILE, "rt")) == NULL) { data/phasex-0.14.97/src/jack.c:61: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 jack_audio_client_name[64] = "phasex"; data/phasex-0.14.97/src/jack.c:137: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((void *) out1, (void *) & (part->output_buffer1[a_index]), data/phasex-0.14.97/src/jack.c:139: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((void *) out2, (void *) & (part->output_buffer2[a_index]), data/phasex-0.14.97/src/jack.c:155: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((void *) & (input_buffer1[a_index]), (void *) in1, data/phasex-0.14.97/src/jack.c:157: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((void *) & (input_buffer2[a_index]), (void *) in2, data/phasex-0.14.97/src/jack.c:228: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((void *) & (input_buffer1[a_index]), (void *) in1, data/phasex-0.14.97/src/jack.c:230: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((void *) & (input_buffer2[a_index]), (void *) in2, data/phasex-0.14.97/src/jack.c:329:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char client_match[64]; data/phasex-0.14.97/src/jack.c:775:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[256]; data/phasex-0.14.97/src/jack.c:807:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char port_name[16]; data/phasex-0.14.97/src/midi_event.c:123: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(queue_event, event, sizeof(MIDI_EVENT)); data/phasex-0.14.97/src/midi_event.c:144:4: [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(bulk_event, event, sizeof(MIDI_EVENT)); data/phasex-0.14.97/src/midimap.c:137:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/phasex-0.14.97/src/midimap.c:138:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char param_name[32]; data/phasex-0.14.97/src/midimap.c:149:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((map_f = fopen(filename, "rt")) == NULL) { data/phasex-0.14.97/src/midimap.c:194:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). part_num = (unsigned int)(atoi(&(param_name[13])) - 1); data/phasex-0.14.97/src/midimap.c:223: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). cc_num = atoi(p); data/phasex-0.14.97/src/midimap.c:230: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). cc_num = atoi(p) - 1; data/phasex-0.14.97/src/midimap.c:317:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((map_f = fopen(filename, "wt")) == NULL) { data/phasex-0.14.97/src/param.c:206: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. snprintf((char *)(numeric_label_list[j]), data/phasex-0.14.97/src/param.h:271:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char _padding[16]; data/phasex-0.14.97/src/param.h:291:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char _padding[24]; data/phasex-0.14.97/src/param_parse.c:203:20: [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). else if (((wave = atoi(token)) > 0) && (wave < NUM_WAVEFORMS)) { data/phasex-0.14.97/src/param_parse.c:246:9: [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). return atoi(token) % 128; data/phasex-0.14.97/src/patch.c:315:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char new_file_name[PATH_MAX]; data/phasex-0.14.97/src/patch.c:316:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lash_patch_filename[16]; data/phasex-0.14.97/src/patch.c:324:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char param_name[32]; data/phasex-0.14.97/src/patch.c:325:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char param_str_val[32]; data/phasex-0.14.97/src/patch.c:327:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[128]; data/phasex-0.14.97/src/patch.c:349:19: [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 ((patch_f = fopen(new_file_name, "rt")) != NULL) { data/phasex-0.14.97/src/patch.c:357:22: [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). else if ((patch_f = fopen(filename, "rt")) == NULL) { data/phasex-0.14.97/src/patch.c:385: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(p, filename, (strlen(filename) + 1)); data/phasex-0.14.97/src/patch.c:517:29: [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). param->value.int_val = atoi(param_str_val); data/phasex-0.14.97/src/patch.c:574:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lash_patch_filename[16]; data/phasex-0.14.97/src/patch.c:600:17: [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 ((patch_f = fopen(filename, "wt")) == NULL) { data/phasex-0.14.97/src/patch.c:630: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(tmp, filename, (strlen(filename) + 1)); data/phasex-0.14.97/src/patch.h:196:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char padding[14]; data/phasex-0.14.97/src/phasex.c:118: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 user_data_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:119: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 user_patch_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:120: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 user_session_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:121: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 user_midimap_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:122: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 user_bank_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:123: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 user_session_bank_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:124: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 user_session_dump_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:125: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 user_patchdump_file[MAX_PARTS][PATH_MAX]; data/phasex-0.14.97/src/phasex.c:126: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 user_midimap_dump_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:127: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 user_config_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:128: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 user_default_patch[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:129: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 sys_default_patch[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:130: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 sys_bank_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:189:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/phasex-0.14.97/src/phasex.c:190:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:209:7: [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(procdir->d_name) == self_pid) { data/phasex-0.14.97/src/phasex.c:220:18: [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 ((cmdfile = fopen(filename, "rt")) == NULL) { data/phasex-0.14.97/src/phasex.c:252:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[1024]; data/phasex-0.14.97/src/phasex.c:253:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char old_patch_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:463:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char opts[NUM_OPTS * 2 + 1]; data/phasex-0.14.97/src/phasex.c:464:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/phasex.c:565: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). setting_sample_rate = atoi(optarg); data/phasex-0.14.97/src/phasex.c:571:44: [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). setting_buffer_latency = (unsigned int) atoi(optarg); data/phasex-0.14.97/src/phasex.c:577:48: [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). setting_buffer_period_size = (unsigned int) atoi(optarg); data/phasex-0.14.97/src/phasex.c:612: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). bpm_override = (unsigned int) atoi(optarg); data/phasex-0.14.97/src/phasex.h:458: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. extern char user_data_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:459: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. extern char user_patch_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:460: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. extern char user_midimap_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:461: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. extern char user_session_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:462: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. extern char user_bank_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:463: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. extern char user_session_bank_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:464: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. extern char user_patchdump_file[MAX_PARTS][PATH_MAX]; data/phasex-0.14.97/src/phasex.h:465: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. extern char user_session_dump_dir[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:466: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. extern char user_midimap_dump_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:467: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. extern char user_config_file[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:468: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. extern char user_default_patch[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:469: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. extern char sys_default_patch[PATH_MAX]; data/phasex-0.14.97/src/phasex.h:470: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. extern char sys_bank_file[PATH_MAX]; data/phasex-0.14.97/src/rawmidi.c:50: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. unsigned char midi_realtime_type[32]; data/phasex-0.14.97/src/rawmidi.c:128:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alsa_name[32]; data/phasex-0.14.97/src/rawmidi.c:140: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(alsa_name, "hw:%d", card_num); data/phasex-0.14.97/src/rawmidi.c:297: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 ((rawmidi->fd = open(rawmidi->device, flags)) < 0) { data/phasex-0.14.97/src/rawmidi.c:311: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 ((rawmidi->fd = open(rawmidi->device, flags)) < 0) { data/phasex-0.14.97/src/rawmidi.c:509: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 ibuf[4]; data/phasex-0.14.97/src/rawmidi.c:513:18: [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 unsigned char read_buf[256]; data/phasex-0.14.97/src/rawmidi.c:655:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2]; data/phasex-0.14.97/src/rawmidi.h:67:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alsa_name[32]; data/phasex-0.14.97/src/session.c:149:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/session.c:204:4: [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(filename, "Untitled-%04d", sess_num); data/phasex-0.14.97/src/session.c:262:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char directory[PATH_MAX]; data/phasex-0.14.97/src/session.c:264:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/phasex-0.14.97/src/session.c:270:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char loaded[SESSION_BANK_SIZE]; data/phasex-0.14.97/src/session.c:290:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((session_bank_f = fopen(session_bank_file, "r")) == NULL) { data/phasex-0.14.97/src/session.c:291:25: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((session_bank_f = fopen(user_session_bank_file, "r")) == NULL) { data/phasex-0.14.97/src/session.c:311:12: [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). result = atoi(p) - 1; data/phasex-0.14.97/src/session.c:429:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/session.c:523:6: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(patch, & (new_session->patch[part_num]), sizeof(PATCH)); data/phasex-0.14.97/src/session.c:563:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((session_bank_f = fopen(session_bank_file, "wt")) == NULL) { data/phasex-0.14.97/src/settings.c:181: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 audio_driver_status_msg[256]; data/phasex-0.14.97/src/settings.c:246:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char setting_name[64]; data/phasex-0.14.97/src/settings.c:247:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char setting_value[256]; data/phasex-0.14.97/src/settings.c:248:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/phasex-0.14.97/src/settings.c:280:18: [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 ((config_f = fopen(config_file, "rt")) != NULL) { data/phasex-0.14.97/src/settings.c:445: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). setting_sample_rate = atoi(setting_value); data/phasex-0.14.97/src/settings.c:465:49: [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). setting_buffer_period_size = (unsigned int) atoi(setting_value); data/phasex-0.14.97/src/settings.c:513:45: [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). setting_buffer_latency = (unsigned int) atoi(setting_value); data/phasex-0.14.97/src/settings.c:558:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). setting_refresh_interval = atoi(setting_value) / 1000; data/phasex-0.14.97/src/settings.c:568:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). setting_refresh_interval = atoi(setting_value); data/phasex-0.14.97/src/settings.c:578:29: [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). setting_midi_priority = atoi(setting_value); data/phasex-0.14.97/src/settings.c:592:31: [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). setting_engine_priority = atoi(setting_value); data/phasex-0.14.97/src/settings.c:606:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). setting_audio_priority = atoi(setting_value); data/phasex-0.14.97/src/settings.c:639: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). setting_polyphony = atoi(setting_value); data/phasex-0.14.97/src/settings.c:892:18: [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 ((config_f = fopen(config_file, "wt")) == NULL) { data/phasex-0.14.97/src/settings.h:166: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. extern char audio_driver_status_msg[256]; data/phasex-0.14.97/src/string_util.c:43:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char token_buf[256]; data/phasex-0.14.97/src/wave.c:558:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/phasex-0.14.97/src/wave.c:603:17: [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 ((rawfile = fopen(filename, "rb")) != 0) { data/phasex-0.14.97/src/alsa_pcm.c:889:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(new_pcm_info->pcm_name, alsa_pcm_device, sizeof(new_pcm_info->pcm_name)); data/phasex-0.14.97/src/alsa_pcm.c:909:3: [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(125000); data/phasex-0.14.97/src/alsa_pcm.c:920:3: [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(125000); data/phasex-0.14.97/src/alsa_pcm.c:1157:4: [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(100); /* wait until the suspend flag is released */ data/phasex-0.14.97/src/alsa_seq.c:261:4: [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(port_str_list, ","); data/phasex-0.14.97/src/alsa_seq.c:453: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 ((tokbuf = alloca(strlen((const char *) alsa_port) * 4)) == NULL) { data/phasex-0.14.97/src/alsa_seq.c:718:2: [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(125000); data/phasex-0.14.97/src/bank.c:388: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 ((tokbuf = alloca(strlen(patch_list) * 4)) == NULL) { data/phasex-0.14.97/src/debug.c:92:3: [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(16000 >> PHASEX_CPU_POWER); data/phasex-0.14.97/src/driver.c:474:4: [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(125000); data/phasex-0.14.97/src/driver.c:479:4: [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(125000); data/phasex-0.14.97/src/driver.c:494:3: [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(125000); data/phasex-0.14.97/src/driver.c:512:2: [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(125000); data/phasex-0.14.97/src/driver.c:526:4: [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(125000); data/phasex-0.14.97/src/driver.c:677:3: [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(125000); data/phasex-0.14.97/src/engine.c:620: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(sleep_time.tv_nsec / 1000); data/phasex-0.14.97/src/engine.c:756:4: [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(100000); data/phasex-0.14.97/src/engine.c:760:2: [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(150000); data/phasex-0.14.97/src/gui_main.c:130:3: [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(1000); data/phasex-0.14.97/src/gui_main.c:133:3: [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(125000); data/phasex-0.14.97/src/gui_main.c:183:3: [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(1000); data/phasex-0.14.97/src/help.c:115:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(license, short_license, LICENSE_SIZE); data/phasex-0.14.97/src/help.c:127: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). j = strlen(license); data/phasex-0.14.97/src/help.c:333:6: [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(textbuf, "\n"); data/phasex-0.14.97/src/jack.c:334:3: [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(1000); data/phasex-0.14.97/src/jack.c:343:42: [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). (strncmp(cur->name, client_match, strlen(client_match)) == 0)) { data/phasex-0.14.97/src/jack.c:386:3: [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(1000); data/phasex-0.14.97/src/jack.c:480:3: [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(1000); data/phasex-0.14.97/src/jack.c:517:3: [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(1000); data/phasex-0.14.97/src/jack.c:1478:3: [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(125000); data/phasex-0.14.97/src/lash.c:125:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p = dir + strlen(dir) - 1; data/phasex-0.14.97/src/midimap.c:188:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_name, p, sizeof(param_name)); data/phasex-0.14.97/src/midimap.c:341: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). k = 32 - (unsigned int) strlen(param->info->name); data/phasex-0.14.97/src/patch.c:385: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). memcpy(p, filename, (strlen(filename) + 1)); data/phasex-0.14.97/src/patch.c:387:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). j = (int) strlen(token) - 4; data/phasex-0.14.97/src/patch.c:463:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_name, p, (sizeof(param_name) - 1)); data/phasex-0.14.97/src/patch.c:480:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_str_val, p, (sizeof(param_str_val) - 1)); data/phasex-0.14.97/src/patch.c:630:26: [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(tmp, filename, (strlen(filename) + 1)); data/phasex-0.14.97/src/patch.c:632:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). j = (int) strlen(name) - 4; data/phasex-0.14.97/src/patch.c:686: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). j = 32 - (int) strlen(param->info->name); data/phasex-0.14.97/src/rawmidi.c:527:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(rawmidi->fd, ibuf, 4) != 4) { data/phasex-0.14.97/src/rawmidi.c:606:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(rawmidi->fd, &buf[bytes_read], 1) == 1) { data/phasex-0.14.97/src/rawmidi.c:613:6: [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(rawmidi_sleep_time); data/phasex-0.14.97/src/rawmidi.c:619:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (read(rawmidi->fd, &buf[bytes_read], 1) == 1)) { data/phasex-0.14.97/src/rawmidi.c:687:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read(rawmidi->fd, buf, 1) == 1) { data/phasex-0.14.97/src/rawmidi.c:688:4: [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(100); data/phasex-0.14.97/src/rawmidi.c:706:4: [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(100); data/phasex-0.14.97/src/rawmidi.c:850:2: [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(125000); data/phasex-0.14.97/src/session.c:210:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(filename, directory, PATH_MAX); data/phasex-0.14.97/src/session.c:339:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(directory, tmpname, (sizeof(directory) - 1)); data/phasex-0.14.97/src/session.c:491:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(filename, session->directory, PATH_MAX); data/phasex-0.14.97/src/settings.c:304:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(setting_name, p, sizeof(setting_name)); data/phasex-0.14.97/src/settings.c:320:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(setting_value, p, sizeof(setting_value)); data/phasex-0.14.97/src/settings.c:829: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_LIGHT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:829: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_LIGHT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:833: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). setting_detent_knob_dir = malloc(strlen(PIXMAP_DIR) + data/phasex-0.14.97/src/settings.c:834: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). strlen(DEFAULT_LIGHT_DETENT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:841: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_DARK_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:841: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_DARK_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:845: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). setting_detent_knob_dir = malloc(strlen(PIXMAP_DIR) + data/phasex-0.14.97/src/settings.c:846: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). strlen(DEFAULT_DARK_DETENT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2107: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_LIGHT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2107: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_LIGHT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2112: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). setting_detent_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_LIGHT_DETENT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2112: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). setting_detent_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_LIGHT_DETENT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2127: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_DARK_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2127: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). setting_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_DARK_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2132: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). setting_detent_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_DARK_DETENT_KNOB_DIR) + 2); data/phasex-0.14.97/src/settings.c:2132: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). setting_detent_knob_dir = malloc(strlen(PIXMAP_DIR) + strlen(DEFAULT_DARK_DETENT_KNOB_DIR) + 2); data/phasex-0.14.97/src/string_util.c:107:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(token_buf, token_begin, len); ANALYSIS SUMMARY: Hits = 268 Lines analyzed = 37617 in approximately 0.98 seconds (38537 lines/second) Physical Source Lines of Code (SLOC) = 27211 Hits@level = [0] 230 [1] 70 [2] 170 [3] 5 [4] 23 [5] 0 Hits@level+ = [0+] 498 [1+] 268 [2+] 198 [3+] 28 [4+] 23 [5+] 0 Hits/KSLOC@level+ = [0+] 18.3014 [1+] 9.84896 [2+] 7.27647 [3+] 1.029 [4+] 0.845246 [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.