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/libvoikko-4.3/src/hyphenator/interface.cpp Examining data/libvoikko-4.3/src/hyphenator/Hyphenator.cpp Examining data/libvoikko-4.3/src/hyphenator/HyphenatorFactory.cpp Examining data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.hpp Examining data/libvoikko-4.3/src/hyphenator/HfstHyphenator.hpp Examining data/libvoikko-4.3/src/hyphenator/HfstHyphenator.cpp Examining data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp Examining data/libvoikko-4.3/src/hyphenator/Hyphenator.hpp Examining data/libvoikko-4.3/src/hyphenator/HyphenatorFactory.hpp Examining data/libvoikko-4.3/src/morphology/interface.cpp Examining data/libvoikko-4.3/src/morphology/NullAnalyzer.cpp Examining data/libvoikko-4.3/src/morphology/LttoolboxAnalyzer.hpp Examining data/libvoikko-4.3/src/morphology/LttoolboxAnalyzer.cpp Examining data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp Examining data/libvoikko-4.3/src/morphology/HfstAnalyzer.cpp Examining data/libvoikko-4.3/src/morphology/Analysis.hpp Examining data/libvoikko-4.3/src/morphology/Analyzer.hpp Examining data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.hpp Examining data/libvoikko-4.3/src/morphology/HfstAnalyzer.hpp Examining data/libvoikko-4.3/src/morphology/Analyzer.cpp Examining data/libvoikko-4.3/src/morphology/AnalyzerFactory.hpp Examining data/libvoikko-4.3/src/morphology/VfstAnalyzer.hpp Examining data/libvoikko-4.3/src/morphology/NullAnalyzer.hpp Examining data/libvoikko-4.3/src/morphology/AnalyzerFactory.cpp Examining data/libvoikko-4.3/src/morphology/VfstAnalyzer.cpp Examining data/libvoikko-4.3/src/morphology/Analysis.cpp Examining data/libvoikko-4.3/src/voikko_structs.h Examining data/libvoikko-4.3/src/utf8/checked.hpp Examining data/libvoikko-4.3/src/utf8/unchecked.hpp Examining data/libvoikko-4.3/src/utf8/core.hpp Examining data/libvoikko-4.3/src/utf8/utf8.hpp Examining data/libvoikko-4.3/src/utils/utils.cpp Examining data/libvoikko-4.3/src/utils/StringUtils.cpp Examining data/libvoikko-4.3/src/utils/utils.hpp Examining data/libvoikko-4.3/src/utils/StringUtils.hpp Examining data/libvoikko-4.3/src/fst/WeightedTransducer.cpp Examining data/libvoikko-4.3/src/fst/UnweightedTransducer.hpp Examining data/libvoikko-4.3/src/fst/WeightedConfiguration.cpp Examining data/libvoikko-4.3/src/fst/WeightedConfiguration.hpp Examining data/libvoikko-4.3/src/fst/Transducer.cpp Examining data/libvoikko-4.3/src/fst/Configuration.hpp Examining data/libvoikko-4.3/src/fst/WeightedTransition.hpp Examining data/libvoikko-4.3/src/fst/WeightedTransducer.hpp Examining data/libvoikko-4.3/src/fst/Configuration.cpp Examining data/libvoikko-4.3/src/fst/Transducer.hpp Examining data/libvoikko-4.3/src/fst/Transition.hpp Examining data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp Examining data/libvoikko-4.3/src/setup/DictionaryFactory.cpp Examining data/libvoikko-4.3/src/setup/interface.cpp Examining data/libvoikko-4.3/src/setup/BackendProperties.cpp Examining data/libvoikko-4.3/src/setup/V3DictionaryLoader.hpp Examining data/libvoikko-4.3/src/setup/DictionaryException.cpp Examining data/libvoikko-4.3/src/setup/DictionaryException.hpp Examining data/libvoikko-4.3/src/setup/V3DictionaryLoader.cpp Examining data/libvoikko-4.3/src/setup/V4DictionaryLoader.cpp Examining data/libvoikko-4.3/src/setup/DictionaryLoader.cpp Examining data/libvoikko-4.3/src/setup/BackendProperties.hpp Examining data/libvoikko-4.3/src/setup/Dictionary.cpp Examining data/libvoikko-4.3/src/setup/setup.cpp Examining data/libvoikko-4.3/src/setup/V5DictionaryLoader.hpp Examining data/libvoikko-4.3/src/setup/LanguageTag.hpp Examining data/libvoikko-4.3/src/setup/DictionaryLoader.hpp Examining data/libvoikko-4.3/src/setup/Dictionary.hpp Examining data/libvoikko-4.3/src/setup/LanguageTag.cpp Examining data/libvoikko-4.3/src/setup/setup.hpp Examining data/libvoikko-4.3/src/setup/V4DictionaryLoader.hpp Examining data/libvoikko-4.3/src/setup/V5DictionaryLoader.cpp Examining data/libvoikko-4.3/src/setup/DictionaryFactory.hpp Examining data/libvoikko-4.3/src/voikko_enums.h Examining data/libvoikko-4.3/src/porting.h Examining data/libvoikko-4.3/src/spellchecker/SpellerFactory.cpp Examining data/libvoikko-4.3/src/spellchecker/VfstSpeller.hpp Examining data/libvoikko-4.3/src/spellchecker/VfstSpeller.cpp Examining data/libvoikko-4.3/src/spellchecker/Speller.cpp Examining data/libvoikko-4.3/src/spellchecker/HfstSpeller.cpp Examining data/libvoikko-4.3/src/spellchecker/SpellerCache.cpp Examining data/libvoikko-4.3/src/spellchecker/FinnishSpellerTweaksWrapper.hpp Examining data/libvoikko-4.3/src/spellchecker/SpellerCache.hpp Examining data/libvoikko-4.3/src/spellchecker/AnalyzerToSpellerAdapter.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertSpecial.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSplitWord.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorFactory.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/Suggestion.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSoftHyphens.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGenerator.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeleteTwo.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorMultiReplacement.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorMultiReplacement.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStrategy.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStrategyOcr.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorFactory.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeletion.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSoftHyphens.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorCaseChange.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStrategyTyping.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSplitWord.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorReplaceTwo.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorReplacement.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSwap.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorVowelChange.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorNull.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStrategyTyping.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertion.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertion.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStatus.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeleteTwo.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeletion.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStatus.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStrategyOcr.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/Suggestion.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorReplaceTwo.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionType.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSwap.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionStrategy.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorNull.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorCaseChange.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorVowelChange.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorReplacement.cpp Examining data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertSpecial.cpp Examining data/libvoikko-4.3/src/spellchecker/HfstSpeller.hpp Examining data/libvoikko-4.3/src/spellchecker/SpellUtils.hpp Examining data/libvoikko-4.3/src/spellchecker/spell.cpp Examining data/libvoikko-4.3/src/spellchecker/Speller.hpp Examining data/libvoikko-4.3/src/spellchecker/FinnishSpellerTweaksWrapper.cpp Examining data/libvoikko-4.3/src/spellchecker/VfstSuggestion.cpp Examining data/libvoikko-4.3/src/spellchecker/VfstSuggestion.hpp Examining data/libvoikko-4.3/src/spellchecker/HfstSuggestion.hpp Examining data/libvoikko-4.3/src/spellchecker/suggestions.cpp Examining data/libvoikko-4.3/src/spellchecker/SpellWithPriority.hpp Examining data/libvoikko-4.3/src/spellchecker/SpellerFactory.hpp Examining data/libvoikko-4.3/src/spellchecker/SpellUtils.cpp Examining data/libvoikko-4.3/src/spellchecker/SpellWithPriority.cpp Examining data/libvoikko-4.3/src/spellchecker/FixedResultSpeller.cpp Examining data/libvoikko-4.3/src/spellchecker/AnalyzerToSpellerAdapter.cpp Examining data/libvoikko-4.3/src/spellchecker/FixedResultSpeller.hpp Examining data/libvoikko-4.3/src/spellchecker/HfstSuggestion.cpp Examining data/libvoikko-4.3/src/voikko_defines.h Examining data/libvoikko-4.3/src/voikko_deprecated.h Examining data/libvoikko-4.3/src/grammar/Paragraph.cpp Examining data/libvoikko-4.3/src/grammar/interface.cpp Examining data/libvoikko-4.3/src/grammar/GrammarCheckerFactory.hpp Examining data/libvoikko-4.3/src/grammar/error.cpp Examining data/libvoikko-4.3/src/grammar/RuleEngine.hpp Examining data/libvoikko-4.3/src/grammar/GcCache.cpp Examining data/libvoikko-4.3/src/grammar/NullGrammarChecker.hpp Examining data/libvoikko-4.3/src/grammar/FinnishAnalysis.cpp Examining data/libvoikko-4.3/src/grammar/FinnishGrammarChecker.cpp Examining data/libvoikko-4.3/src/grammar/NullGrammarChecker.cpp Examining data/libvoikko-4.3/src/grammar/GrammarChecker.cpp Examining data/libvoikko-4.3/src/grammar/Analysis.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine.cpp Examining data/libvoikko-4.3/src/grammar/CacheEntry.hpp Examining data/libvoikko-4.3/src/grammar/HfstAnalysis.hpp Examining data/libvoikko-4.3/src/grammar/CgGrammarChecker.cpp Examining data/libvoikko-4.3/src/grammar/Token.hpp Examining data/libvoikko-4.3/src/grammar/FinnishAnalysis.hpp Examining data/libvoikko-4.3/src/grammar/VoikkoGrammarError.cpp Examining data/libvoikko-4.3/src/grammar/RuleEngine.cpp Examining data/libvoikko-4.3/src/grammar/GrammarCheckerFactory.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine.hpp Examining data/libvoikko-4.3/src/grammar/Paragraph.hpp Examining data/libvoikko-4.3/src/grammar/VoikkoGrammarError.hpp Examining data/libvoikko-4.3/src/grammar/Sentence.cpp Examining data/libvoikko-4.3/src/grammar/CgRuleEngine.cpp Examining data/libvoikko-4.3/src/grammar/FinnishGrammarChecker.hpp Examining data/libvoikko-4.3/src/grammar/error.hpp Examining data/libvoikko-4.3/src/grammar/Analysis.cpp Examining data/libvoikko-4.3/src/grammar/GcCache.hpp Examining data/libvoikko-4.3/src/grammar/HfstAnalysis.cpp Examining data/libvoikko-4.3/src/grammar/GrammarChecker.hpp Examining data/libvoikko-4.3/src/grammar/CacheEntry.cpp Examining data/libvoikko-4.3/src/grammar/Sentence.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/SentenceCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/VfstAutocorrectCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/CompoundVerbCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/NegativeVerbCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/RelativePronounCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/ParagraphCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/CapitalizationCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/VfstAutocorrectCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/SentenceCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/CompoundVerbCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/RelativePronounCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/MissingVerbCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/SidesanaCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/NegativeVerbCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/SidesanaCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/MissingVerbCheck.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/checks.hpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/CapitalizationCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/ParagraphCheck.cpp Examining data/libvoikko-4.3/src/grammar/FinnishRuleEngine/checks.cpp Examining data/libvoikko-4.3/src/sentence/interface.cpp Examining data/libvoikko-4.3/src/sentence/Sentence.cpp Examining data/libvoikko-4.3/src/sentence/Sentence.hpp Examining data/libvoikko-4.3/src/tokenizer/interface.cpp Examining data/libvoikko-4.3/src/tokenizer/Tokenizer.cpp Examining data/libvoikko-4.3/src/tokenizer/Tokenizer.hpp Examining data/libvoikko-4.3/src/tools/voikkogc.cpp Examining data/libvoikko-4.3/src/tools/voikkovfstc.cpp Examining data/libvoikko-4.3/src/tools/voikkohyphenate.cpp Examining data/libvoikko-4.3/src/tools/voikkospell.cpp Examining data/libvoikko-4.3/src/character/charset.hpp Examining data/libvoikko-4.3/src/character/SimpleChar.hpp Examining data/libvoikko-4.3/src/character/SimpleChar.cpp Examining data/libvoikko-4.3/src/character/charset.cpp Examining data/libvoikko-4.3/src/voikko.h Examining data/libvoikko-4.3/src/compatibility/interface.cpp FINAL RESULTS: data/libvoikko-4.3/src/compatibility/interface.cpp:250: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(gError.suggestions[i], suggestions[i]); data/libvoikko-4.3/src/grammar/interface.cpp:69: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(e->getSuggestions()[i], c_error->getSuggestions()[i]); data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:95:2: [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(intersection, hyphenations[0]); data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:270:2: [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(intersection, hyphenations[0]); data/libvoikko-4.3/src/setup/interface.cpp:115: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(languages[n], lang.c_str()); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorVowelChange.cpp:58:3: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(buffer, s->getWord()); data/libvoikko-4.3/src/utils/StringUtils.cpp:138:2: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(copied, original); data/libvoikko-4.3/src/utils/StringUtils.cpp:145:2: [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(copied, original); data/libvoikko-4.3/src/utils/StringUtils.cpp:168:2: [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(newString, cString); data/libvoikko-4.3/src/utils/StringUtils.cpp:194: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(newArray[i], stringArray[i]); data/libvoikko-4.3/src/utils/utils.hpp:35:16: [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 LOG(x) printf x data/libvoikko-4.3/src/setup/DictionaryFactory.cpp:123:26: [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 * dict_from_env = getenv("VOIKKO_DICTIONARY"); data/libvoikko-4.3/src/setup/DictionaryFactory.cpp:182:25: [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 * path_from_env = getenv("VOIKKO_DICTIONARY_PATH"); data/libvoikko-4.3/src/compatibility/interface.cpp:52:2: [2] (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). Risk is low because the source is a constant string. strcpy(language, "fi-x"); data/libvoikko-4.3/src/fst/Transducer.cpp:127: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). int fd = open(filePath, O_RDONLY); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:79:3: [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(newMapPtr, &symbolCount, sizeof(uint16_t)); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:85:4: [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(newMapPtr, oldMapPtr, symLength); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:105: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(newMapPtr, &oc, sizeof(OverflowCell)); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:115: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(newMapPtr, &t, sizeof(Transition)); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:141:3: [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(&symbolCount, filePtr, sizeof(uint16_t)); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:277:3: [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(currentFlagArray + flagDiacriticFeatureCount, currentFlagArray, diacriticCell); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:84:3: [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(newMapPtr, &symbolCount, sizeof(uint16_t)); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:90:4: [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(newMapPtr, oldMapPtr, symLength); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:110: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(newMapPtr, &oc, sizeof(WeightedOverflowCell)); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:120: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(newMapPtr, &t, sizeof(WeightedTransition)); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:147:3: [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(&symbolCount, filePtr, sizeof(uint16_t)); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:279:3: [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(currentFlagArray + flagDiacriticFeatureCount, currentFlagArray, diacriticCell); data/libvoikko-4.3/src/grammar/FinnishAnalysis.cpp:209:3: [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(tstr, pos, tokenlen * sizeof(wchar_t)); data/libvoikko-4.3/src/grammar/GrammarChecker.cpp:68:2: [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(cache.paragraph, text, textlen * sizeof(wchar_t)); data/libvoikko-4.3/src/grammar/HfstAnalysis.cpp:99:3: [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(tstr, pos, tokenlen * sizeof(wchar_t)); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:1056:2: [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(wordLowerUcs4, word, wlen * sizeof(wchar_t)); data/libvoikko-4.3/src/morphology/HfstAnalyzer.cpp:47:13: [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 *fd = fopen(s.c_str(), "rb"); data/libvoikko-4.3/src/morphology/LttoolboxAnalyzer.cpp:31: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 * transducerFile = fopen(fileName.c_str(), "r"); data/libvoikko-4.3/src/morphology/VfstAnalyzer.cpp:79:2: [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(wordLowerUcs4, word, wlen * sizeof(wchar_t)); data/libvoikko-4.3/src/setup/DictionaryFactory.cpp:217: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 buffer[BUFFER_LENGTH]; data/libvoikko-4.3/src/setup/DictionaryFactory.cpp:231: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 szPath[MAX_PATH]; data/libvoikko-4.3/src/tools/voikkohyphenate.cpp:134: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 minhwlen = atoi(argv[i] + 27); data/libvoikko-4.3/src/tools/voikkospell.cpp:355: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). cache_size = atoi(argv[i] + 2); data/libvoikko-4.3/src/tools/voikkospell.cpp:383: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). threadCount = atoi(argv[++i]); data/libvoikko-4.3/src/character/SimpleChar.cpp:191:6: [1] (buffer) wcslen: 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 (wcslen(str1) != wcslen(str2)) { data/libvoikko-4.3/src/character/SimpleChar.cpp:191:22: [1] (buffer) wcslen: 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 (wcslen(str1) != wcslen(str2)) { data/libvoikko-4.3/src/compatibility/interface.cpp:50: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 variantLen = strlen(variant); // this must be at least 1 data/libvoikko-4.3/src/compatibility/interface.cpp:249:57: [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). gError.suggestions[i] = static_cast<char *>(malloc((strlen(suggestions[i]) + 1) * sizeof(char))); data/libvoikko-4.3/src/compatibility/interface.cpp:278:20: [1] (buffer) wcslen: 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 wtextlen = wcslen(text_ucs4); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:84: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). size_t symLength = strlen(oldMapPtr) + 1; data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:172:34: [1] (buffer) wcslen: 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). symbolStringLength.push_back(wcslen(ucs4Symbol)); data/libvoikko-4.3/src/fst/UnweightedTransducer.cpp:315:8: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(outputBufferPos, symbolToString[outSymIndex], symLen); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:89: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). size_t symLength = strlen(oldMapPtr) + 1; data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:178:34: [1] (buffer) wcslen: 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). symbolStringLength.push_back(wcslen(ucs4Symbol)); data/libvoikko-4.3/src/fst/WeightedTransducer.cpp:325:8: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(outputBufferPos, symbolToString[outSymIndex], symLen); data/libvoikko-4.3/src/grammar/CgRuleEngine.cpp:153:51: [1] (buffer) wcslen: 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). fprintf(stderr, "CG[%ld, %ld]: %s\n", cur_pos, wcslen(cg3_tag_gettext_w(wftag)), wftmp); data/libvoikko-4.3/src/grammar/CgRuleEngine.cpp:173:28: [1] (buffer) wcslen: 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). e->error.setErrorLen(wcslen(cg3_tag_gettext_w(lwt)) - 4); data/libvoikko-4.3/src/grammar/CgRuleEngine.cpp:176:58: [1] (buffer) wcslen: 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). fprintf(stderr, " pos: %ld; len: %ld\n", cur_pos, wcslen(cg3_tag_gettext_w(lwt)) - 4); data/libvoikko-4.3/src/grammar/CgRuleEngine.cpp:186:47: [1] (buffer) wcslen: 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). fprintf(stderr, "%ld + %ld = ", cur_pos, (wcslen(cg3_tag_gettext_w(wftag)) - 4)); data/libvoikko-4.3/src/grammar/CgRuleEngine.cpp:187:26: [1] (buffer) wcslen: 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). cur_pos = cur_pos + (wcslen(cg3_tag_gettext_w(wftag)) - 4) + 1; data/libvoikko-4.3/src/grammar/FinnishAnalysis.cpp:77:74: [1] (buffer) wcslen: 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). list<morphology::Analysis *> * analyses = analyzer->analyze(wordBuffer, wcslen(wordBuffer), false); data/libvoikko-4.3/src/grammar/FinnishAnalysis.cpp:92:7: [1] (buffer) wcslen: 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 (wcslen(structure) < 2 || (structure[1] != L'p' && data/libvoikko-4.3/src/grammar/FinnishRuleEngine/CapitalizationCheck.cpp:249:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(suggestion + 1, word->str + 1, word->tokenlen - 1); data/libvoikko-4.3/src/grammar/FinnishRuleEngine/CapitalizationCheck.cpp:291:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(suggestion + 1, word->str + 1, word->tokenlen - 1); data/libvoikko-4.3/src/grammar/FinnishRuleEngine/checks.cpp:57:5: [1] (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). Risk is low because the source is a constant character. strcpy(e->error.legacyError.suggestions[0], " "); data/libvoikko-4.3/src/grammar/FinnishRuleEngine/checks.cpp:108:5: [1] (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). Risk is low because the source is a constant character. strcpy(e->error.legacyError.suggestions[0], ","); data/libvoikko-4.3/src/grammar/HfstAnalysis.cpp:72:50: [1] (buffer) wcslen: 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). token->analyses = analyser->analyze(wordBuffer, wcslen(wordBuffer), false); data/libvoikko-4.3/src/grammar/interface.cpp:68:37: [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). e->getSuggestions()[i] = new char[strlen(c_error->getSuggestions()[i]) + 1]; data/libvoikko-4.3/src/grammar/interface.cpp:87:20: [1] (buffer) wcslen: 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 wtextlen = wcslen(textUcs4); data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:92:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(hyphenations[0]); data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:173: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 utf8Len = strlen(wordUtf8); data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:267:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(hyphenations[0]); data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:466:12: [1] (buffer) wcslen: 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 (i + wcslen(LONG_CONSONANTS[j]) < nchars && data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:467:50: [1] (buffer) wcslen: 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). wcsncmp(&wordCopy[i], LONG_CONSONANTS[j], wcslen(LONG_CONSONANTS[j])) == 0) { data/libvoikko-4.3/src/hyphenator/AnalyzerToFinnishHyphenatorAdapter.cpp:468:37: [1] (buffer) wcslen: 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 (size_t k = i + 1; k <= i + wcslen(LONG_CONSONANTS[j]); k++) { data/libvoikko-4.3/src/hyphenator/HfstHyphenator.cpp:55:16: [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 wlen = strlen(word); data/libvoikko-4.3/src/hyphenator/HfstHyphenator.cpp:59: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* voikkoHyphenationPattern = new char[strlen(word)+1]; data/libvoikko-4.3/src/hyphenator/interface.cpp:42:16: [1] (buffer) wcslen: 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 wlen = wcslen(word); data/libvoikko-4.3/src/hyphenator/interface.cpp:55:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(word); data/libvoikko-4.3/src/hyphenator/interface.cpp:76:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(word); data/libvoikko-4.3/src/hyphenator/interface.cpp:84:67: [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). wchar_t * hyphen_ucs4 = utils::StringUtils::ucs4FromUtf8(hyphen, strlen(hyphen)); data/libvoikko-4.3/src/hyphenator/interface.cpp:96: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 patternLen = strlen(hyphenationPattern); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:140:48: [1] (buffer) wcslen: 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). list<Analysis *> * result = analyze(wordUcs4, wcslen(wordUcs4), fullMorphology); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:173:21: [1] (buffer) wcslen: 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 outputLen = wcslen(fstOutput); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:538:24: [1] (buffer) wcslen: 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 structureLen = wcslen(structure); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:679:18: [1] (buffer) wcslen: 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 fstLen = wcslen(fstOutput); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:704:30: [1] (buffer) wcslen: 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 structureLen = wcslen(oldStructure); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:737:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(wordIds + idpos, xsBuffer, xspos); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:744:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(wordBases + basepos, xpBuffer, xppos); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:867:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(wordBases + basepos, xpBuffer, xppos); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:874:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(wordIds + idpos, xsBuffer, xspos); data/libvoikko-4.3/src/morphology/FinnishVfstAnalyzer.cpp:1062:20: [1] (buffer) wcslen: 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 fstLen = wcslen(outputBuffer); data/libvoikko-4.3/src/morphology/HfstAnalyzer.cpp:64:16: [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 wlen = strlen(word); data/libvoikko-4.3/src/morphology/LttoolboxAnalyzer.cpp:42:23: [1] (buffer) wcslen: 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). return analyze(word, wcslen(word)); data/libvoikko-4.3/src/morphology/LttoolboxAnalyzer.cpp:68:16: [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 wlen = strlen(word); data/libvoikko-4.3/src/morphology/VfstAnalyzer.cpp:64:48: [1] (buffer) wcslen: 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). list<Analysis *> * result = analyze(wordUcs4, wcslen(wordUcs4), fullMorphology); data/libvoikko-4.3/src/morphology/interface.cpp:45:56: [1] (buffer) wcslen: 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). list<Analysis *> * analyses = analyzer->analyze(word, wcslen(word), true); data/libvoikko-4.3/src/morphology/interface.cpp:85:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(word); data/libvoikko-4.3/src/sentence/interface.cpp:51:58: [1] (buffer) wcslen: 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). result = voikkoNextSentenceStartUcs4(options, textUcs4, wcslen(textUcs4), data/libvoikko-4.3/src/spellchecker/FinnishSpellerTweaksWrapper.cpp:69:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, word, leading_len); data/libvoikko-4.3/src/spellchecker/FinnishSpellerTweaksWrapper.cpp:70:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + leading_len, hyphen_pos + 1, wlen - leading_len - 1); data/libvoikko-4.3/src/spellchecker/FinnishSpellerTweaksWrapper.cpp:129:59: [1] (buffer) wcslen: 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). list<Analysis *> * analyses = analyzer->analyze(buffer, wcslen(buffer), false); data/libvoikko-4.3/src/spellchecker/HfstSuggestion.cpp:60:56: [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). wchar_t * sugU4 = StringUtils::ucs4FromUtf8(sugUtf8, strlen(sugUtf8)); data/libvoikko-4.3/src/spellchecker/SpellerCache.cpp:110:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(words + cacheOffset, word, wlen); data/libvoikko-4.3/src/spellchecker/VfstSuggestion.cpp:70:58: [1] (buffer) wcslen: 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 (acceptor->prepare(acceptorConf, errorModelBuffer, wcslen(errorModelBuffer))) { data/libvoikko-4.3/src/spellchecker/spell.cpp:66:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, word, len); data/libvoikko-4.3/src/spellchecker/spell.cpp:71:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + 1, word, len); data/libvoikko-4.3/src/spellchecker/spell.cpp:107:18: [1] (buffer) wcslen: 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 nchars = wcslen(word); data/libvoikko-4.3/src/spellchecker/spell.cpp:121:11: [1] (buffer) wcslen: 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). nchars = wcslen(nword); data/libvoikko-4.3/src/spellchecker/spell.cpp:163:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, nword, nchars); data/libvoikko-4.3/src/spellchecker/spell.cpp:241:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(word); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorCaseChange.cpp:63:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(newsugg, word, wlen); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorCaseChange.cpp:70:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(newsugg + 1, word + 1, wlen - 1); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorCaseChange.cpp:84:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(newsugg, word, wlen); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeleteTwo.cpp:53:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, word, i); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeleteTwo.cpp:54:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + i, word + (i + 2), newLength - i); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeletion.cpp:45:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, s->getWord(), i); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorDeletion.cpp:46:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + i, s->getWord() + (i + 1), s->getWordLength() - i); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertSpecial.cpp:40:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + 1, s->getWord(), s->getWordLength()); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertSpecial.cpp:49:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, s->getWord(), j); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertSpecial.cpp:55:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + 1, s->getWord(), s->getWordLength() + 1); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorInsertion.cpp:47:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer + 1, s->getWord(), s->getWordLength()); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorMultiReplacement.cpp:44:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, s->getWord(), s->getWordLength()); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorReplacement.cpp:44:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, s->getWord(), s->getWordLength()); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSplitWord.cpp:72:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(part1, s->getWord(), s->getWordLength()); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSplitWord.cpp:87:4: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(suggestion + w2start, s->getWord() + splitind + stripLead2, w2len + 1); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSplitWord.cpp:91:5: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(suggestion, part1, splitind); data/libvoikko-4.3/src/spellchecker/suggestion/SuggestionGeneratorSwap.cpp:50:2: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, s->getWord(), s->getWordLength()); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:52:20: [1] (buffer) wcslen: 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 sugglen = wcslen(originalSuggestions[i].word); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:55:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(buffer, originalSuggestions[i].word, sugglen); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:90:16: [1] (buffer) wcslen: 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 wlen = wcslen(word); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:97:9: [1] (buffer) wcslen: 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). wlen = wcslen(nword); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:131:13: [1] (buffer) wcslen: 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). suglen = wcslen(suggestions[i]); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:140:13: [1] (buffer) wcslen: 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). suglen = wcslen(suggestions[i]); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:148:12: [1] (buffer) wcslen: 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). suglen = wcslen(suggestions[i]); data/libvoikko-4.3/src/spellchecker/suggestions.cpp:161:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(word); data/libvoikko-4.3/src/tokenizer/interface.cpp:49:43: [1] (buffer) wcslen: 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). voikkoNextTokenUcs4(options, text_ucs4, wcslen(text_ucs4), tokenlen); data/libvoikko-4.3/src/tools/voikkogc.cpp:254:20: [1] (buffer) wcslen: 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 lineLen = wcslen(line); data/libvoikko-4.3/src/tools/voikkohyphenate.cpp:141:8: [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(argv[i]) != 3 || mbtowc(&separator, argv[i] + 2, 1) < 1) { data/libvoikko-4.3/src/tools/voikkohyphenate.cpp:161:20: [1] (buffer) wcslen: 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 lineLen = wcslen(line); data/libvoikko-4.3/src/tools/voikkospell.cpp:493:20: [1] (buffer) wcslen: 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 lineLen = wcslen(line); data/libvoikko-4.3/src/utils/StringUtils.cpp:39: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). return ucs4FromUtf8(original, strlen(original)); data/libvoikko-4.3/src/utils/StringUtils.cpp:88:32: [1] (buffer) wcslen: 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). return utf8FromUcs4(original, wcslen(original)); data/libvoikko-4.3/src/utils/StringUtils.cpp:136:15: [1] (buffer) wcslen: 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 len = wcslen(original); data/libvoikko-4.3/src/utils/StringUtils.cpp:143:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(original); data/libvoikko-4.3/src/utils/StringUtils.cpp:163: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 strLen = strlen(cString); data/libvoikko-4.3/src/utils/StringUtils.cpp:188: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 strLen = strlen(stringArray[i]); data/libvoikko-4.3/src/utils/StringUtils.cpp:263:6: [1] (buffer) wcslen: 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 (wcslen(word) == 1) { ANALYSIS SUMMARY: Hits = 143 Lines analyzed = 22414 in approximately 0.79 seconds (28528 lines/second) Physical Source Lines of Code (SLOC) = 12798 Hits@level = [0] 17 [1] 104 [2] 26 [3] 2 [4] 11 [5] 0 Hits@level+ = [0+] 160 [1+] 143 [2+] 39 [3+] 13 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 12.502 [1+] 11.1736 [2+] 3.04735 [3+] 1.01578 [4+] 0.859509 [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.