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/hfst-ospell-0.5.2/ZHfstOspeller.cc
Examining data/hfst-ospell-0.5.2/ZHfstOspeller.h
Examining data/hfst-ospell-0.5.2/ZHfstOspellerXmlMetadata.cc
Examining data/hfst-ospell-0.5.2/ZHfstOspellerXmlMetadata.h
Examining data/hfst-ospell-0.5.2/hfst-ol.cc
Examining data/hfst-ospell-0.5.2/hfst-ol.h
Examining data/hfst-ospell-0.5.2/hfstol-stdafx.h
Examining data/hfst-ospell-0.5.2/main-cicling.cc
Examining data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc
Examining data/hfst-ospell-0.5.2/main-ispell.cc
Examining data/hfst-ospell-0.5.2/main-lrec2013.cc
Examining data/hfst-ospell-0.5.2/main-norvig.cc
Examining data/hfst-ospell-0.5.2/main-survey.cc
Examining data/hfst-ospell-0.5.2/main.cc
Examining data/hfst-ospell-0.5.2/office.cc
Examining data/hfst-ospell-0.5.2/ol-exceptions.h
Examining data/hfst-ospell-0.5.2/ospell.cc
Examining data/hfst-ospell-0.5.2/ospell.h

FINAL RESULTS:

data/hfst-ospell-0.5.2/ZHfstOspeller.cc:100:5:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
    mktemp(rv);
data/hfst-ospell-0.5.2/main-ispell.cc:33:43:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#  define error(status, errnum, fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__); \
data/hfst-ospell-0.5.2/main-ispell.cc:53:14:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    int rv = sprintf(testname, "speller-%s.zhfst", langcode);
data/hfst-ospell-0.5.2/main-ispell.cc:68:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    rv = sprintf(testname, "/usr/share/voikko/3/speller-%s.zhfst",
data/hfst-ospell-0.5.2/main-ispell.cc:89:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    rv = sprintf(testname, "%s/.voikko/3/speller-%s.zhfst", homepath,
data/hfst-ospell-0.5.2/main-lrec2013.cc:33:44:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define error(status, errnum, format, ...) fprintf(stderr, format, ##__VA_ARGS__); \
data/hfst-ospell-0.5.2/main-lrec2013.cc:100: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(PACKAGE_STRING
data/hfst-ospell-0.5.2/main.cc:79:15:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
      int r = vsprintf(buffer, format, args);
data/hfst-ospell-0.5.2/main.cc:101:20:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      int retval = vfprintf(stream, format, args);
data/hfst-ospell-0.5.2/main.cc:107:16:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  int retval = vfprintf(stream, format, args);
data/hfst-ospell-0.5.2/main-cicling.cc:90:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hVvqs", long_options, &option_index);
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:365:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hVvqsp:", long_options, &option_index);
data/hfst-ospell-0.5.2/main-ispell.cc:81:22:  [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.
    char* homepath = getenv("HOME");
data/hfst-ospell-0.5.2/main-ispell.cc:366:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "1ad:DGhvlLw", long_options, &option_index);
data/hfst-ospell-0.5.2/main-lrec2013.cc:432:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hVvqsP:X:H:n:", long_options, &option_index);
data/hfst-ospell-0.5.2/main-norvig.cc:90:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hVvqs", long_options, &option_index);
data/hfst-ospell-0.5.2/main-survey.cc:435:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hVvqsP:X:H:n:", long_options, &option_index);
data/hfst-ospell-0.5.2/main.cc:468:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hVvqsan:w:b:t:SXm:l:k", long_options, &option_index);
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:95: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 rv[MAX_PATH+1];
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:99:5:  [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.
    strcat(rv, "zhfstospellXXXXXX");
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:101: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).
    int temp_fd = open(rv, _O_CREAT | _O_TRUNC | _O_RDWR);
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:104:19:  [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 temp_fd = mkstemp(rv);
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:116: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* f = fopen(filename, "rb");
data/hfst-ospell-0.5.2/hfst-ol.cc:102: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 c[4];
data/hfst-ospell-0.5.2/hfst-ol.cc:682: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((void *) indices, (const void *) *raw, table_size);
data/hfst-ospell-0.5.2/hfst-ol.cc:721: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((void *) transitions, (const void *) *raw, table_size);
data/hfst-ospell-0.5.2/main-cicling.cc:130:24:  [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).
        mutator_file = fopen(argv[(optind)], "r");
data/hfst-ospell-0.5.2/main-cicling.cc:136:24:  [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).
        lexicon_file = fopen(argv[(optind + 1)], "r");
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:89:26:  [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* mutator_file = fopen(errmodel_filename, "r");
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:95:26:  [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* lexicon_file = fopen(acceptor_filename, "r");
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:153:27:  [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* mutator_file1 = fopen(errmodel_filename1, "r");
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:159:27:  [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* mutator_file2 = fopen(errmodel_filename2, "r");
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:165:26:  [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* lexicon_file = fopen(acceptor_filename, "r");
data/hfst-ospell-0.5.2/main-fsmnlp-2012.cc:387:28:  [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).
            profile_file = fopen(optarg, "a");
data/hfst-ospell-0.5.2/main-ispell.cc:58: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).
    testhandle = fopen(testname, "r");
data/hfst-ospell-0.5.2/main-ispell.cc:74: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).
    testhandle = fopen(testname, "r");
data/hfst-ospell-0.5.2/main-ispell.cc:95: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).
    testhandle = fopen(testname, "r");
data/hfst-ospell-0.5.2/main-ispell.cc:191:26:  [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* mutator_file = fopen(errmodel_filename, "r");
data/hfst-ospell-0.5.2/main-ispell.cc:198:26:  [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* lexicon_file = fopen(acceptor_filename, "r");
data/hfst-ospell-0.5.2/main-ispell.cc:443:28:  [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* infile = fopen(argv[optind], "r");
data/hfst-ospell-0.5.2/main-lrec2013.cc:454:28:  [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).
            profile_file = fopen(optarg, "a");
data/hfst-ospell-0.5.2/main-lrec2013.cc:462:31:  [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).
            statistics_file = fopen(optarg, "w");
data/hfst-ospell-0.5.2/main-lrec2013.cc:469:30:  [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).
            histogram_file = fopen(optarg, "w");
data/hfst-ospell-0.5.2/main-norvig.cc:130:24:  [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).
        mutator_file = fopen(argv[(optind)], "r");
data/hfst-ospell-0.5.2/main-norvig.cc:136:24:  [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).
        lexicon_file = fopen(argv[(optind + 1)], "r");
data/hfst-ospell-0.5.2/main-survey.cc:111:26:  [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* mutator_file = fopen(errmodel_filename, "r");
data/hfst-ospell-0.5.2/main-survey.cc:117:26:  [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* lexicon_file = fopen(acceptor_filename, "r");
data/hfst-ospell-0.5.2/main-survey.cc:457:28:  [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).
            profile_file = fopen(optarg, "a");
data/hfst-ospell-0.5.2/main-survey.cc:465:31:  [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).
            statistics_file = fopen(optarg, "w");
data/hfst-ospell-0.5.2/main-survey.cc:472:30:  [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).
            histogram_file = fopen(optarg, "w");
data/hfst-ospell-0.5.2/main.cc:78:7:  [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/hfst-ospell-0.5.2/main.cc:90:11:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
          MultiByteToWideChar(CP_UTF8 , 0 , pstr.c_str() , -1, NULL , 0 );
data/hfst-ospell-0.5.2/main.cc:92:9:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
        MultiByteToWideChar(CP_UTF8 , 0 ,
data/hfst-ospell-0.5.2/main.cc:601:29:  [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 * err_file = fopen(error_model_filename.c_str(), "r");
data/hfst-ospell-0.5.2/main.cc:602:29:  [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 * lex_file = fopen(lexicon_filename.c_str(), "r");
data/hfst-ospell-0.5.2/ospell.cc:1164: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 new_symbol[5]; // max size plus NUL
data/hfst-ospell-0.5.2/ospell.cc:1165: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(new_symbol, oldpointer, bytes_to_tokenize);
data/hfst-ospell-0.5.2/ospell.cc:1213:29:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    rv = static_cast<char*>(memcpy(rv, s, n));
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:314: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).
        if (strncmp(filename, "acceptor.", strlen("acceptor.")) == 0) {
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:343: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).
            p += strlen("acceptor.");
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:361:49:  [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).
        else if (strncmp(filename, "errmodel.", strlen("errmodel.")) == 0) {
data/hfst-ospell-0.5.2/ZHfstOspeller.cc:390: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).
            p += strlen("errmodel.");
data/hfst-ospell-0.5.2/ZHfstOspellerXmlMetadata.cc:967:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    file.read(&xml[0], static_cast<size_t>(st.st_size));
data/hfst-ospell-0.5.2/hfst-ol.cc:51:48:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    unsigned char byte1 = static_cast<uint8_t>(getc(f));
data/hfst-ospell-0.5.2/hfst-ol.cc:52:48:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    unsigned char byte2 = static_cast<uint8_t>(getc(f));
data/hfst-ospell-0.5.2/hfst-ol.cc:71:48:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    unsigned char byte1 = static_cast<uint8_t>(getc(f));
data/hfst-ospell-0.5.2/hfst-ol.cc:72:48:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    unsigned char byte2 = static_cast<uint8_t>(getc(f));
data/hfst-ospell-0.5.2/hfst-ol.cc:73:48:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    unsigned char byte3 = static_cast<uint8_t>(getc(f));
data/hfst-ospell-0.5.2/hfst-ol.cc:74:48:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    unsigned char byte4 = static_cast<uint8_t>(getc(f));
data/hfst-ospell-0.5.2/hfst-ol.cc:116:17:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int c = getc(f);
data/hfst-ospell-0.5.2/hfst-ol.cc:118:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(f);
data/hfst-ospell-0.5.2/hfst-ol.cc:119:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(f);
data/hfst-ospell-0.5.2/hfst-ol.cc:120:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(f);
data/hfst-ospell-0.5.2/hfst-ol.cc:155: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).
    for(header_loc = 0; header_loc < strlen(header1) + 1; header_loc++)
data/hfst-ospell-0.5.2/hfst-ol.cc:157:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(f);
data/hfst-ospell-0.5.2/hfst-ol.cc:163: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).
    if(header_loc == strlen(header1) + 1) // we found it
data/hfst-ospell-0.5.2/hfst-ol.cc:176:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (getc(f) != '\0') {
data/hfst-ospell-0.5.2/hfst-ol.cc:217: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).
    for(header_loc = 0; header_loc < strlen(header1) + 1; header_loc++)
data/hfst-ospell-0.5.2/hfst-ol.cc:225: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).
    if(header_loc == strlen(header1) + 1) // we found it
data/hfst-ospell-0.5.2/hfst-ol.cc:418:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void TransducerAlphabet::read(FILE * f, SymbolNumber number_of_symbols)
data/hfst-ospell-0.5.2/hfst-ol.cc:429:21:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ( (byte = fgetc(f)) != 0 ) {
data/hfst-ospell-0.5.2/hfst-ol.cc:438:25:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ( (byte = fgetc(f)) != 0 ) {
data/hfst-ospell-0.5.2/hfst-ol.cc:447: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).
        if (line[0] == '@' && line[strlen(line) - 1] == '@') {
data/hfst-ospell-0.5.2/hfst-ol.cc:448:17:  [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(line) >= 5 && line[2] == '.') { // flag diacritic
data/hfst-ospell-0.5.2/hfst-ol.cc:506:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void TransducerAlphabet::read(char ** raw, SymbolNumber number_of_symbols)
data/hfst-ospell-0.5.2/hfst-ol.cc:520: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).
        if ((*raw)[0] == '@' && (*raw)[strlen(*raw) - 1] == '@') {
data/hfst-ospell-0.5.2/hfst-ol.cc:521:17:  [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(*raw) >= 5 && (*raw)[2] == '.') { // flag diacritic
data/hfst-ospell-0.5.2/hfst-ol.cc:588:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(f, number_of_symbols);
data/hfst-ospell-0.5.2/hfst-ol.cc:597:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(raw, number_of_symbols);
data/hfst-ospell-0.5.2/hfst-ol.cc:664:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void IndexTable::read(FILE * f,
data/hfst-ospell-0.5.2/hfst-ol.cc:677:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void IndexTable::read(char ** raw,
data/hfst-ospell-0.5.2/hfst-ol.cc:703:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void TransitionTable::read(FILE * f,
data/hfst-ospell-0.5.2/hfst-ol.cc:716:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void TransitionTable::read(char ** raw,
data/hfst-ospell-0.5.2/hfst-ol.cc:798:9:  [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(s) == 0) { // ignore empty strings
data/hfst-ospell-0.5.2/hfst-ol.cc:801:10:  [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(s) == 1) && (unsigned char)(*s) <= 127 &&
data/hfst-ospell-0.5.2/hfst-ol.cc:899:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(f, number_of_table_entries);
data/hfst-ospell-0.5.2/hfst-ol.cc:907:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(raw, number_of_table_entries);
data/hfst-ospell-0.5.2/hfst-ol.cc:963:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(f, transition_count);
data/hfst-ospell-0.5.2/hfst-ol.cc:971:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(raw, transition_count);
data/hfst-ospell-0.5.2/hfst-ol.h:189:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void read(FILE * f, SymbolNumber number_of_symbols);
data/hfst-ospell-0.5.2/hfst-ol.h:190:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void read(char ** raw, SymbolNumber number_of_symbols);
data/hfst-ospell-0.5.2/hfst-ol.h:374:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void read(FILE * f,
data/hfst-ospell-0.5.2/hfst-ol.h:376:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void read(char ** raw,
data/hfst-ospell-0.5.2/hfst-ol.h:417:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void read(FILE * f,
data/hfst-ospell-0.5.2/hfst-ol.h:420:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    void read(char ** raw,
data/hfst-ospell-0.5.2/main-ispell.cc:52: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).
                            (strlen(langcode) + strlen("speller-.zhfst") + 1));
data/hfst-ospell-0.5.2/main-ispell.cc:52:49:  [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(langcode) + strlen("speller-.zhfst") + 1));
data/hfst-ospell-0.5.2/main-ispell.cc:66: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).
                            (strlen(langcode) + 
data/hfst-ospell-0.5.2/main-ispell.cc:67: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).
                             strlen("/usr/share/voikko/3/speller-.zhfst") + 1));
data/hfst-ospell-0.5.2/main-ispell.cc:87:24:  [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(homepath) + strlen("/.voikko/3/speller-.zhfst") +
data/hfst-ospell-0.5.2/main-ispell.cc:87:43:  [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(homepath) + strlen("/.voikko/3/speller-.zhfst") +
data/hfst-ospell-0.5.2/main-ispell.cc:88:24:  [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(langcode) + 1));
data/hfst-ospell-0.5.2/main-ispell.cc:240:17:  [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 (str[strlen(str) - 1] == '\r')
data/hfst-ospell-0.5.2/main-ispell.cc:310:17:  [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 (str[strlen(str) - 1] == '\r')
data/hfst-ospell-0.5.2/main-ispell.cc:315: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).
        else if (str[strlen(str) - 1] == '\n')
data/hfst-ospell-0.5.2/main-ispell.cc:317:17:  [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).
            str[strlen(str) - 1] = '\0';
data/hfst-ospell-0.5.2/main-lrec2013.cc:155:17:  [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 (str[strlen(str) - 1] == '\r')
data/hfst-ospell-0.5.2/main-survey.cc:157:17:  [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 (str[strlen(str) - 1] == '\r')
data/hfst-ospell-0.5.2/main.cc:364:17:  [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 (str[strlen(str) - 1] == '\r')
data/hfst-ospell-0.5.2/main.cc:367:17:  [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).
            str[strlen(str) - 1] = '\0';
data/hfst-ospell-0.5.2/main.cc:420:17:  [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 (str[strlen(str) - 1] == '\r')
data/hfst-ospell-0.5.2/main.cc:423:17:  [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).
            str[strlen(str) - 1] = '\0';

ANALYSIS SUMMARY:

Hits = 122
Lines analyzed = 8675 in approximately 0.26 seconds (33520 lines/second)
Physical Source Lines of Code (SLOC) = 7010
Hits@level = [0] 128 [1]  64 [2]  40 [3]   8 [4]  10 [5]   0
Hits@level+ = [0+] 250 [1+] 122 [2+]  58 [3+]  18 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 35.6633 [1+] 17.4037 [2+] 8.27389 [3+] 2.56776 [4+] 1.42653 [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.