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/blop-0.2.8/src/quantiser.so.c Examining data/blop-0.2.8/src/interpolator_1660.so.c Examining data/blop-0.2.8/src/wavedata.c Examining data/blop-0.2.8/src/sum_1665.so.c Examining data/blop-0.2.8/src/sequencer.so.c Examining data/blop-0.2.8/src/fmod_1656.so.c Examining data/blop-0.2.8/src/difference_2030.so.c Examining data/blop-0.2.8/src/square_1643.so.c Examining data/blop-0.2.8/src/amp_1654.so.c Examining data/blop-0.2.8/src/triangle_1649.so.c Examining data/blop-0.2.8/src/branch_1673.so.c Examining data/blop-0.2.8/src/random_1661.so.c Examining data/blop-0.2.8/src/adsr_1653.so.c Examining data/blop-0.2.8/src/wavegen.c Examining data/blop-0.2.8/src/tracker_2025.so.c Examining data/blop-0.2.8/src/product_1668.so.c Examining data/blop-0.2.8/src/lp4pole_1671.so.c Examining data/blop-0.2.8/src/lp4pole_filter.c Examining data/blop-0.2.8/src/sync_pulse_2023.so.c Examining data/blop-0.2.8/src/sawtooth_1641.so.c Examining data/blop-0.2.8/src/wdatutil.c Examining data/blop-0.2.8/src/pulse_1645.so.c Examining data/blop-0.2.8/src/adsr_1680.so.c Examining data/blop-0.2.8/src/include/float_cast.h Examining data/blop-0.2.8/src/include/wavedata.h Examining data/blop-0.2.8/src/include/common.h Examining data/blop-0.2.8/src/include/lp4pole_filter.h Examining data/blop-0.2.8/src/include/gettext.h Examining data/blop-0.2.8/src/include/interpolate.h Examining data/blop-0.2.8/src/include/wdatutil.h Examining data/blop-0.2.8/src/include/math_func.h Examining data/blop-0.2.8/src/ratio_2034.so.c Examining data/blop-0.2.8/src/dahdsr_2021.so.c Examining data/blop-0.2.8/src/sync_square_1678.so.c FINAL RESULTS: data/blop-0.2.8/src/quantiser.so.c:584:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (name, G_("Quantiser (%d Steps)"), QUANTISER_MAX_INPUTS); data/blop-0.2.8/src/quantiser.so.c:585:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (loop_point_label, G_("Steps (1 - %d)"), QUANTISER_MAX_INPUTS); data/blop-0.2.8/src/quantiser.so.c:649:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value_labels[step_index], G_("Value %d"), step_index); data/blop-0.2.8/src/sequencer.so.c:258:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (name, G_("Analogue Style %d Step Sequencer"), SEQUENCER_MAX_INPUTS); data/blop-0.2.8/src/sequencer.so.c:259:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (loop_point_label, G_("Loop Steps (1 - %d)"), SEQUENCER_MAX_INPUTS); data/blop-0.2.8/src/sequencer.so.c:322:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value_labels[step_index], G_("Value Step %d"), step_index); data/blop-0.2.8/src/random_1661.so.c:102:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand ((int) time ((time_t *) 0)); data/blop-0.2.8/src/wavedata.c:39:16: [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. ladspa_path = getenv("LADSPA_PATH"); data/blop-0.2.8/src/wavegen.c:129:16: [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, options, long_options, &option_index)) != -1) data/blop-0.2.8/src/quantiser.so.c:551: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 label[32]; data/blop-0.2.8/src/quantiser.so.c:552: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 name[32]; data/blop-0.2.8/src/quantiser.so.c:553: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 loop_point_label[32]; data/blop-0.2.8/src/quantiser.so.c:554: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 value_labels[QUANTISER_MAX_INPUTS][16]; data/blop-0.2.8/src/quantiser.so.c:583: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 (label,"quantiser%d", QUANTISER_MAX_INPUTS); data/blop-0.2.8/src/sequencer.so.c:233: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 label[32]; data/blop-0.2.8/src/sequencer.so.c:234: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 name[40]; data/blop-0.2.8/src/sequencer.so.c:235: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 loop_point_label[32]; data/blop-0.2.8/src/sequencer.so.c:236: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 value_labels[SEQUENCER_MAX_INPUTS][32]; data/blop-0.2.8/src/sequencer.so.c:257: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 (label, "sequencer%d", SEQUENCER_MAX_INPUTS); data/blop-0.2.8/src/wavegen.c:150: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). sample_rate = (long) atoi (optarg); data/blop-0.2.8/src/wavegen.c:153:24: [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). first_note = (long) atoi (optarg); data/blop-0.2.8/src/wavegen.c:156:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). note_step = (long) atoi (optarg); data/blop-0.2.8/src/wavegen.c:159:28: [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). min_table_size = (long) atoi (optarg); data/blop-0.2.8/src/wavegen.c:240:10: [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). file = fopen (filename, "w"); data/blop-0.2.8/src/wavedata.c:26:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t subdirlen = strlen(WAVEDATA_SUBDIR); data/blop-0.2.8/src/wavedata.c:59:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (path, start, end - start); data/blop-0.2.8/src/wavedata.c:66:6: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, subdir, subdirlen); data/blop-0.2.8/src/wavedata.c:76:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pathlen = strlen (path); data/blop-0.2.8/src/wavedata.c:80: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). length = pathlen + strlen (ep->d_name); data/blop-0.2.8/src/wavedata.c:84:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (filename, path, pathlen); data/blop-0.2.8/src/wavedata.c:87:19: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. filename = strncat (filename, ep->d_name, strlen (ep->d_name)); data/blop-0.2.8/src/wavedata.c:87:50: [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). filename = strncat (filename, ep->d_name, strlen (ep->d_name)); data/blop-0.2.8/src/wavegen.c:136: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). len1 = strlen (optarg); data/blop-0.2.8/src/wavegen.c:137: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). len2 = strlen (wave_names[i]); ANALYSIS SUMMARY: Hits = 34 Lines analyzed = 10447 in approximately 0.26 seconds (39761 lines/second) Physical Source Lines of Code (SLOC) = 7422 Hits@level = [0] 173 [1] 10 [2] 15 [3] 3 [4] 6 [5] 0 Hits@level+ = [0+] 207 [1+] 34 [2+] 24 [3+] 9 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 27.8901 [1+] 4.58098 [2+] 3.23363 [3+] 1.21261 [4+] 0.808407 [5+] 0 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.