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/wf-recorder-0.2.1/src/averr.c Examining data/wf-recorder-0.2.1/src/averr.h Examining data/wf-recorder-0.2.1/src/frame-writer.cpp Examining data/wf-recorder-0.2.1/src/frame-writer.hpp Examining data/wf-recorder-0.2.1/src/main.cpp Examining data/wf-recorder-0.2.1/src/opencl.cpp Examining data/wf-recorder-0.2.1/src/opencl.hpp Examining data/wf-recorder-0.2.1/src/pulse.cpp Examining data/wf-recorder-0.2.1/src/pulse.hpp FINAL RESULTS: data/wf-recorder-0.2.1/src/main.cpp:498:5: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(R"(Usage: wf-recorder [OPTION]... -f [FILE]... data/wf-recorder-0.2.1/src/main.cpp:540:5: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(R"( data/wf-recorder-0.2.1/src/main.cpp:546:5: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(R"( data/wf-recorder-0.2.1/src/main.cpp:619:16: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((c = getopt_long(argc, argv, "o:f:m:x:g:c:p:d:b:la::te::h", opts, &i)) != -1) data/wf-recorder-0.2.1/src/frame-writer.cpp:196: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 err[256]; data/wf-recorder-0.2.1/src/frame-writer.cpp:305: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 err[256]; data/wf-recorder-0.2.1/src/frame-writer.cpp:562: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(inputf->data[0], buffer, get_audio_buffer_size()); data/wf-recorder-0.2.1/src/main.cpp:131:14: [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). int fd = mkstemp(name); data/wf-recorder-0.2.1/src/main.cpp:652:34: [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.bframes = atoi(optarg); data/wf-recorder-0.2.1/src/main.cpp:674:49: [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.opencl_device = optarg ? atoi(optarg) : -1; ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 2235 in approximately 0.07 seconds (32446 lines/second) Physical Source Lines of Code (SLOC) = 1640 Hits@level = [0] 25 [1] 0 [2] 6 [3] 1 [4] 3 [5] 0 Hits@level+ = [0+] 35 [1+] 10 [2+] 10 [3+] 4 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 21.3415 [1+] 6.09756 [2+] 6.09756 [3+] 2.43902 [4+] 1.82927 [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.