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/r-bioc-fmcsr-1.32.0+dfsg/config.h Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCS.cpp Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCS.h Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.h Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSList.h Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSMap.cpp Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSMap.h Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSRingDetector.cpp Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSRingDetector.h Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/fmcs_R_wrap.cpp Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/util.cpp Examining data/r-bioc-fmcsr-1.32.0+dfsg/src/util.h FINAL RESULTS: data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:70:13: [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(atoms, other.atoms, sizeof(Atom) * other.atomCount); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:75:13: [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(bonds, other.bonds, sizeof(Bond) * other.bondCount); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:87:17: [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(atoms, other.atoms, sizeof(Atom) * other.atomCount); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:92:17: [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(bonds, other.bonds, sizeof(Bond) * other.bondCount); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:123:13: [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(atoms, that.atoms, sizeof(Atom) * that.atomCount); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:128:13: [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(bonds, that.bonds, sizeof(Bond) * that.bondCount); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:349: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). int oldAtomCount = atoi(atomCountString.c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:350: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). int oldBondCount = atoi(bondCountString.c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:377: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). int oldFirstAtomIndex = atoi(oldBondBlockLine.substr(0, 3).c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:378:32: [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). int oldSecondAtomIndex = atoi(oldBondBlockLine.substr(3, 3).c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:434:18: [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). atomCount = atoi(atomCountString.c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:435:18: [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). bondCount = atoi(bondCountString.c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:456:19: [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). firstAtom = atoi(bondBlockLine.substr(0, 3).c_str()) - 1; data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:457:20: [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). secondAtom = atoi(bondBlockLine.substr(3, 3).c_str()) - 1; data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:458:18: [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). bondType = atoi(bondBlockLine.substr(6, 3).c_str()); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.h:53:26: [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. static const char elements[111][3]; data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.h:54:26: [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. static const char code[111]; data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSList.h:75: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(data, m.data, sizeof(T) * m.length); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSList.h:93: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(data, m.data, sizeof(T) * m.length); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSList.h:115: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(n, data, sizeof(T) * length); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:135:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MCSCompound::read(const string& sdfString, ReadType type) { data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.cpp:155:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MCSCompound::read(const std::string& sdfString) { data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.h:116:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const std::string& sdfString, ReadType type); data/r-bioc-fmcsr-1.32.0+dfsg/src/MCSCompound.h:118:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const std::string& sdfString); data/r-bioc-fmcsr-1.32.0+dfsg/src/fmcs_R_wrap.cpp:63:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). compoundOne.read(string(*structureStringOne), MCSCompound::SDF); data/r-bioc-fmcsr-1.32.0+dfsg/src/fmcs_R_wrap.cpp:64:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). compoundTwo.read(string(*structureStringTwo), MCSCompound::SDF); data/r-bioc-fmcsr-1.32.0+dfsg/src/fmcs_R_wrap.cpp:66:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). compoundOne.read(string(*structureStringOne)); data/r-bioc-fmcsr-1.32.0+dfsg/src/fmcs_R_wrap.cpp:67:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). compoundTwo.read(string(*structureStringTwo)); ANALYSIS SUMMARY: Hits = 28 Lines analyzed = 2538 in approximately 0.07 seconds (35055 lines/second) Physical Source Lines of Code (SLOC) = 1844 Hits@level = [0] 0 [1] 8 [2] 20 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 28 [1+] 28 [2+] 20 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 15.1844 [1+] 15.1844 [2+] 10.846 [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.