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/yacas-1.3.6/docs/riptestfromyart.cpp
Examining data/yacas-1.3.6/docs/autocompleter.cpp
Examining data/yacas-1.3.6/src/patterns.cpp
Examining data/yacas-1.3.6/src/gencorefunctions.cpp
Examining data/yacas-1.3.6/src/xmltokenizer.cpp
Examining data/yacas-1.3.6/src/yacasnumbers.cpp
Examining data/yacas-1.3.6/src/lispevalhash.cpp
Examining data/yacas-1.3.6/src/stringio.cpp
Examining data/yacas-1.3.6/src/stdstubs.cpp
Examining data/yacas-1.3.6/src/deffile.cpp
Examining data/yacas-1.3.6/src/mathcommands3.cpp
Examining data/yacas-1.3.6/src/lisphash.cpp
Examining data/yacas-1.3.6/src/lispparser.cpp
Examining data/yacas-1.3.6/src/yacasmain.cpp
Examining data/yacas-1.3.6/src/lispobject.cpp
Examining data/yacas-1.3.6/src/lispio.cpp
Examining data/yacas-1.3.6/src/errors.cpp
Examining data/yacas-1.3.6/src/standard.cpp
Examining data/yacas-1.3.6/src/lispuserfunc.cpp
Examining data/yacas-1.3.6/src/stdcommandline.cpp
Examining data/yacas-1.3.6/src/arggetter.cpp
Examining data/yacas-1.3.6/src/platmath.cpp
Examining data/yacas-1.3.6/src/lispcleanupstack.cpp
Examining data/yacas-1.3.6/src/numbers.cpp
Examining data/yacas-1.3.6/src/win32commandline.cpp
Examining data/yacas-1.3.6/src/lispenvironment.cpp
Examining data/yacas-1.3.6/src/infixparser.cpp
Examining data/yacas-1.3.6/src/patcher.cpp
Examining data/yacas-1.3.6/src/mathcommands.cpp
Examining data/yacas-1.3.6/src/substitute.cpp
Examining data/yacas-1.3.6/src/unixcommandline.cpp
Examining data/yacas-1.3.6/src/lispatom.cpp
Examining data/yacas-1.3.6/src/yacasapi.cpp
Examining data/yacas-1.3.6/src/lispeval.cpp
Examining data/yacas-1.3.6/src/stdfileio.cpp
Examining data/yacas-1.3.6/src/obmalloc.cpp
Examining data/yacas-1.3.6/src/patternclass.cpp
Examining data/yacas-1.3.6/src/lisperror.cpp
Examining data/yacas-1.3.6/src/mathcommands2.cpp
Examining data/yacas-1.3.6/src/commandline.cpp
Examining data/yacas-1.3.6/src/mathuserfunc.cpp
Examining data/yacas-1.3.6/src/tokenizer.cpp
Examining data/yacas-1.3.6/src/debugmem.cpp
Examining data/yacas-1.3.6/src/genericstructs.cpp
Examining data/yacas-1.3.6/src/anumber.cpp
Examining data/yacas-1.3.6/src/yacasbase.cpp
Examining data/yacas-1.3.6/JavaYacas/dumpversion.cpp
Examining data/yacas-1.3.6/include/yacas/yacasprivate.h
Examining data/yacas-1.3.6/include/yacas/evalfunc.h
Examining data/yacas-1.3.6/include/yacas/commandline.h
Examining data/yacas-1.3.6/include/yacas/yacasbase.h
Examining data/yacas-1.3.6/include/yacas/lispevalhash.h
Examining data/yacas-1.3.6/include/yacas/lisperror.h
Examining data/yacas-1.3.6/include/yacas/patternclass.h
Examining data/yacas-1.3.6/include/yacas/lispeval.h
Examining data/yacas-1.3.6/include/yacas/stringio.h
Examining data/yacas-1.3.6/include/yacas/errors.h
Examining data/yacas-1.3.6/include/yacas/debugmem.h
Examining data/yacas-1.3.6/include/yacas/patcher.h
Examining data/yacas-1.3.6/include/yacas/genericobject.h
Examining data/yacas-1.3.6/include/yacas/anumber.h
Examining data/yacas-1.3.6/include/yacas/stdcommandline.h
Examining data/yacas-1.3.6/include/yacas/patterns.h
Examining data/yacas-1.3.6/include/yacas/lispcleanupstack.h
Examining data/yacas-1.3.6/include/yacas/lispenvironment.h
Examining data/yacas-1.3.6/include/yacas/lispio.h
Examining data/yacas-1.3.6/include/yacas/arrayclass.h
Examining data/yacas-1.3.6/include/yacas/corefunctions.h
Examining data/yacas-1.3.6/include/yacas/lisphash.h
Examining data/yacas-1.3.6/include/yacas/infixparser.h
Examining data/yacas-1.3.6/include/yacas/substitute.h
Examining data/yacas-1.3.6/include/yacas/core_yacasmain.h
Examining data/yacas-1.3.6/include/yacas/lispparser.h
Examining data/yacas-1.3.6/include/yacas/lispstring.h
Examining data/yacas-1.3.6/include/yacas/mathuserfunc.h
Examining data/yacas-1.3.6/include/yacas/xmltokenizer.h
Examining data/yacas-1.3.6/include/yacas/platmath.h
Examining data/yacas-1.3.6/include/yacas/platfileio.h
Examining data/yacas-1.3.6/include/yacas/lisptype.h
Examining data/yacas-1.3.6/include/yacas/tokenizer.h
Examining data/yacas-1.3.6/include/yacas/lispatom.h
Examining data/yacas-1.3.6/include/yacas/unixcommandline.h
Examining data/yacas-1.3.6/include/yacas/stdfileio.h
Examining data/yacas-1.3.6/include/yacas/genericstructs.h
Examining data/yacas-1.3.6/include/yacas/refcount.h
Examining data/yacas-1.3.6/include/yacas/standard.h
Examining data/yacas-1.3.6/include/yacas/lispuserfunc.h
Examining data/yacas-1.3.6/include/yacas/stubs.h
Examining data/yacas-1.3.6/include/yacas/lispglobals.h
Examining data/yacas-1.3.6/include/yacas/lispobject.h
Examining data/yacas-1.3.6/include/yacas/choices.h
Examining data/yacas-1.3.6/include/yacas/mathcommands.h
Examining data/yacas-1.3.6/include/yacas/noncopyable.h
Examining data/yacas-1.3.6/include/yacas/numbers.h
Examining data/yacas-1.3.6/include/yacas/yacas.h
Examining data/yacas-1.3.6/include/yacas/yacas_version.h
Examining data/yacas-1.3.6/include/yacas/arggetter.h
Examining data/yacas-1.3.6/include/yacas/deffile.h
Examining data/yacas-1.3.6/include/yacas/GPL_stuff.h
Examining data/yacas-1.3.6/manmake/removeduplicates.cpp
Examining data/yacas-1.3.6/manmake/manripper.cpp

FINAL RESULTS:

data/yacas-1.3.6/src/yacasmain.cpp:1105:27:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
        const ssize_t r = readlink("/proc/self/exe", buf.data(), sb.st_size + 1);
data/yacas-1.3.6/include/yacas/lisperror.h:226:20:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define DBG_printf printf
data/yacas-1.3.6/manmake/removeduplicates.cpp:23:7:  [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(prev,buf);
data/yacas-1.3.6/src/debugmem.cpp:228:5:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    printf(msg1, (++warnings >= wlimit) ? " (being quiet now)" : "");
data/yacas-1.3.6/src/mathcommands.cpp:1315:41:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  InternalBoolean(aEnvironment, RESULT, system(command.c_str()) == 0);
data/yacas-1.3.6/src/yacasmain.cpp:241:21:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                if (system(cmd.c_str()) == 0)
data/yacas-1.3.6/src/mathcommands.cpp:804:5:  [3] (tmpfile) GetTempFileName:
  Temporary file race condition in certain cases (e.g., if run as SYSTEM in
  many versions of Windows) (CWE-377).
    GetTempFileName(tmp_path, "yacas", 0, tmp_fn);
data/yacas-1.3.6/src/obmalloc.cpp:259:63:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
#define SIMPLELOCK_LOCK(lock) { if (_yacas_threadsafe_malloc) EnterCriticalSection(&lock); }
data/yacas-1.3.6/src/unixcommandline.cpp:93:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    const char* home_dir = getenv("HOME");
data/yacas-1.3.6/src/unixcommandline.cpp:111:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    const char* home_dir = getenv("HOME");
data/yacas-1.3.6/src/yacasmain.cpp:508:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (const char* home = getenv("HOME")) {
data/yacas-1.3.6/src/yacasmain.cpp:1092:5:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    realpath(buf, path);
data/yacas-1.3.6/docs/autocompleter.cpp:43:1:  [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 *items[10];
data/yacas-1.3.6/docs/autocompleter.cpp:99: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 buffer[16384];
data/yacas-1.3.6/docs/autocompleter.cpp:111:17:  [2] (misc) fopen:
  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).
    FILE* fex = fopen("examples-static.txt","rb");
data/yacas-1.3.6/docs/autocompleter.cpp:140:12:  [2] (misc) fopen:
  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).
  FILE*fin=fopen(inName,"rb");
data/yacas-1.3.6/docs/autocompleter.cpp:142:8:  [2] (misc) fopen:
  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).
  fout=fopen(outName,"wb");
data/yacas-1.3.6/docs/riptestfromyart.cpp:34:15:  [2] (misc) fopen:
  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).
  FILE* fin = fopen(inName,"rb");
data/yacas-1.3.6/docs/riptestfromyart.cpp:59:14:  [2] (misc) fopen:
  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).
  FILE* fout=fopen(outName,"wb");
data/yacas-1.3.6/include/yacas/unixcommandline.h:25:14:  [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 term_chars[NCCS];
data/yacas-1.3.6/manmake/manripper.cpp:40:14:  [2] (misc) fopen:
  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).
    FILE*f = fopen(fname, "r");
data/yacas-1.3.6/manmake/manripper.cpp:44: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 buf[2048];
data/yacas-1.3.6/manmake/manripper.cpp:63:17:  [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 cmd[256];
data/yacas-1.3.6/manmake/manripper.cpp:65: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(cmd, command, end - command);
data/yacas-1.3.6/manmake/manripper.cpp:79:13:  [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 cmd[256];
data/yacas-1.3.6/manmake/manripper.cpp:85: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(cmd, &buf[1], ptr - (&buf[1]));
data/yacas-1.3.6/manmake/removeduplicates.cpp:10:15:  [2] (misc) fopen:
  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).
  FILE* fin = fopen(argv[1],"rb");
data/yacas-1.3.6/manmake/removeduplicates.cpp:12:16:  [2] (misc) fopen:
  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).
  FILE* fout = fopen(argv[2],"wb");
data/yacas-1.3.6/manmake/removeduplicates.cpp:15: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 prev[8192];
data/yacas-1.3.6/manmake/removeduplicates.cpp:17: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/yacas-1.3.6/src/anumber.cpp:230:22:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                std::memcpy(&copied[0],  &fraction[0], nrc*sizeof(LispString::value_type));
data/yacas-1.3.6/src/anumber.cpp:259:23:  [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).
      iTensExp = std::atoi(aString + endFloatIndex + 1);
data/yacas-1.3.6/src/anumber.cpp:276:14:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        std::memcpy(&((*this)[0]), &(aOther[0]), nr*sizeof(ANumber::value_type));
data/yacas-1.3.6/src/debugmem.cpp:24: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      iMagicPrefix[4];
data/yacas-1.3.6/src/debugmem.cpp:153: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(result,orig,max);
data/yacas-1.3.6/src/mathcommands.cpp:785:14:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    int fd = mkstemp(fn);
data/yacas-1.3.6/src/obmalloc.cpp:1250: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(bp, p, size);
data/yacas-1.3.6/src/obmalloc.cpp:1571: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 msgbuf[64];
data/yacas-1.3.6/src/obmalloc.cpp:1726: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 buf[100];
data/yacas-1.3.6/src/obmalloc.cpp:1790: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 buf[128];
data/yacas-1.3.6/src/stdfileio.cpp:138:18:  [2] (misc) fopen:
  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).
    FILE* file = fopen(path.c_str(), "rb");
data/yacas-1.3.6/src/stdfileio.cpp:143:16:  [2] (misc) fopen:
  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).
        file = fopen(path.c_str(), "rb");
data/yacas-1.3.6/src/stdfileio.cpp:168: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).
        stream.open(othername, std::ios_base::in | std::ios_base::binary);
data/yacas-1.3.6/src/stdfileio.cpp:174: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(othername, std::ios_base::in | std::ios_base::binary);
data/yacas-1.3.6/src/stdfileio.cpp:179: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).
        stream.open(othername, std::ios_base::out);
data/yacas-1.3.6/src/win32commandline.cpp:129: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 appdata_dir_buf[MAX_PATH];
data/yacas-1.3.6/src/win32commandline.cpp:145: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 appdata_dir_buf[MAX_PATH];
data/yacas-1.3.6/src/yacasmain.cpp:491: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 appdata_dir_buf[MAX_PATH];
data/yacas-1.3.6/src/yacasmain.cpp:567: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 newWindowTitle[256];
data/yacas-1.3.6/src/yacasmain.cpp:941: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.
                    char full_prompt[30];
data/yacas-1.3.6/src/yacasmain.cpp:1001:35:  [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).
                    server_port = atoi(argv[fileind]);
data/yacas-1.3.6/src/yacasmain.cpp:1008:34:  [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).
                    stack_size = atoi(argv[fileind]);
data/yacas-1.3.6/src/yacasmain.cpp:1087: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 buf[PATH_MAX];
data/yacas-1.3.6/src/yacasmain.cpp:1091: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 path[PATH_MAX];
data/yacas-1.3.6/src/yacasmain.cpp:1124: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 root_dir_buf[MAX_PATH];
data/yacas-1.3.6/src/yacasmain.cpp:1134:10:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    std::strcat(root_dir_buf, "\\share\\yacas\\scripts");
data/yacas-1.3.6/docs/riptestfromyart.cpp:10: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).
  int needleLength = strlen(needle);
data/yacas-1.3.6/include/yacas/platfileio.h:12:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        bool read,
data/yacas-1.3.6/manmake/manripper.cpp:27:32:  [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 std::size_t n = std::strlen(buf);
data/yacas-1.3.6/manmake/manripper.cpp:47: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).
        const std::size_t n = std::strlen(buf);
data/yacas-1.3.6/manmake/manripper.cpp:81: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).
                if (buf[strlen(buf) - 1] == '\n') buf[strlen(buf) - 1] = '\0';
data/yacas-1.3.6/manmake/manripper.cpp:81:55:  [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 (buf[strlen(buf) - 1] == '\n') buf[strlen(buf) - 1] = '\0';
data/yacas-1.3.6/src/obmalloc.cpp:1730: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).
    for (i = (int)strlen(msg); i < 35; ++i)
data/yacas-1.3.6/src/stdfileio.cpp:84:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    stream.read(_buf.data(), n);
data/yacas-1.3.6/src/stdfileio.cpp:158:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    bool read,
data/yacas-1.3.6/src/stdfileio.cpp:164:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read) {
data/yacas-1.3.6/src/unixcommandline.cpp:139:17:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    LispInt c = getc(stdin);
data/yacas-1.3.6/src/unixcommandline.cpp:180:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                c = getc(stdin); /* check for CSI */
data/yacas-1.3.6/src/unixcommandline.cpp:190:29:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                        c = getc(stdin); /* get command character */
data/yacas-1.3.6/src/yacasmain.cpp:423:14:  [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 (ptr2[strlen(ptr2)-1] != PATH_SEPARATOR)
data/yacas-1.3.6/src/yacasmain.cpp:729:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                        while ((bytesread = read(fd, &buffer.front(), nread)) != 0)
data/yacas-1.3.6/src/yacasmain.cpp:808:65:  [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 std::size_t buflen = std::strlen(response);
data/yacas-1.3.6/src/yacasmain.cpp:816:71:  [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).
                                        write(fd, outStrings.c_str(), strlen(outStrings.c_str()));
data/yacas-1.3.6/src/yacasmain.cpp:837:66:  [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).
                                    send(fd, outStrings.c_str(), strlen(outStrings.c_str()), 0);
data/yacas-1.3.6/src/yacasmain.cpp:857:51:  [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).
                            c = write(fd, limtxt, strlen(limtxt));
data/yacas-1.3.6/src/yacasmain.cpp:865: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).
                            send(fd, limtxt, strlen(limtxt), 0);

ANALYSIS SUMMARY:

Hits = 76
Lines analyzed = 20170 in approximately 0.43 seconds (46850 lines/second)
Physical Source Lines of Code (SLOC) = 14342
Hits@level = [0]  50 [1]  20 [2]  44 [3]   6 [4]   5 [5]   1
Hits@level+ = [0+] 126 [1+]  76 [2+]  56 [3+]  12 [4+]   6 [5+]   1
Hits/KSLOC@level+ = [0+] 8.78539 [1+] 5.29912 [2+] 3.90462 [3+] 0.836703 [4+] 0.418352 [5+] 0.0697253
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.