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/petri-foo-0.1.87/gui/audio-settings.c Examining data/petri-foo-0.1.87/gui/audio-settings.h Examining data/petri-foo-0.1.87/gui/bank-ops.c Examining data/petri-foo-0.1.87/gui/bank-ops.h Examining data/petri-foo-0.1.87/gui/basic_combos.c Examining data/petri-foo-0.1.87/gui/basic_combos.h Examining data/petri-foo-0.1.87/gui/bool_section.c Examining data/petri-foo-0.1.87/gui/bool_section.h Examining data/petri-foo-0.1.87/gui/channelsection.c Examining data/petri-foo-0.1.87/gui/channelsection.h Examining data/petri-foo-0.1.87/gui/envelopetab.c Examining data/petri-foo-0.1.87/gui/envelopetab.h Examining data/petri-foo-0.1.87/gui/float_section.c Examining data/petri-foo-0.1.87/gui/float_section.h Examining data/petri-foo-0.1.87/gui/global_settings.c Examining data/petri-foo-0.1.87/gui/global_settings.h Examining data/petri-foo-0.1.87/gui/gui.c Examining data/petri-foo-0.1.87/gui/gui.h Examining data/petri-foo-0.1.87/gui/idselector.c Examining data/petri-foo-0.1.87/gui/idselector.h Examining data/petri-foo-0.1.87/gui/lfotab.c Examining data/petri-foo-0.1.87/gui/lfotab.h Examining data/petri-foo-0.1.87/gui/log_display.c Examining data/petri-foo-0.1.87/gui/log_display.h Examining data/petri-foo-0.1.87/gui/mastersection.c Examining data/petri-foo-0.1.87/gui/mastersection.h Examining data/petri-foo-0.1.87/gui/midisection.c Examining data/petri-foo-0.1.87/gui/midisection.h Examining data/petri-foo-0.1.87/gui/mod_section.c Examining data/petri-foo-0.1.87/gui/mod_section.h Examining data/petri-foo-0.1.87/gui/mod_src_gui.c Examining data/petri-foo-0.1.87/gui/mod_src_gui.h Examining data/petri-foo-0.1.87/gui/nsm.h Examining data/petri-foo-0.1.87/gui/paramtab.c Examining data/petri-foo-0.1.87/gui/paramtab.h Examining data/petri-foo-0.1.87/gui/patchlist.c Examining data/petri-foo-0.1.87/gui/patchlist.h Examining data/petri-foo-0.1.87/gui/patchsection.c Examining data/petri-foo-0.1.87/gui/patchsection.h Examining data/petri-foo-0.1.87/gui/petri-foo.c Examining data/petri-foo-0.1.87/gui/sample-editor.c Examining data/petri-foo-0.1.87/gui/sample-editor.h Examining data/petri-foo-0.1.87/gui/sample-selector.c Examining data/petri-foo-0.1.87/gui/sample-selector.h Examining data/petri-foo-0.1.87/gui/sampletab.c Examining data/petri-foo-0.1.87/gui/sampletab.h Examining data/petri-foo-0.1.87/gui/session.h Examining data/petri-foo-0.1.87/gui/voicetab.c Examining data/petri-foo-0.1.87/gui/voicetab.h Examining data/petri-foo-0.1.87/gui/waveform.c Examining data/petri-foo-0.1.87/gui/waveform.h Examining data/petri-foo-0.1.87/gui/session.c Examining data/petri-foo-0.1.87/libpetrifoo/adsr.c Examining data/petri-foo-0.1.87/libpetrifoo/adsr.h Examining data/petri-foo-0.1.87/libpetrifoo/driver.c Examining data/petri-foo-0.1.87/libpetrifoo/driver.h Examining data/petri-foo-0.1.87/libpetrifoo/instance.c Examining data/petri-foo-0.1.87/libpetrifoo/instance.h Examining data/petri-foo-0.1.87/libpetrifoo/jackdriver.c Examining data/petri-foo-0.1.87/libpetrifoo/jackdriver.h Examining data/petri-foo-0.1.87/libpetrifoo/lfo.c Examining data/petri-foo-0.1.87/libpetrifoo/lfo.h Examining data/petri-foo-0.1.87/libpetrifoo/maths.c Examining data/petri-foo-0.1.87/libpetrifoo/maths.h Examining data/petri-foo-0.1.87/libpetrifoo/midi.c Examining data/petri-foo-0.1.87/libpetrifoo/midi.h Examining data/petri-foo-0.1.87/libpetrifoo/midi_control.h Examining data/petri-foo-0.1.87/libpetrifoo/mixer.c Examining data/petri-foo-0.1.87/libpetrifoo/mixer.h Examining data/petri-foo-0.1.87/libpetrifoo/mod_src.c Examining data/petri-foo-0.1.87/libpetrifoo/mod_src.h Examining data/petri-foo-0.1.87/libpetrifoo/names.c Examining data/petri-foo-0.1.87/libpetrifoo/names.h Examining data/petri-foo-0.1.87/libpetrifoo/patch.c Examining data/petri-foo-0.1.87/libpetrifoo/patch.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/err_msg.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_data.c Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_data.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_defs.c Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_defs.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_event_data.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_macros.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_voice.c Examining data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_voice.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_set_and_get.c Examining data/petri-foo-0.1.87/libpetrifoo/patch_set_and_get.h Examining data/petri-foo-0.1.87/libpetrifoo/patch_util.c Examining data/petri-foo-0.1.87/libpetrifoo/patch_util.h Examining data/petri-foo-0.1.87/libpetrifoo/petri-foo.h Examining data/petri-foo-0.1.87/libpetrifoo/pf_error.c Examining data/petri-foo-0.1.87/libpetrifoo/pf_error.h Examining data/petri-foo-0.1.87/libpetrifoo/sample.c Examining data/petri-foo-0.1.87/libpetrifoo/sample.h Examining data/petri-foo-0.1.87/libpetrifoo/sync.c Examining data/petri-foo-0.1.87/libpetrifoo/sync.h Examining data/petri-foo-0.1.87/libpetrifoo/ticks.c Examining data/petri-foo-0.1.87/libpetrifoo/ticks.h Examining data/petri-foo-0.1.87/libpetrifui/dish_file.c Examining data/petri-foo-0.1.87/libpetrifui/dish_file.h Examining data/petri-foo-0.1.87/libpetrifui/file_ops.c Examining data/petri-foo-0.1.87/libpetrifui/file_ops.h Examining data/petri-foo-0.1.87/libpetrifui/msg_log.c Examining data/petri-foo-0.1.87/libpetrifui/msg_log.h Examining data/petri-foo-0.1.87/libphin/phin.h Examining data/petri-foo-0.1.87/libphin/phinhkeyboard.c Examining data/petri-foo-0.1.87/libphin/phinhkeyboard.h Examining data/petri-foo-0.1.87/libphin/phinhslider.c Examining data/petri-foo-0.1.87/libphin/phinhslider.h Examining data/petri-foo-0.1.87/libphin/phinkeyboard.c Examining data/petri-foo-0.1.87/libphin/phinkeyboard.h Examining data/petri-foo-0.1.87/libphin/phinprivate.c Examining data/petri-foo-0.1.87/libphin/phinprivate.h Examining data/petri-foo-0.1.87/libphin/phinslider.c Examining data/petri-foo-0.1.87/libphin/phinslider.h Examining data/petri-foo-0.1.87/libphin/phinsliderbutton.c Examining data/petri-foo-0.1.87/libphin/phinsliderbutton.h Examining data/petri-foo-0.1.87/libphin/phinvkeyboard.c Examining data/petri-foo-0.1.87/libphin/phinvkeyboard.h Examining data/petri-foo-0.1.87/libphin/phinvslider.c Examining data/petri-foo-0.1.87/libphin/phinvslider.h FINAL RESULTS: data/petri-foo-0.1.87/libpetrifui/file_ops.c:387:20: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if ((len = readlink(path, buf, maxlen)) == -1) data/petri-foo-0.1.87/gui/waveform.c:771:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. if (snprintf(buf, 80, fmt, n) < 0) data/petri-foo-0.1.87/gui/waveform.c:780:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, buf); data/petri-foo-0.1.87/libpetrifoo/instance.c:52:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(instance_name, str); data/petri-foo-0.1.87/libpetrifoo/names.c:71: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(idname->name, name); data/petri-foo-0.1.87/libpetrifoo/names.c:109:18: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. if ((n = snprintf(buf, blen, name_fmt, i + 1))) data/petri-foo-0.1.87/libpetrifoo/patch_private/err_msg.h:31: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, __VA_ARGS__); \ data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_data.c:283:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dest->name, src->name); data/petri-foo-0.1.87/libpetrifoo/petri-foo.h:54: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, __VA_ARGS__); \ data/petri-foo-0.1.87/libpetrifui/file_ops.c:70:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(newstr, str1); data/petri-foo-0.1.87/libpetrifui/file_ops.c:79: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(newstr, str2); data/petri-foo-0.1.87/libpetrifui/msg_log.c:74:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, str1); data/petri-foo-0.1.87/libpetrifui/msg_log.c:75: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(str, str2); data/petri-foo-0.1.87/libpetrifui/msg_log.c:126:9: [4] (format) vsnprintf: 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. if (vsnprintf(tmp, 1023, fmt, ap) >= 1023) data/petri-foo-0.1.87/libphin/phinprivate.h:47:31: [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. #define debug(...) if (DEBUG) fprintf (stderr, __VA_ARGS__) data/petri-foo-0.1.87/gui/global_settings.c:47:44: [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. gbl_settings->last_sample_dir = strdup(getenv("HOME")); data/petri-foo-0.1.87/gui/global_settings.c:48:42: [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. gbl_settings->last_bank_dir = strdup(getenv("HOME")); data/petri-foo-0.1.87/gui/session.c:144:15: [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. nsm_url = getenv( "NSM_URL" ); data/petri-foo-0.1.87/gui/session.c:157:18: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((opt = getopt_long(argc, argv, "aj:uU:", opts, &opt_ix)) > 0) data/petri-foo-0.1.87/gui/bank-ops.c:275: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). static int open(GtkWidget* parent_window, gboolean not_import) data/petri-foo-0.1.87/gui/bank-ops.c:366: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(parent_window, TRUE); data/petri-foo-0.1.87/gui/bank-ops.c:372: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(parent_window, FALSE); data/petri-foo-0.1.87/gui/global_settings.c:194: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[CHARBUFSIZE]; data/petri-foo-0.1.87/gui/gui.c:249: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[80]; data/petri-foo-0.1.87/gui/gui.c:841: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[8000]; data/petri-foo-0.1.87/gui/mod_section.c:281: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[80]; data/petri-foo-0.1.87/gui/mod_section.c:388:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[10]; data/petri-foo-0.1.87/gui/nsm.h:110:24: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). nsm_open_callback *open; data/petri-foo-0.1.87/gui/nsm.h:366:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( ! nsm->open ) data/petri-foo-0.1.87/gui/nsm.h:369:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int r = nsm->open( &argv[0]->s, &argv[1]->s, &argv[2]->s, &out_msg, nsm->open_userdata ); data/petri-foo-0.1.87/gui/sample-editor.c:191: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[40]; data/petri-foo-0.1.87/gui/sample-selector.c:422: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 pat[10]; data/petri-foo-0.1.87/gui/session.c:464: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 command_buf[8192]; data/petri-foo-0.1.87/gui/waveform.c:769: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[80]; data/petri-foo-0.1.87/libpetrifoo/mod_src.c:44: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[80]; data/petri-foo-0.1.87/libpetrifoo/names.c:105: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[blen]; data/petri-foo-0.1.87/libpetrifoo/patch_private/patch_data.h:90: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[PATCH_MAX_NAME]; data/petri-foo-0.1.87/libpetrifoo/sample.c:434: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(dest->sp, src->sp, bytes); data/petri-foo-0.1.87/libpetrifui/dish_file.c:189: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/dish_file.c:215: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/dish_file.c:302: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/dish_file.c:348: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/dish_file.c:386: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/dish_file.c:436: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/dish_file.c:533: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[CHARBUFSIZE]; data/petri-foo-0.1.87/libpetrifui/file_ops.c:268:38: [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 ((dfile = fopen(dfilename, "w"))) data/petri-foo-0.1.87/libpetrifui/msg_log.c:92: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 msg[1024]; data/petri-foo-0.1.87/libpetrifui/msg_log.c:93: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 tm[20]; data/petri-foo-0.1.87/libpetrifui/msg_log.c:94: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 tmp[1024]; data/petri-foo-0.1.87/gui/gui.c:234:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int val = strlen((char *)gtk_entry_get_text(GTK_ENTRY (entry))); data/petri-foo-0.1.87/gui/session.c:444:10: [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). lc = strlen(bank_dir) - 1; data/petri-foo-0.1.87/gui/waveform.c:774:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(buf); data/petri-foo-0.1.87/libpetrifoo/instance.c:49:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(str); data/petri-foo-0.1.87/libpetrifoo/mod_src.c:331:9: [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(str) != 3) data/petri-foo-0.1.87/libpetrifoo/mod_src.c:343:9: [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(str) != 5) data/petri-foo-0.1.87/libpetrifoo/names.c:70:31: [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). idname->name = malloc(strlen(name) + 1); data/petri-foo-0.1.87/libpetrifoo/patch_set_and_get.c:608:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (patches[patch_id]->name, name, PATCH_MAX_NAME); data/petri-foo-0.1.87/libpetrifui/dish_file.c:845:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (prop && strlen((const char*)prop) > 0) data/petri-foo-0.1.87/libpetrifui/file_ops.c:54:14: [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). newlen = strlen(str1) + strlen(str2); data/petri-foo-0.1.87/libpetrifui/file_ops.c:54: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). newlen = strlen(str1) + strlen(str2); data/petri-foo-0.1.87/libpetrifui/file_ops.c:74:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* n = newstr + strlen(newstr); data/petri-foo-0.1.87/libpetrifui/file_ops.c:92:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert(strlen(str) > 0); data/petri-foo-0.1.87/libpetrifui/file_ops.c:137:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*retstr1, str, d); data/petri-foo-0.1.87/libpetrifui/file_ops.c:156:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t lc = strlen(path) - 1; data/petri-foo-0.1.87/libpetrifui/file_ops.c:179:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). parentlen = strlen(parent); data/petri-foo-0.1.87/libpetrifui/file_ops.c:203:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path); data/petri-foo-0.1.87/libpetrifui/msg_log.c:69: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). char* str = malloc(strlen(str1) + strlen(str2) + 1); data/petri-foo-0.1.87/libpetrifui/msg_log.c:69: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). char* str = malloc(strlen(str1) + strlen(str2) + 1); data/petri-foo-0.1.87/libphin/phinsliderbutton.c:1682: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). prefix_len = strlen (p->prefix); data/petri-foo-0.1.87/libphin/phinsliderbutton.c:1685:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). postfix_len = strlen (p->postfix); ANALYSIS SUMMARY: Hits = 70 Lines analyzed = 29453 in approximately 0.61 seconds (47951 lines/second) Physical Source Lines of Code (SLOC) = 18949 Hits@level = [0] 82 [1] 21 [2] 30 [3] 4 [4] 14 [5] 1 Hits@level+ = [0+] 152 [1+] 70 [2+] 49 [3+] 19 [4+] 15 [5+] 1 Hits/KSLOC@level+ = [0+] 8.02153 [1+] 3.69413 [2+] 2.58589 [3+] 1.00269 [4+] 0.791599 [5+] 0.0527732 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.