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/qmidinet-0.6.3/src/qmidinetUdpDevice.h Examining data/qmidinet-0.6.3/src/qmidinetOptions.cpp Examining data/qmidinet-0.6.3/src/qmidinetOptionsForm.cpp Examining data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp Examining data/qmidinet-0.6.3/src/qmidinet.cpp Examining data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.h Examining data/qmidinet-0.6.3/src/qmidinetUdpDevice.cpp Examining data/qmidinet-0.6.3/src/qmidinetAbout.h Examining data/qmidinet-0.6.3/src/qmidinetAlsaMidiDevice.h Examining data/qmidinet-0.6.3/src/qmidinetOptions.h Examining data/qmidinet-0.6.3/src/qmidinet.h Examining data/qmidinet-0.6.3/src/qmidinetOptionsForm.h Examining data/qmidinet-0.6.3/src/qmidinetAlsaMidiDevice.cpp FINAL RESULTS: data/qmidinet-0.6.3/src/qmidinet.cpp:405:17: [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. bool bGUI = (::getenv("DISPLAY") != 0); data/qmidinet-0.6.3/src/qmidinet.cpp:133: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). && !m_alsa.open(QMIDINET_TITLE, pOptions->iNumPorts)) { data/qmidinet-0.6.3/src/qmidinet.cpp:144: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). && !m_jack.open(QMIDINET_TITLE, pOptions->iNumPorts)) { data/qmidinet-0.6.3/src/qmidinet.cpp:156: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). if (!m_udpd.open( data/qmidinet-0.6.3/src/qmidinetAlsaMidiDevice.cpp:138:30: [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). bool qmidinetAlsaMidiDevice::open ( const QString& sClientName, int iNumPorts ) data/qmidinet-0.6.3/src/qmidinetAlsaMidiDevice.cpp:311: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 data[1024]; data/qmidinet-0.6.3/src/qmidinetAlsaMidiDevice.h:57:7: [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). bool open(const QString& sClientName, int iNumPorts = 1); data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:51:17: [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. m_items = new char * [size]; data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:399:30: [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). bool qmidinetJackMidiDevice::open ( const QString& sClientName, int iNumPorts ) data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:585: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. unsigned char achBuffer[nlimit]; data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:600:7: [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(pchBuffer, data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:671: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 achBuffer[nlimit]; data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:676: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(pchBuffer, data, len); data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.h:59:7: [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). bool open(const QString& sClientName, int iNumPorts = 1); data/qmidinet-0.6.3/src/qmidinetUdpDevice.cpp:136:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[1024]; data/qmidinet-0.6.3/src/qmidinetUdpDevice.cpp:203:25: [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). bool qmidinetUdpDevice::open ( const QString& sInterface, data/qmidinet-0.6.3/src/qmidinetUdpDevice.cpp:655: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(&sa, &ifr.ifr_addr, sizeof(struct sockaddr_in)); data/qmidinet-0.6.3/src/qmidinetUdpDevice.h:66:7: [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). bool open(const QString& sInterface, data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:291:7: [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. void usleep(unsigned long usecs); data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:359:30: [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. void qmidinetJackMidiThread::usleep ( unsigned long usecs ) data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:361:11: [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. QThread::usleep(usecs); data/qmidinet-0.6.3/src/qmidinetJackMidiDevice.cpp:551:20: [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. m_pRecvThread->usleep(long(1E+6f * secs)); data/qmidinet-0.6.3/src/qmidinetUdpDevice.cpp:637:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). ::strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); ANALYSIS SUMMARY: Hits = 23 Lines analyzed = 3358 in approximately 0.08 seconds (41620 lines/second) Physical Source Lines of Code (SLOC) = 2105 Hits@level = [0] 28 [1] 5 [2] 17 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 51 [1+] 23 [2+] 18 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 24.228 [1+] 10.9264 [2+] 8.55107 [3+] 0.475059 [4+] 0 [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.