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/libxshmfence-1.3/test/xshmfence_test.c Examining data/libxshmfence-1.3/src/xshmfenceint.h Examining data/libxshmfence-1.3/src/xshmfence_pthread.c Examining data/libxshmfence-1.3/src/xshmfence.h Examining data/libxshmfence-1.3/src/xshmfence_pthread.h Examining data/libxshmfence-1.3/src/xshmfence_alloc.c Examining data/libxshmfence-1.3/src/xshmfence_futex.h Examining data/libxshmfence-1.3/src/xshmfence_futex.c FINAL RESULTS: data/libxshmfence-1.3/src/xshmfence_alloc.c:78: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). fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); data/libxshmfence-1.3/src/xshmfence_alloc.c:82:9: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(template); data/libxshmfence-1.3/test/xshmfence_test.c:115:17: [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(10 * 1000); data/libxshmfence-1.3/test/xshmfence_test.c:122:17: [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(10 * 1000); data/libxshmfence-1.3/test/xshmfence_test.c:138: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(100 * 1000); ANALYSIS SUMMARY: Hits = 5 Lines analyzed = 754 in approximately 0.03 seconds (24615 lines/second) Physical Source Lines of Code (SLOC) = 366 Hits@level = [0] 12 [1] 3 [2] 2 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 17 [1+] 5 [2+] 2 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 46.4481 [1+] 13.6612 [2+] 5.46448 [3+] 0 [4+] 0 [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.