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/libexadrums-0.4.2/Api/Config/AlsaParams_api.h Examining data/libexadrums-0.4.2/Api/Config/Config_api.cpp Examining data/libexadrums-0.4.2/Api/Config/Config_api.h Examining data/libexadrums-0.4.2/Api/Config/Config_api.hpp Examining data/libexadrums-0.4.2/Api/Config/TriggerParameters_api.cpp Examining data/libexadrums-0.4.2/Api/Config/TriggerParameters_api.h Examining data/libexadrums-0.4.2/Api/KitCreator/KitCreator_api.cpp Examining data/libexadrums-0.4.2/Api/KitCreator/KitCreator_api.h Examining data/libexadrums-0.4.2/Api/KitCreator/KitCreator_api.hpp Examining data/libexadrums-0.4.2/Api/eXaDrums.cpp Examining data/libexadrums-0.4.2/Api/eXaDrums.h Examining data/libexadrums-0.4.2/Api/eXaDrums.hpp Examining data/libexadrums-0.4.2/DrumKit/DrumModule/Module.cpp Examining data/libexadrums-0.4.2/DrumKit/DrumModule/Module.h Examining data/libexadrums-0.4.2/DrumKit/DrumModule/Recorder.cpp Examining data/libexadrums-0.4.2/DrumKit/DrumModule/Recorder.h Examining data/libexadrums-0.4.2/DrumKit/DrumModule/TrigSound.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/Cymbals/TestHiHat.cpp Examining data/libexadrums-0.4.2/DrumKit/Instruments/Cymbals/TestHiHat.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/Drums/TestDrum.cpp Examining data/libexadrums-0.4.2/DrumKit/Instruments/Drums/TestDrum.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/Instrument.cpp Examining data/libexadrums-0.4.2/DrumKit/Instruments/Instrument.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/InstrumentFactory.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/InstrumentParameters.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/InstrumentSoundInfo.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/InstrumentType.h Examining data/libexadrums-0.4.2/DrumKit/Instruments/Pads/Pad.cpp Examining data/libexadrums-0.4.2/DrumKit/Instruments/Pads/Pad.h Examining data/libexadrums-0.4.2/DrumKit/Kits/Kit.cpp Examining data/libexadrums-0.4.2/DrumKit/Kits/Kit.h Examining data/libexadrums-0.4.2/DrumKit/Kits/KitCreator.cpp Examining data/libexadrums-0.4.2/DrumKit/Kits/KitCreator.h Examining data/libexadrums-0.4.2/DrumKit/Kits/KitManager.cpp Parsing failed to find end of parameter list; semicolon terminated it in (lhs.cbegin(), lhs.cend(), rhs.cbegin(), [](const char& lhs, const char& rhs){return std::tolower(lhs) == std::tolower(rhs);}); return result.second != rhs.cend() && (result.first == lhs.cend() || Examining data/libexadrums-0.4.2/DrumKit/Kits/KitManager.h Examining data/libexadrums-0.4.2/DrumKit/Kits/KitParameters.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/Curves/CurveType.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/Curves/Curves.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerFactory.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerLocation.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerManager.cpp Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerManager.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerParameters.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerState.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/TriggerType.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/Triggers/ContinuousTrigger.cpp Examining data/libexadrums-0.4.2/DrumKit/Triggers/Triggers/ContinuousTrigger.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/Triggers/DiscreteTrigger.cpp Examining data/libexadrums-0.4.2/DrumKit/Triggers/Triggers/DiscreteTrigger.h Examining data/libexadrums-0.4.2/DrumKit/Triggers/Triggers/Trigger.cpp Examining data/libexadrums-0.4.2/DrumKit/Triggers/Triggers/Trigger.h Examining data/libexadrums-0.4.2/IO/HddSensor.cpp Examining data/libexadrums-0.4.2/IO/HddSensor.h Examining data/libexadrums-0.4.2/IO/ISensor.h Examining data/libexadrums-0.4.2/IO/SensorType.h Examining data/libexadrums-0.4.2/IO/SensorsConfig.h Examining data/libexadrums-0.4.2/IO/Serial.cpp Examining data/libexadrums-0.4.2/IO/Serial.h Examining data/libexadrums-0.4.2/IO/Spi.cpp Examining data/libexadrums-0.4.2/IO/Spi.h Examining data/libexadrums-0.4.2/IO/SpiSensor.cpp Examining data/libexadrums-0.4.2/IO/SpiSensor.h Examining data/libexadrums-0.4.2/IO/VirtualSensor.h Examining data/libexadrums-0.4.2/Metronome/ClickTypes.h Examining data/libexadrums-0.4.2/Metronome/Metronome.cpp Examining data/libexadrums-0.4.2/Metronome/Metronome.h Examining data/libexadrums-0.4.2/Metronome/MetronomeParameters.h Examining data/libexadrums-0.4.2/Sound/Alsa/Alsa.cpp Examining data/libexadrums-0.4.2/Sound/Alsa/Alsa.h Examining data/libexadrums-0.4.2/Sound/Alsa/AlsaParameters.cpp Examining data/libexadrums-0.4.2/Sound/Alsa/AlsaParameters.h Examining data/libexadrums-0.4.2/Sound/Alsa/AlsaParams.h Examining data/libexadrums-0.4.2/Sound/InstrumentSoundType.h Examining data/libexadrums-0.4.2/Sound/Mixer/Mixer.cpp Examining data/libexadrums-0.4.2/Sound/Mixer/Mixer.h Examining data/libexadrums-0.4.2/Sound/Sound.cpp Examining data/libexadrums-0.4.2/Sound/Sound.h Examining data/libexadrums-0.4.2/Sound/SoundBank/SoundBank.cpp Examining data/libexadrums-0.4.2/Sound/SoundBank/SoundBank.h Examining data/libexadrums-0.4.2/Sound/SoundProcessor/SoundProcessor.cpp Examining data/libexadrums-0.4.2/Sound/SoundProcessor/SoundProcessor.h Examining data/libexadrums-0.4.2/Sound/SoundState.h Examining data/libexadrums-0.4.2/Sound/Util/WavUtil.h Examining data/libexadrums-0.4.2/Util/Crypt.h Examining data/libexadrums-0.4.2/Util/Enums.h Examining data/libexadrums-0.4.2/Util/ErrorHandling.h Examining data/libexadrums-0.4.2/Util/Misc.h Examining data/libexadrums-0.4.2/Util/Parsing.h Examining data/libexadrums-0.4.2/Util/SimpleSafeQueue.h Examining data/libexadrums-0.4.2/Util/Threading.h Examining data/libexadrums-0.4.2/Util/Time.h Examining data/libexadrums-0.4.2/Util/Xml.h FINAL RESULTS: data/libexadrums-0.4.2/Api/Config/Config_api.cpp:247: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). std::strcpy(this->alsaParams.device, itDev->second.data()); data/libexadrums-0.4.2/Sound/Alsa/Alsa.cpp:204:71: [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_hw_params_set_access(params.handle, params.hwParams, params.access); data/libexadrums-0.4.2/Sound/Alsa/AlsaParameters.cpp:93:24: [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. root->InsertEndChild(access); data/libexadrums-0.4.2/Sound/Alsa/AlsaParameters.cpp:132:20: [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/libexadrums-0.4.2/Sound/Alsa/AlsaParameters.cpp:147:10: [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. return access; data/libexadrums-0.4.2/Sound/Alsa/AlsaParams.h:38:22: [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/libexadrums-0.4.2/Api/Config/AlsaParams_api.h:66:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char device[64]; data/libexadrums-0.4.2/Api/Config/TriggerParameters_api.h:32:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char type[64]; data/libexadrums-0.4.2/Api/Config/TriggerParameters_api.h:33:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char response[64]; data/libexadrums-0.4.2/DrumKit/DrumModule/Recorder.cpp:106:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file.open(fileName); data/libexadrums-0.4.2/IO/Serial.cpp:75:20: [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). this->handle = ::open(this->port.c_str(), O_RDWR| O_NOCTTY); data/libexadrums-0.4.2/IO/Spi.cpp:29:14: [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). this->fd = open(Spi::spiDev0.c_str(), O_RDWR); data/libexadrums-0.4.2/IO/SpiSensor.cpp:76: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 mosi[3] = {data}; data/libexadrums-0.4.2/Metronome/Metronome.cpp:98: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). params.tempo = std::atoi(tempo->GetText()); data/libexadrums-0.4.2/Metronome/Metronome.cpp:99: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). params.rhythm = std::atoi(rhythm->GetText()); data/libexadrums-0.4.2/Metronome/Metronome.cpp:100:33: [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). params.beatsPerMeasure = std::atoi(beatsPerMeasure->GetText()); data/libexadrums-0.4.2/Util/ErrorHandling.h:26:13: [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 message[255]; data/libexadrums-0.4.2/DrumKit/Kits/KitManager.cpp:267:29: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. const auto result = std::mismatch(lhs.cbegin(), lhs.cend(), rhs.cbegin(), [](const char& lhs, const char& rhs){return std::tolower(lhs) == std::tolower(rhs);}); data/libexadrums-0.4.2/IO/HddSensor.cpp:78:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(file.read((char*)&val, sizeof(short))) data/libexadrums-0.4.2/IO/Serial.cpp:50:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto res = ::read(this->handle, &this->buf, 1); data/libexadrums-0.4.2/IO/Serial.cpp:56:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto resValue = ::read(this->handle, &this->buf, 1); data/libexadrums-0.4.2/Sound/SoundBank/SoundBank.cpp:110:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). soundFile.read((char*)header_data.data(), header_data.size()); data/libexadrums-0.4.2/Sound/SoundBank/SoundBank.cpp:130:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). soundFile.read((char*)data.data(), dataLength); ANALYSIS SUMMARY: Hits = 23 Lines analyzed = 10390 in approximately 0.21 seconds (49801 lines/second) Physical Source Lines of Code (SLOC) = 6200 Hits@level = [0] 6 [1] 6 [2] 11 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 29 [1+] 23 [2+] 17 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 4.67742 [1+] 3.70968 [2+] 2.74194 [3+] 0.967742 [4+] 0.967742 [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.