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/simstring-1.0/swig/ruby/export_wrap.cpp Examining data/simstring-1.0/swig/python/export_wrap.cpp Examining data/simstring-1.0/swig/export.cpp Examining data/simstring-1.0/swig/export.h Examining data/simstring-1.0/sample/sample_unicode.cpp Examining data/simstring-1.0/sample/sample.cpp Examining data/simstring-1.0/frontend/optparse.h Examining data/simstring-1.0/frontend/main.cpp Examining data/simstring-1.0/win32/stdint.h Examining data/simstring-1.0/include/simstring/memory_mapped_file.h Examining data/simstring-1.0/include/simstring/ngram.h Examining data/simstring-1.0/include/simstring/memory_mapped_file_posix.h Examining data/simstring-1.0/include/simstring/measure.h Examining data/simstring-1.0/include/simstring/cdbpp.h Examining data/simstring-1.0/include/simstring/memory_mapped_file_win32.h Examining data/simstring-1.0/include/simstring/simstring.h FINAL RESULTS: data/simstring-1.0/swig/python/export_wrap.cpp:668:3: [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(r,name); data/simstring-1.0/swig/python/export_wrap.cpp:738:25: [4] (format) _snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define PyOS_snprintf _snprintf data/simstring-1.0/swig/python/export_wrap.cpp:740:25: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define PyOS_snprintf snprintf data/simstring-1.0/swig/python/export_wrap.cpp:757:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. res = vsnprintf(buf, sizeof(buf), fmt, ap); data/simstring-1.0/swig/ruby/export_wrap.cpp:772:3: [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(r,name); data/simstring-1.0/swig/ruby/export_wrap.cpp:1489:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(klass_name, "TYPE%s", type->name); data/simstring-1.0/swig/ruby/export_wrap.cpp:1545:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(klass_name, "TYPE%s", type->name); data/simstring-1.0/swig/ruby/export_wrap.cpp:1680:3: [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(r, type->name); data/simstring-1.0/frontend/main.cpp:105: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). ngram_size = std::atoi(arg); data/simstring-1.0/frontend/main.cpp:280:13: [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 (!db.open(opt.name)) { data/simstring-1.0/frontend/optparse.h:236:26: [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). bytes = std::atoi(arg); data/simstring-1.0/frontend/optparse.h:240:26: [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). lines = std::atoi(arg); data/simstring-1.0/include/simstring/cdbpp.h:311:9: [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 chunkid[4] = {'C','D','B','+'}; data/simstring-1.0/include/simstring/cdbpp.h:400:15: [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). this->open(buffer, size, own); data/simstring-1.0/include/simstring/cdbpp.h:411:15: [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). this->open(ifs); data/simstring-1.0/include/simstring/cdbpp.h:456: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). size_t open(std::ifstream& ifs) data/simstring-1.0/include/simstring/cdbpp.h:458:9: [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 chunk[4], size[4]; data/simstring-1.0/include/simstring/cdbpp.h:493:26: [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). return this->open(block, chunk_size, true); data/simstring-1.0/include/simstring/cdbpp.h:508: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). size_t open(const void *buffer, size_t size, bool own = false) data/simstring-1.0/include/simstring/memory_mapped_file.h:47: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 std::string& path, std::ios_base::openmode mode) {} data/simstring-1.0/include/simstring/memory_mapped_file_posix.h:70: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 std::string& path, std::ios_base::openmode mode) data/simstring-1.0/include/simstring/memory_mapped_file_posix.h:85: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). m_fd = ::open(path.c_str(), flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/simstring-1.0/include/simstring/memory_mapped_file_win32.h:69: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 std::string& path, std::ios_base::openmode mode) data/simstring-1.0/include/simstring/simstring.h:369:15: [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). this->open(name); data/simstring-1.0/include/simstring/simstring.h:386: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). bool open(const std::string& name) data/simstring-1.0/include/simstring/simstring.h:391:15: [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). m_ofs.open(name.c_str(), std::ios::binary); data/simstring-1.0/include/simstring/simstring.h:614: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 std::string& name, int max_size) data/simstring-1.0/include/simstring/simstring.h:771:25: [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). index.image.open(ss.str().c_str(), std::ios::in); data/simstring-1.0/include/simstring/simstring.h:773:29: [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). index.table.open(index.image.data(), index.image.size()); data/simstring-1.0/include/simstring/simstring.h:830: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). bool open(const std::string& name) data/simstring-1.0/include/simstring/simstring.h:895: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). base_type::open(name, (int)max_size); data/simstring-1.0/sample/sample.cpp:36:9: [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). dbr.open("sample.db"); data/simstring-1.0/sample/sample_unicode.cpp:38:9: [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). dbr.open("sample_unicode.db"); data/simstring-1.0/swig/export.cpp:34:9: [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[1024]; data/simstring-1.0/swig/export.cpp:165:15: [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 (!dbr->open(filename)) { data/simstring-1.0/swig/python/export_wrap.cpp:619:16: [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 hex[17] = "0123456789abcdef"; data/simstring-1.0/swig/python/export_wrap.cpp:754: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 buf[SWIG_PYBUFFER_SIZE * 2]; data/simstring-1.0/swig/python/export_wrap.cpp:1412: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 result[SWIG_BUFFER_SIZE]; data/simstring-1.0/swig/python/export_wrap.cpp:1736: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 result[SWIG_BUFFER_SIZE]; data/simstring-1.0/swig/python/export_wrap.cpp:1750: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 result[SWIG_BUFFER_SIZE]; data/simstring-1.0/swig/python/export_wrap.cpp:1761: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 result[SWIG_BUFFER_SIZE]; data/simstring-1.0/swig/python/export_wrap.cpp:1879:7: [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(pack, ptr, size); data/simstring-1.0/swig/python/export_wrap.cpp:1897: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(ptr, sobj->pack, size); data/simstring-1.0/swig/python/export_wrap.cpp:2419: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 mesg[256]; data/simstring-1.0/swig/python/export_wrap.cpp:3620: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 msg[1024]; data/simstring-1.0/swig/python/export_wrap.cpp:3621:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg, "in sequence element %d ", _index); data/simstring-1.0/swig/python/export_wrap.cpp:3820: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 msg[1024]; data/simstring-1.0/swig/python/export_wrap.cpp:3821:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg, "in sequence element %d", i); data/simstring-1.0/swig/python/export_wrap.cpp:3873:40: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); data/simstring-1.0/swig/ruby/export_wrap.cpp:723:16: [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 hex[17] = "0123456789abcdef"; data/simstring-1.0/swig/ruby/export_wrap.cpp:1077: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 buf[128]; data/simstring-1.0/swig/ruby/export_wrap.cpp:1090:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( buf, "%d of type ", argn-1 ); data/simstring-1.0/swig/ruby/export_wrap.cpp:1675: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 result[1024]; data/simstring-1.0/swig/ruby/export_wrap.cpp:2522:38: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); data/simstring-1.0/swig/ruby/export_wrap.cpp:3658: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 msg[1024]; data/simstring-1.0/swig/ruby/export_wrap.cpp:3659:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg, "in sequence element %d ", _index); data/simstring-1.0/swig/ruby/export_wrap.cpp:3878: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 msg[1024]; data/simstring-1.0/swig/ruby/export_wrap.cpp:3879:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg, "in sequence element %d", i); data/simstring-1.0/include/simstring/cdbpp.h:463:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifs.read(chunk, 4); data/simstring-1.0/include/simstring/cdbpp.h:474:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifs.read(size, 4); data/simstring-1.0/include/simstring/cdbpp.h:488:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifs.read(reinterpret_cast<char*>(block), chunk_size); data/simstring-1.0/include/simstring/memory_mapped_file_posix.h:128:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(m_fd, &c, sizeof(char)) == -1) { data/simstring-1.0/include/simstring/simstring.h:848:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifs.read(&m_strings[0], size); data/simstring-1.0/swig/python/export_wrap.cpp:390:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const char* te = tb + strlen(tb); data/simstring-1.0/swig/python/export_wrap.cpp:409:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const char* te = tb + strlen(tb); data/simstring-1.0/swig/python/export_wrap.cpp:667:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(name) + 1 > (bsz - (r - buff))) return 0; data/simstring-1.0/swig/python/export_wrap.cpp:688:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t lname = (name ? strlen(name) : 0); data/simstring-1.0/swig/python/export_wrap.cpp:693:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(r,name,lname+1); data/simstring-1.0/swig/python/export_wrap.cpp:791:91: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} data/simstring-1.0/swig/python/export_wrap.cpp:2669:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. virtual bool equal (const PySwigIterator &/*x*/) const data/simstring-1.0/swig/python/export_wrap.cpp:2702:14: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return equal(x); data/simstring-1.0/swig/python/export_wrap.cpp:3451:10: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. bool equal (const PySwigIterator &iter) const data/simstring-1.0/swig/python/export_wrap.cpp:3892:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; data/simstring-1.0/swig/python/export_wrap.cpp:4565:58: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. result = (bool)((swig::PySwigIterator const *)arg1)->equal((swig::PySwigIterator const &)*arg2); data/simstring-1.0/swig/python/export_wrap.cpp:7714:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t size = strlen(name)+1; data/simstring-1.0/swig/python/export_wrap.cpp:7717:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(gv->name,name,size); data/simstring-1.0/swig/python/export_wrap.cpp:7779:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(const_table[j].name)) == 0) { data/simstring-1.0/swig/python/export_wrap.cpp:7788:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; data/simstring-1.0/swig/python/export_wrap.cpp:7794:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buff, methods[i].ml_doc, ldoc); data/simstring-1.0/swig/python/export_wrap.cpp:7796:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buff, "swig_ptr: ", 10); data/simstring-1.0/swig/ruby/export_wrap.cpp:494:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const char* te = tb + strlen(tb); data/simstring-1.0/swig/ruby/export_wrap.cpp:513:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const char* te = tb + strlen(tb); data/simstring-1.0/swig/ruby/export_wrap.cpp:771:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(name) + 1 > (bsz - (r - buff))) return 0; data/simstring-1.0/swig/ruby/export_wrap.cpp:792:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t lname = (name ? strlen(name) : 0); data/simstring-1.0/swig/ruby/export_wrap.cpp:797:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(r,name,lname+1); data/simstring-1.0/swig/ruby/export_wrap.cpp:844:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #ifdef read data/simstring-1.0/swig/ruby/export_wrap.cpp:845:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # undef read data/simstring-1.0/swig/ruby/export_wrap.cpp:1488:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); data/simstring-1.0/swig/ruby/export_wrap.cpp:1544:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). klass_name = (char *) malloc(4 + strlen(type->name) + 1); data/simstring-1.0/swig/ruby/export_wrap.cpp:1677:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; data/simstring-1.0/swig/ruby/export_wrap.cpp:2144:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. virtual bool equal (const ConstIterator &x) const data/simstring-1.0/swig/ruby/export_wrap.cpp:2217:14: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return equal(x); data/simstring-1.0/swig/ruby/export_wrap.cpp:2338:14: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return equal(x); data/simstring-1.0/swig/ruby/export_wrap.cpp:2537:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0; data/simstring-1.0/swig/ruby/export_wrap.cpp:3083:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. virtual bool equal (const ConstIterator &iter) const data/simstring-1.0/swig/ruby/export_wrap.cpp:3176:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. virtual bool equal (const ConstIterator &iter) const ANALYSIS SUMMARY: Hits = 96 Lines analyzed = 21374 in approximately 0.53 seconds (40586 lines/second) Physical Source Lines of Code (SLOC) = 16141 Hits@level = [0] 31 [1] 38 [2] 50 [3] 0 [4] 8 [5] 0 Hits@level+ = [0+] 127 [1+] 96 [2+] 58 [3+] 8 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 7.86816 [1+] 5.94759 [2+] 3.59333 [3+] 0.495632 [4+] 0.495632 [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.