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/yamcha-0.33/libexec/mkdarts.cpp Examining data/yamcha-0.33/libexec/mktrie.cpp Examining data/yamcha-0.33/libexec/pkemine.cpp Examining data/yamcha-0.33/perl/YamCha_wrap.cxx Examining data/yamcha-0.33/python/YamCha_wrap.cxx Examining data/yamcha-0.33/ruby/YamCha_wrap.cpp Examining data/yamcha-0.33/src/yamcha.h Examining data/yamcha-0.33/src/param.h Examining data/yamcha-0.33/src/common.h Examining data/yamcha-0.33/src/mmap.h Examining data/yamcha-0.33/src/feature_index.h Examining data/yamcha-0.33/src/chunker.cpp Examining data/yamcha-0.33/src/yamcha.cpp Examining data/yamcha-0.33/src/svm.cpp Examining data/yamcha-0.33/src/chunkersub.h Examining data/yamcha-0.33/src/feature_index.cpp Examining data/yamcha-0.33/src/param.cpp Examining data/yamcha-0.33/src/libyamcha.cpp Examining data/yamcha-0.33/acconfig.h Examining data/yamcha-0.33/example/bag-of-words.cpp Examining data/yamcha-0.33/example/example.cpp FINAL RESULTS: data/yamcha-0.33/example/example.cpp:66:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (tmp, "BEGIN:%d:0:%s", i, c->getContext (j, 0)); data/yamcha-0.33/example/example.cpp:71:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (tmp, "BEGIN:%d:1:%s", i, c->getContext (j, 1)); data/yamcha-0.33/libexec/mkdarts.cpp:88:6: [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 (tmp, buf+p); data/yamcha-0.33/perl/YamCha_wrap.cxx:667: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/yamcha-0.33/python/YamCha_wrap.cxx:573: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(gv->name,name); data/yamcha-0.33/python/YamCha_wrap.cxx:726: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(r,type->name); data/yamcha-0.33/python/YamCha_wrap.cxx:754: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/yamcha-0.33/ruby/YamCha_wrap.cpp:518: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/yamcha-0.33/ruby/YamCha_wrap.cpp:544:7: [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/yamcha-0.33/ruby/YamCha_wrap.cpp:640: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/yamcha-0.33/example/bag-of-words.cpp:62: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 tmp[8192]; data/yamcha-0.33/example/bag-of-words.cpp:63: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 tmp2[8192]; data/yamcha-0.33/example/example.cpp:53: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 tmp[1024]; data/yamcha-0.33/libexec/mkdarts.cpp:77: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[8192]; data/yamcha-0.33/libexec/mkdarts.cpp:84: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). int i = std::atoi (&buf[p]); data/yamcha-0.33/libexec/mktrie.cpp:106: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 [8192]; data/yamcha-0.33/libexec/mktrie.cpp:116:17: [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). tmp[i] = atoi (column[i+1].c_str()); data/yamcha-0.33/libexec/mktrie.cpp:119:12: [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). f.id = atoi (column[0].c_str()); data/yamcha-0.33/libexec/mktrie.cpp:129:38: [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. unsigned char **ptr = new unsigned char * [fv.size()]; data/yamcha-0.33/libexec/pkemine.cpp:222: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). minsup = atoi (argv[2]); data/yamcha-0.33/libexec/pkemine.cpp:223: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). maxpat = atoi (argv[3]); data/yamcha-0.33/perl/YamCha_wrap.cxx:311:10: [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 char hex[17] = "0123456789abcdef"; data/yamcha-0.33/perl/YamCha_wrap.cxx:662: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/yamcha-0.33/perl/YamCha_wrap.cxx:971:24: [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. arg2 = new char * [arg1 + 1]; data/yamcha-0.33/perl/YamCha_wrap.cxx:1200:32: [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. swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); data/yamcha-0.33/perl/YamCha_wrap.cxx:1215:27: [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. sv_setpv(sv, (char *) swig_constants[i].pvalue); data/yamcha-0.33/python/YamCha_wrap.cxx:315:10: [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 char hex[17] = "0123456789abcdef"; data/yamcha-0.33/python/YamCha_wrap.cxx:722: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 result[1024]; data/yamcha-0.33/python/YamCha_wrap.cxx:749: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/yamcha-0.33/python/YamCha_wrap.cxx:773:29: [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. obj = PyString_FromString((char *) constants[i].pvalue); data/yamcha-0.33/python/YamCha_wrap.cxx:853:42: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type))) data/yamcha-0.33/python/YamCha_wrap.cxx:1149:20: [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. arg2 = new char * [arg1+1]; data/yamcha-0.33/ruby/YamCha_wrap.cpp:454:10: [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 char hex[17] = "0123456789abcdef"; data/yamcha-0.33/ruby/YamCha_wrap.cpp:635: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/yamcha-0.33/ruby/YamCha_wrap.cpp:851:20: [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. arg2 = new char * [arg1+1]; data/yamcha-0.33/src/chunker.cpp:98:19: [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 (Param &); data/yamcha-0.33/src/chunker.cpp:109:19: [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 (int, char**); data/yamcha-0.33/src/chunker.cpp:110:19: [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 char*); data/yamcha-0.33/src/chunker.cpp:136: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 (! open (argc, argv)) throw std::runtime_error (_what); data/yamcha-0.33/src/chunker.cpp:141: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 (! open (arg)) throw std::runtime_error (_what); data/yamcha-0.33/src/chunker.cpp:151: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). bool Chunker::Impl::open (int argc, char **argv) data/yamcha-0.33/src/chunker.cpp:155: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). if (! param.open (argc, argv, long_options)) { data/yamcha-0.33/src/chunker.cpp:160: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). return open (param); data/yamcha-0.33/src/chunker.cpp:163: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). bool Chunker::Impl::open (const char *arg) data/yamcha-0.33/src/chunker.cpp:167: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). if (! param.open (arg, long_options)) { data/yamcha-0.33/src/chunker.cpp:172: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). return open (param); data/yamcha-0.33/src/chunker.cpp:175: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). bool Chunker::Impl::open (Param ¶m) data/yamcha-0.33/src/chunker.cpp:209: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). if (! svm.open (model.c_str())) throw std::runtime_error (svm.what()); data/yamcha-0.33/src/chunker.cpp:233:22: [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. features = new char * [MAX_FEATURE_LEN]; data/yamcha-0.33/src/chunker.cpp:253:19: [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 (! param.open (argc, argv, long_options)) { data/yamcha-0.33/src/chunker.cpp:268: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 (! open (param)) throw std::runtime_error (_what); data/yamcha-0.33/src/chunker.cpp:337: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 buf [32]; data/yamcha-0.33/src/chunker.cpp:348: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 buf [32]; data/yamcha-0.33/src/chunker.cpp:623: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). bool Chunker::open (int argc, char** argv) { return _impl->open(argc, argv); }; data/yamcha-0.33/src/chunker.cpp:623:87: [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 Chunker::open (int argc, char** argv) { return _impl->open(argc, argv); }; data/yamcha-0.33/src/chunker.cpp:624: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). bool Chunker::open (const char *argv) { return _impl->open(argv); }; data/yamcha-0.33/src/chunker.cpp:624:87: [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 Chunker::open (const char *argv) { return _impl->open(argv); }; data/yamcha-0.33/src/libyamcha.cpp:68:14: [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 (! ptr->open (file)) { data/yamcha-0.33/src/libyamcha.cpp:142:14: [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 (! ptr->open (argc, argv)) { data/yamcha-0.33/src/libyamcha.cpp:163:14: [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 (! ptr->open (arg)) { data/yamcha-0.33/src/mmap.h:73:64: [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). static inline int open__ (const char* name, int flag) { return open (name, flag); } data/yamcha-0.33/src/mmap.h:113: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 char *filename, const char *mode = "r") data/yamcha-0.33/src/mmap.h:169:19: [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 (! this->open (filename, mode)) data/yamcha-0.33/src/mmap.h:175: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 char *filename, const char *mode = "r") data/yamcha-0.33/src/mmap.h:248:19: [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 (! this->open (filename, mode)) data/yamcha-0.33/src/param.cpp:71: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). bool Param::open (int argc, char **argv, const Option *opts) data/yamcha-0.33/src/param.cpp:180: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). bool Param::open (const char *arg, const Option *opts) data/yamcha-0.33/src/param.cpp:182: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 str [1024]; data/yamcha-0.33/src/param.cpp:196: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). return open (size, ptr, opts); data/yamcha-0.33/src/param.cpp:241:12: [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). return atoi (val.c_str()); data/yamcha-0.33/src/param.h:54: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 (int, char**, const Option *); data/yamcha-0.33/src/param.h:55: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 char*, const Option *); data/yamcha-0.33/src/svm.cpp:49: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 (&value, r, sizeof (T)); data/yamcha-0.33/src/svm.cpp:104: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 (! open (filename)) throw std::runtime_error (_what); data/yamcha-0.33/src/svm.cpp:120: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 char *); data/yamcha-0.33/src/svm.cpp:155:19: [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 SVM::Impl::open (const char *filename) data/yamcha-0.33/src/svm.cpp:158: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). if (! mmap.open (filename)) throw std::runtime_error (mmap.what()); data/yamcha-0.33/src/svm.cpp:209:21: [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. clist = new char * [csize]; data/yamcha-0.33/src/svm.cpp:415:21: [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 SVM::open (const char *file) { return _impl->open (file); } data/yamcha-0.33/src/svm.cpp:415:73: [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 SVM::open (const char *file) { return _impl->open (file); } data/yamcha-0.33/src/yamcha.h:118: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). bool open (const char *); data/yamcha-0.33/src/yamcha.h:135:19: [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 (int, char**); data/yamcha-0.33/src/yamcha.h:136:19: [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 char*); data/yamcha-0.33/example/bag-of-words.cpp:43:23: [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 *stre = str + strlen (str); data/yamcha-0.33/example/bag-of-words.cpp:44:23: [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 *dele = del + strlen (del); data/yamcha-0.33/example/bag-of-words.cpp:79:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (tmp, str, 8192); data/yamcha-0.33/libexec/mkdarts.cpp:87:28: [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 *tmp = new char [strlen (buf+p) + 1]; data/yamcha-0.33/libexec/mktrie.cpp:63:33: [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). std::istrstream is (str, std::strlen(str)); data/yamcha-0.33/perl/YamCha_wrap.cxx:263: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/yamcha-0.33/perl/YamCha_wrap.cxx:664: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; data/yamcha-0.33/perl/YamCha_wrap.cxx:704:44: [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). sv_vsetpvfn(perl_get_sv("@", TRUE), fmt, strlen(fmt), &args, Null(SV**), 0, Null(bool*)); data/yamcha-0.33/perl/YamCha_wrap.cxx:770:36: [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). sv_magic(sv,sv,'U',(char *) name,strlen(name)); data/yamcha-0.33/python/YamCha_wrap.cxx:267: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/yamcha-0.33/python/YamCha_wrap.cxx:572: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). gv->name = (char *) malloc(strlen(name)+1); data/yamcha-0.33/python/YamCha_wrap.cxx:751: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/yamcha-0.33/python/YamCha_wrap.cxx:1073:33: [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(vptr) + 1) : 0; data/yamcha-0.33/python/YamCha_wrap.cxx:1112: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). size_t size = strlen(cptr); data/yamcha-0.33/ruby/YamCha_wrap.cpp:406: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/yamcha-0.33/ruby/YamCha_wrap.cpp:517:44: [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/yamcha-0.33/ruby/YamCha_wrap.cpp:543:40: [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/yamcha-0.33/ruby/YamCha_wrap.cpp:637: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/yamcha-0.33/src/chunker.cpp:103:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::istream& read (std::istream &); data/yamcha-0.33/src/chunker.cpp:425:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (features[features_size], s, MAX_STR_LEN); data/yamcha-0.33/src/chunker.cpp:448:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::istream& Chunker::Impl::read (std::istream &is) data/yamcha-0.33/src/chunker.cpp:504: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). std::istrstream is (str, len ? len : strlen (str)); data/yamcha-0.33/src/chunker.cpp:519: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). std::istrstream is (str, len ? len : strlen (str)); data/yamcha-0.33/src/chunker.cpp:527:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (! read (is)) return false; data/yamcha-0.33/src/mmap.h:203:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, text, length) < 0) data/yamcha-0.33/src/param.cpp:103:22: [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 nlen = strlen (opts[i].name); data/yamcha-0.33/src/param.cpp:183:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (str, arg, 1024); data/yamcha-0.33/src/param.cpp:206:22: [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 l = 1 + strlen (opts[i].name); data/yamcha-0.33/src/param.cpp:207:46: [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 (opts[i].arg_description) l += (1 + strlen (opts[i].arg_description)); data/yamcha-0.33/src/param.cpp:212:18: [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 l = strlen (opts[i].name); data/yamcha-0.33/src/param.cpp:213:46: [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 (opts[i].arg_description) l += (1 + strlen (opts[i].arg_description)); ANALYSIS SUMMARY: Hits = 114 Lines analyzed = 6900 in approximately 0.20 seconds (35150 lines/second) Physical Source Lines of Code (SLOC) = 5132 Hits@level = [0] 11 [1] 31 [2] 73 [3] 0 [4] 10 [5] 0 Hits@level+ = [0+] 125 [1+] 114 [2+] 83 [3+] 10 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 24.357 [1+] 22.2136 [2+] 16.173 [3+] 1.94856 [4+] 1.94856 [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.