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/python-pybedtools-0.8.0/pybedtools/include/bedFile.cpp Examining data/python-pybedtools-0.8.0/pybedtools/include/bedFile.h Examining data/python-pybedtools-0.8.0/pybedtools/include/fileType.cpp Examining data/python-pybedtools-0.8.0/pybedtools/include/fileType.h Examining data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp Examining data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h Examining data/python-pybedtools-0.8.0/pybedtools/include/lineFileUtilities.h FINAL RESULTS: data/python-pybedtools-0.8.0/pybedtools/include/lineFileUtilities.h:28:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cstr, str.c_str()); data/python-pybedtools-0.8.0/pybedtools/include/lineFileUtilities.h:42:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cstr, str.c_str()); data/python-pybedtools-0.8.0/pybedtools/include/bedFile.h:422:27: [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). bed.start = atoi(lineVector[1].c_str()); data/python-pybedtools-0.8.0/pybedtools/include/bedFile.h:423:27: [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). bed.end = atoi(lineVector[2].c_str()); data/python-pybedtools-0.8.0/pybedtools/include/bedFile.h:486:27: [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). bed.start = atoi(lineVector[1].c_str()) - 1; // VCF is one-based data/python-pybedtools-0.8.0/pybedtools/include/bedFile.h:536:31: [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). bed.start = atoi(lineVector[3].c_str()) - 1; data/python-pybedtools-0.8.0/pybedtools/include/bedFile.h:537:31: [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). bed.end = atoi(lineVector[4].c_str()); data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp:45: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). gzstreambuf* gzstreambuf::open( const char* name, int open_mode) { data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp:53: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 fmode[10]; data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp:88: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( buffer + (4 - n_putback), gptr() - n_putback, n_putback); data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp:142: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). open( name, mode); data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp:149: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). void gzstreambase::open( const char* name, int open_mode) { data/python-pybedtools-0.8.0/pybedtools/include/gzstream.cpp:150: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 ( ! buf.open( name, open_mode)) data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:51: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 buffer[bufferSize]; // data buffer data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:65: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). gzstreambuf* open( const char* name, int open_mode); data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:81: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). void open( const char* name, int open_mode); data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:98: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). void open( const char* name, int open_mode = std::ios::in) { data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:99:23: [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). gzstreambase::open( name, open_mode); data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:109: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). void open( const char* name, int open_mode = std::ios::out) { data/python-pybedtools-0.8.0/pybedtools/include/gzstream.h:110:23: [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). gzstreambase::open( name, open_mode); data/python-pybedtools-0.8.0/pybedtools/include/lineFileUtilities.h:26: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 cchars [str.size()+1]; data/python-pybedtools-0.8.0/pybedtools/include/lineFileUtilities.h:40: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 cchars [str.size()+1]; data/python-pybedtools-0.8.0/pybedtools/include/lineFileUtilities.h:45:25: [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). elems.push_back(atoi(tok)); data/python-pybedtools-0.8.0/pybedtools/include/fileType.cpp:53:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!f.read((char*)&gzip_header, sizeof(gzip_header))) ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 1422 in approximately 0.12 seconds (12339 lines/second) Physical Source Lines of Code (SLOC) = 899 Hits@level = [0] 1 [1] 1 [2] 21 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 25 [1+] 24 [2+] 23 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 27.8087 [1+] 26.6963 [2+] 25.584 [3+] 2.22469 [4+] 2.22469 [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.