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/libfreesrp-0.3.0/examples/ctl/cmds.cpp Examining data/libfreesrp-0.3.0/examples/ctl/cmds.hpp Examining data/libfreesrp-0.3.0/examples/ctl/main.cpp Examining data/libfreesrp-0.3.0/examples/ctl/optionparser.hpp Examining data/libfreesrp-0.3.0/examples/io/main.cpp Examining data/libfreesrp-0.3.0/examples/io/optionparser.hpp Examining data/libfreesrp-0.3.0/include/freesrp.hpp Examining data/libfreesrp-0.3.0/src/freesrp.cpp Examining data/libfreesrp-0.3.0/src/freesrp_impl.cpp Examining data/libfreesrp-0.3.0/src/freesrp_impl.hpp Examining data/libfreesrp-0.3.0/src/readerwriterqueue/atomicops.h Examining data/libfreesrp-0.3.0/src/readerwriterqueue/readerwriterqueue.h Examining data/libfreesrp-0.3.0/src/util.cpp FINAL RESULTS: data/libfreesrp-0.3.0/examples/io/main.cpp:209: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). of.open(outfile, ios::binary | ios::out); data/libfreesrp-0.3.0/examples/io/main.cpp:246:17: [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). ifs.open(infile, ios::binary | ios::in); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:79:6: [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 serial_num_buf[MAX_SERIAL_LENGTH]; data/libfreesrp-0.3.0/src/freesrp_impl.cpp:234:6: [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 serial_num_buf[MAX_SERIAL_LENGTH]; data/libfreesrp-0.3.0/src/freesrp_impl.cpp:278: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). stream.open(filename, std::ios::binary | std::ios::ate); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:293: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(data.data(), &configfile_length, sizeof(configfile_length)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:582: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(transfer->buffer + i, &raw_q, sizeof(raw_q)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:583: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(transfer->buffer + i + sizeof(raw_q), &raw_i, sizeof(raw_i)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:661: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:667: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:673: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:679: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:685: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:691: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:697: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:703: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:709: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:715: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:721: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:727: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:733: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(&cmd.param, &cast_param, sizeof(cast_param)); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:746: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(tx_buf.data() + 2, &cmd.param, sizeof(cmd.param)); data/libfreesrp-0.3.0/src/readerwriterqueue/readerwriterqueue.h:570: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 cachelineFiller0[CACHE_LINE_SIZE - sizeof(weak_atomic<size_t>) - sizeof(size_t)]; data/libfreesrp-0.3.0/src/readerwriterqueue/readerwriterqueue.h:574: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 cachelineFiller1[CACHE_LINE_SIZE - sizeof(weak_atomic<size_t>) - sizeof(size_t)]; // next isn't very contended, but we don't want it on the same cache line as tail (which is) data/libfreesrp-0.3.0/src/readerwriterqueue/readerwriterqueue.h:615:2: [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 cachelineFiller[CACHE_LINE_SIZE - sizeof(weak_atomic<Block*>)]; data/libfreesrp-0.3.0/src/util.cpp:112: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). stream.open(filename, std::ios::binary | std::ios::ate); data/libfreesrp-0.3.0/examples/io/main.cpp:122:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). _in->read((char *) buf.data(), sizeof(int16_t) * 2 * samples.size()); data/libfreesrp-0.3.0/src/freesrp_impl.cpp:284:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!stream.read(configfile_buffer.data(), size)) data/libfreesrp-0.3.0/src/util.cpp:118:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!stream.read(firmware_buffer.data(), size)) ANALYSIS SUMMARY: Hits = 29 Lines analyzed = 9385 in approximately 0.34 seconds (27704 lines/second) Physical Source Lines of Code (SLOC) = 4892 Hits@level = [0] 0 [1] 3 [2] 26 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 29 [1+] 29 [2+] 26 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 5.92805 [1+] 5.92805 [2+] 5.3148 [3+] 0 [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.