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/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kprocess.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Filter.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/HistorySearch.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Emulation.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/SearchBar.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/LineFont.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Pty.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Session.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/SearchBar.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/DefaultTranslatorText.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty_p.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/HistorySearch.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalDisplay.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptyprocess.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalCharacterDecoder.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/mac-vkcode.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalCharacterDecoder.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorTables.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Filter.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Screen.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Screen.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptyprocess.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/tools.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ScreenWindow.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/qtermwidget.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Character.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Session.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalDisplay.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Emulation.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kprocess.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/BlockArray.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/konsole_wcwidth.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/konsole_wcwidth.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ExtendedDefaultTranslator.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ShellCommand.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Pty.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/qtermwidget.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/tools.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ScreenWindow.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/CharacterColor.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ShellCommand.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/BlockArray.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/src/qmltermwidget_plugin.h Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/src/qmltermwidget_plugin.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/src/ksession.cpp Examining data/cool-retro-term-1.1.1+git20200723/qmltermwidget/src/ksession.h Examining data/cool-retro-term-1.1.1+git20200723/app/monospacefontmanager.cpp Examining data/cool-retro-term-1.1.1+git20200723/app/fileio.h Examining data/cool-retro-term-1.1.1+git20200723/app/monospacefontmanager.h Examining data/cool-retro-term-1.1.1+git20200723/app/main.cpp Examining data/cool-retro-term-1.1.1+git20200723/app/fileio.cpp FINAL RESULTS: data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:556:28: [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. const int length = readlink(procCwd.constData(), path_buffer, MAXPATHLEN); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Pty.cpp:248:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Pty.cpp:250:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(pty()->ttyName(), sbuf.st_mode & ~(S_IWGRP|S_IWOTH)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:307:30: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (!chown(d->ttyName.data(), getuid(), gid)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:308:29: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(d->ttyName.data(), S_IRUSR|S_IWUSR|S_IWGRP); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:460:17: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:461:17: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(d->ttyName.data(), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Session.cpp:460:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. s.sprintf("Bell in session '%s'",_nameTitle.toUtf8().data()); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Session.cpp:605:21: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. message.sprintf("Session '%s' exited with status %d.", data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Session.cpp:608:21: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. message.sprintf("Session '%s' crashed.", data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Session.cpp:614:17: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. message.sprintf("Session '%s' exited unexpectedly.", data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:282:33: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toUtf8(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:283:36: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toUtf8(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:299: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. if (!access(d->ttyName.data(),R_OK|W_OK)) { // checks availability based on permission bits data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/qtermwidget.cpp:207:18: [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. int retval = system(strCmd.toStdString().c_str()); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/qtermwidget.cpp:277:41: [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 (m_translator->load(QLocale::system(), QLatin1String("qtermwidget"), QLatin1String(QLatin1String("_")), dir)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/src/ksession.cpp:159:18: [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. int retval = system(strCmd.toStdString().c_str()); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:313:69: [3] (random) random: 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. writeColorEntry(config,colorNameForIndex(i),colorTable()[i],random); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:408:131: [3] (random) random: 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. void ColorScheme::writeColorEntry(KConfig& config , const QString& colorName, const ColorEntry& entry , const RandomizationRange& random) const data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:421:11: [3] (random) random: 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. if ( !random.isNull() || configGroup.hasKey("MaxRandomHue") ) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:423:52: [3] (random) random: 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. configGroup.writeEntry("MaxRandomHue",(int)random.hue); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:424:54: [3] (random) random: 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. configGroup.writeEntry("MaxRandomValue",(int)random.value); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:425:59: [3] (random) random: 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. configGroup.writeEntry("MaxRandomSaturation",(int)random.saturation); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/src/ksession.cpp:72:24: [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. QString envshell = getenv("SHELL"); data/cool-retro-term-1.1.1+git20200723/app/fileio.cpp:13:15: [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 (!file.open(QFile::WriteOnly | QFile::Truncate)) data/cool-retro-term-1.1.1+git20200723/app/fileio.cpp:28:15: [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 (!file.open(QFile::ReadOnly)) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/BlockArray.cpp:206:22: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). FILE * tmp = tmpfile(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/BlockArray.h:39: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 data[ENTRIES]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:633:63: [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 (!filePath.endsWith(QLatin1String(".schema")) || !file.open(QIODevice::ReadOnly)) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.cpp:94:15: [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 (tmpFile.open()) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.cpp:378: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(buffer, line.constData() + startColumn , count * sizeof(Character)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.cpp:505: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(res, b->data + (colno * sizeof(Character)), count * sizeof(Character)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.cpp:519: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(b->data, a, count * sizeof(Character)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:125: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 (!destination.open(QIODevice::WriteOnly | QIODevice::Text)) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:151:35: [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 (name.isEmpty() || !source.open(QIODevice::ReadOnly | QIODevice::Text)) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:166: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). textBuffer.open(QIODevice::ReadOnly); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:494: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). buffer.open(QIODevice::ReadOnly); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:689: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. char replacement[2] = {0,0}; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:706:21: [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 hexDigits[3] = {0}; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:436: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). if (statusInfo.open(QIODevice::ReadOnly)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:472: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). if (processInfo.open(QIODevice::ReadOnly)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:535:27: [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 (argumentsFile.open(QIODevice::ReadOnly)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp: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. char path_buffer[MAXPATHLEN + 1]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:575:29: [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 (environmentFile.open(QIODevice::ReadOnly)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:652: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 args[ARG_MAX]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:682: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[PATH_MAX]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:837: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[PATH_MAX]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:962: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). if (psinfo.open(QIODevice::ReadOnly)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalCharacterDecoder.cpp:161:9: [2] (buffer) wchar_t: 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. wchar_t ch(characters[i].character); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalDisplay.cpp:1238: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((void*)currentLine,(const void*)newLine,columnsToUpdate*sizeof(Character)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/TerminalDisplay.cpp:1769: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((void*)&_image[_columns*line], data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp:876: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 tmp[20]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp:877: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(tmp,"\033[%d;%dR",_currentScreen->getCursorY()+1,_currentScreen->getCursorX()+1); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp:907: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 tmp[100]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp:908: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(tmp,"\033[%d;1;1;112;112;1;0x",p); // not really true. data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp:954: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[32]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.h:60: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 charset[4]; // data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.h:140:3: [2] (buffer) wchar_t: 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. wchar_t tokenBuffer[MAX_TOKEN_LENGTH]; //FIXME: overflow? data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:205: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). bool KPty::open() data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:225: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 ptsn[PATH_MAX]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:251:21: [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). d->masterFd = ::open(PTM_DEVICE, O_RDWR|O_NOCTTY); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:253: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). # error No method to open a PTY master detected. data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:285:29: [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). d->masterFd = ::open(ptyName.data(), O_RDWR); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:352: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). d->slaveFd = ::open(d->ttyName.data(), O_RDWR | O_NOCTTY); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:374: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). bool KPty::open(int fd) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:396: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[32]; data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:397:9: [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(buf, "/dev/pts/%d", ptyno); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:438: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). d->slaveFd = ::open(d->ttyName.data(), O_RDWR | O_NOCTTY); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:487:15: [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). ::close(::open(d->ttyName, O_WRONLY, 0)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.h:58:10: [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(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.h:60:10: [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(int fd); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:275:19: [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). q->QIODevice::open(mode); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:300: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). bool KPtyDevice::open(OpenMode mode) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:307:16: [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 (!KPty::open()) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:317: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). bool KPtyDevice::open(int fd, OpenMode mode) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:321:16: [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 (!KPty::open(fd)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h:73: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). virtual bool open(OpenMode mode = ReadWrite | Unbuffered); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h:88:10: [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(int fd, OpenMode mode = ReadWrite | Unbuffered); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h:271:9: [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(reserve(len), data, len); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h:317:13: [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(data + readSoFar, ptr, bs); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptyprocess.cpp:46:13: [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). d->pty->open(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptyprocess.cpp:57:13: [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). d->pty->open(ptyMasterFd); data/cool-retro-term-1.1.1+git20200723/app/fileio.cpp:22:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QString FileIO::read(const QString& sourceUrl) { data/cool-retro-term-1.1.1+git20200723/app/fileio.h:18:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QString read(const QString& sourceUrl); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:273:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void ColorScheme::read(const QString & fileName) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:289:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void ColorScheme::read(KConfig& config) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:498:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ColorScheme* KDE3ColorSchemeReader::read() data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:637:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ColorScheme* scheme = reader.read(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.cpp:700:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). scheme->read(filePath); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.h:72:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(KConfig& config); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.h:76:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const QString & filename); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ColorScheme.h:244:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ColorScheme* read(); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/History.cpp:174:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(ion,bytes,len); if (rc < 0) { perror("HistoryFile::get.read"); return; } data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/KeyboardTranslator.cpp:717:41: [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). charsToRemove = 2 + strlen(hexDigits); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/ProcessInfo.cpp:964:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (psinfo.read((char *)&info, sizeof(info)) != sizeof(info)) { data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/Vt102Emulation.cpp:871: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). emit sendData(s,strlen(s)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:517:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(l_struct.ut_user, user, sizeof(l_struct.ut_user)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:519:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(l_struct.ut_name, user, sizeof(l_struct.ut_name)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:524:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(l_struct.ut_host, remotehost, sizeof(l_struct.ut_host)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:526:35: [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). l_struct.ut_syslen = qMin(strlen(remotehost), sizeof(l_struct.ut_host)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:536:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(l_struct.ut_line, str_ptr, sizeof(l_struct.ut_line)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:538:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(l_struct.ut_id, data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:539: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). str_ptr + strlen(str_ptr) - sizeof(l_struct.ut_id), data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kpty.cpp:620:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(l_struct.ut_line, str_ptr, sizeof(l_struct.ut_line)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:104:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). NO_INTR(readBytes, read(q->masterFd(), &c, 0)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:129:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). NO_INTR(readBytes, read(q->masterFd(), ptr, available)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.cpp:403:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return d->readBuffer.read(data, (int)qMin<qint64>(maxlen, KMAXINT)); data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h:310:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(char *data, int maxLength) data/cool-retro-term-1.1.1+git20200723/qmltermwidget/lib/kptydevice.h:326:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(data, lineSize(qMin(maxLength, size()))); ANALYSIS SUMMARY: Hits = 109 Lines analyzed = 26153 in approximately 0.61 seconds (43120 lines/second) Physical Source Lines of Code (SLOC) = 15464 Hits@level = [0] 13 [1] 27 [2] 58 [3] 7 [4] 10 [5] 7 Hits@level+ = [0+] 122 [1+] 109 [2+] 82 [3+] 24 [4+] 17 [5+] 7 Hits/KSLOC@level+ = [0+] 7.88929 [1+] 7.04863 [2+] 5.30264 [3+] 1.55199 [4+] 1.09933 [5+] 0.452664 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.