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/nxcl-0.9/test/notQttest.cpp Examining data/nxcl-0.9/test/libtest.cpp Examining data/nxcl-0.9/test/nxcmd.cpp Examining data/nxcl-0.9/nxcl/main.cpp Examining data/nxcl-0.9/nxcl/nxcl.cpp Examining data/nxcl-0.9/nxcl/nxcl.h Examining data/nxcl-0.9/lib/nxsession.h Examining data/nxcl-0.9/lib/nxclientlib_i18n.h Examining data/nxcl-0.9/lib/nxclientlib.h Examining data/nxcl-0.9/lib/i18n.h Examining data/nxcl-0.9/lib/nxdata.h Examining data/nxcl-0.9/lib/notQt.cpp Examining data/nxcl-0.9/lib/nxsession.cpp Examining data/nxcl-0.9/lib/notQt.h Examining data/nxcl-0.9/lib/nxclientlib.cpp FINAL RESULTS: data/nxcl-0.9/lib/notQt.cpp:128:13: [4] (shell) execv: 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. execv (program.c_str(), argarray); data/nxcl-0.9/test/nxcmd.cpp:174:3: [4] (shell) execl: 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. execl (PACKAGE_BIN_DIR"/nxcl", "nxcl", arg.str().c_str(), static_cast<char*>(NULL)); data/nxcl-0.9/lib/nxclientlib.cpp:658:12: [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. home = getenv ("HOME"); data/nxcl-0.9/lib/nxclientlib.cpp:754:19: [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. xauthority << getenv("HOME") << "/.Xauthority"; data/nxcl-0.9/lib/nxclientlib.cpp:781: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. fontPath << getenv("NX_SYSTEM") << "/X11R6/lib/X11/fonts/base," data/nxcl-0.9/lib/nxclientlib.cpp:782:12: [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. << getenv("NX_SYSTEM") << "/X11R6/lib/X11/fonts/TTF"; data/nxcl-0.9/nxcl/nxcl.cpp:142:26: [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. display = XOpenDisplay (getenv("DISPLAY")); data/nxcl-0.9/lib/notQt.cpp:336: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). notQTemporaryFile::open (void) data/nxcl-0.9/lib/notQt.cpp:341: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). this->f.open (this->theFileName.c_str(), ios::in|ios::out|ios::trunc); data/nxcl-0.9/lib/notQt.h:198: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). void open (void); data/nxcl-0.9/lib/nxclientlib.cpp:201: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). this->keyFile->open(); data/nxcl-0.9/lib/nxclientlib.cpp:721: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). options.open (nxdir.c_str(), std::fstream::out); data/nxcl-0.9/lib/nxclientlib.cpp:815: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 hostname[256]; data/nxcl-0.9/lib/nxsession.cpp:639: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). devurand_fd = open("/dev/urandom", O_RDONLY); data/nxcl-0.9/nxcl/main.cpp:68: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). debugLogFile.open("/tmp/nxcl.log", ios::out|ios::trunc); data/nxcl-0.9/test/libtest.cpp:68: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). debugLogFile.open("/tmp/libtest.log", ios::out|ios::trunc); data/nxcl-0.9/test/notQttest.cpp:46: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). debugLogFile.open("/tmp/notQttest.log", ios::out|ios::trunc); data/nxcl-0.9/test/notQttest.cpp:50:5: [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). tf.open(); data/nxcl-0.9/lib/notQt.cpp:170:9: [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. usleep (1000); data/nxcl-0.9/lib/notQt.cpp:284:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((bytes = read (this->childToParent[READING_END], &c, 1)) == 1) { data/nxcl-0.9/lib/notQt.cpp:308:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((bytes = read (this->childErrToParent[READING_END], &c, 1)) == 1) { data/nxcl-0.9/lib/nxsession.cpp:165:25: [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. usleep (10000); data/nxcl-0.9/lib/nxsession.cpp:653:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((r = read(devurand_fd, where, nbytes)) == -1) data/nxcl-0.9/nxcl/main.cpp:100:3: [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. usleep (30000); // 3 100ths of a second => about 30 data/nxcl-0.9/nxcl/main.cpp:106:3: [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. usleep (2000000); // poll once every 2 seconds. data/nxcl-0.9/nxcl/nxcl.cpp:257:4: [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. usleep(1000000); data/nxcl-0.9/nxcl/nxcl.cpp:645:4: [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. usleep(1000000); data/nxcl-0.9/test/libtest.cpp:127:3: [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. usleep (1000); data/nxcl-0.9/test/notQttest.cpp:134:4: [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. usleep (1000000); data/nxcl-0.9/test/notQttest.cpp:136:4: [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. usleep (1000000); ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 5267 in approximately 0.18 seconds (30053 lines/second) Physical Source Lines of Code (SLOC) = 3167 Hits@level = [0] 1 [1] 12 [2] 11 [3] 5 [4] 2 [5] 0 Hits@level+ = [0+] 31 [1+] 30 [2+] 18 [3+] 7 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 9.78844 [1+] 9.47269 [2+] 5.68361 [3+] 2.21029 [4+] 0.631512 [5+] 0 Dot directories skipped = 4 (--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.