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/kmime-20.08.2/autotests/contentindextest.cpp
Examining data/kmime-20.08.2/autotests/rfc2047test.h
Examining data/kmime-20.08.2/autotests/typestest.cpp
Examining data/kmime-20.08.2/autotests/contenttest.cpp
Examining data/kmime-20.08.2/autotests/rfc2047test.cpp
Examining data/kmime-20.08.2/autotests/messagetest.h
Examining data/kmime-20.08.2/autotests/parsedatetimetest.cpp
Examining data/kmime-20.08.2/autotests/contentindextest.h
Examining data/kmime-20.08.2/autotests/charfreqtest.cpp
Examining data/kmime-20.08.2/autotests/sizetest.cpp
Examining data/kmime-20.08.2/autotests/contenttest.h
Examining data/kmime-20.08.2/autotests/rfc2231test.h
Examining data/kmime-20.08.2/autotests/attachmenttest.h
Examining data/kmime-20.08.2/autotests/rfc2231test.cpp
Examining data/kmime-20.08.2/autotests/headerfactorytest.h
Examining data/kmime-20.08.2/autotests/messagetest.cpp
Examining data/kmime-20.08.2/autotests/headerfactorytest.cpp
Examining data/kmime-20.08.2/autotests/utiltest.cpp
Examining data/kmime-20.08.2/autotests/parsedatetimetest.h
Examining data/kmime-20.08.2/autotests/headertest.cpp
Examining data/kmime-20.08.2/autotests/attachmenttest.cpp
Examining data/kmime-20.08.2/autotests/charfreqtest.h
Examining data/kmime-20.08.2/autotests/headertest.h
Examining data/kmime-20.08.2/autotests/utiltest.h
Examining data/kmime-20.08.2/autotests/dateformattertest.cpp
Examining data/kmime-20.08.2/tests/test_dates.cpp
Examining data/kmime-20.08.2/tests/test_kmime_header_parsing.cpp
Examining data/kmime-20.08.2/tests/test_charfreq.cpp
Examining data/kmime-20.08.2/tests/test_mdn.cpp
Examining data/kmime-20.08.2/src/kmime_headers.h
Examining data/kmime-20.08.2/src/kmime_mdn.h
Examining data/kmime-20.08.2/src/kmime_dateformatter.cpp
Examining data/kmime-20.08.2/src/kmime_parsers.h
Examining data/kmime-20.08.2/src/kmime_message.h
Examining data/kmime-20.08.2/src/kmime_content.h
Examining data/kmime-20.08.2/src/kmime_dateformatter.h
Examining data/kmime-20.08.2/src/kmime_newsarticle.h
Examining data/kmime-20.08.2/src/kmime_contentindex.h
Examining data/kmime-20.08.2/src/kmime_codecs.cpp
Examining data/kmime-20.08.2/src/kmime_content.cpp
Examining data/kmime-20.08.2/src/kmime_charfreq.cpp
Examining data/kmime-20.08.2/src/kmime_header_parsing.cpp
Examining data/kmime-20.08.2/src/kmime_util_p.h
Examining data/kmime-20.08.2/src/kmime_util.cpp
Examining data/kmime-20.08.2/src/kmime_codecs.h
Examining data/kmime-20.08.2/src/kmime_message.cpp
Examining data/kmime-20.08.2/src/kmime_mdn.cpp
Examining data/kmime-20.08.2/src/kmime_headers_p.h
Examining data/kmime-20.08.2/src/kmime_header_parsing.h
Examining data/kmime-20.08.2/src/kmime_warning.h
Examining data/kmime-20.08.2/src/kmime_types.h
Examining data/kmime-20.08.2/src/kmime_content_p.h
Examining data/kmime-20.08.2/src/kmime_headerfactory_p.h
Examining data/kmime-20.08.2/src/kmime_util.h
Examining data/kmime-20.08.2/src/kmime_charfreq.h
Examining data/kmime-20.08.2/src/kmime_contentindex.cpp
Examining data/kmime-20.08.2/src/kmime_headers.cpp
Examining data/kmime-20.08.2/src/kmime_header_parsing_p.h
Examining data/kmime-20.08.2/src/kmime_newsarticle.cpp
Examining data/kmime-20.08.2/src/kmime_headerfactory.cpp
Examining data/kmime-20.08.2/src/kmime_parsers.cpp
Examining data/kmime-20.08.2/src/kmime_types.cpp

FINAL RESULTS:

data/kmime-20.08.2/src/kmime_dateformatter.cpp:265:28:  [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.
    auto locale = QLocale::system();
data/kmime-20.08.2/src/kmime_dateformatter.cpp:308:28:  [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.
    auto locale = QLocale::system();
data/kmime-20.08.2/tests/test_kmime_header_parsing.cpp:98:17:  [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.
        int c = getopt_long(argc, argv, "cf:ht:", long_options, &option_index);
data/kmime-20.08.2/tests/test_mdn.cpp:53:17:  [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.
        int c = getopt_long(argc, argv, "a:d:f:i:m:o:s:",
data/kmime-20.08.2/autotests/messagetest.cpp:611:26:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    const bool ok = file.open(QIODevice::ReadOnly);
data/kmime-20.08.2/autotests/messagetest.cpp:646:26:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    const bool ok = file.open(QIODevice::ReadOnly);
data/kmime-20.08.2/src/kmime_dateformatter.cpp:329: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 cstr[64];
data/kmime-20.08.2/src/kmime_header_parsing.cpp:1676:11:  [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.
    const char tzName[5];
data/kmime-20.08.2/src/kmime_mdn.cpp:246: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 hostName[256];
data/kmime-20.08.2/src/kmime_util.cpp:158: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 p[11];
data/kmime-20.08.2/tests/test_charfreq.cpp:33:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if (!in.open(QIODevice::ReadOnly)) {
data/kmime-20.08.2/tests/test_kmime_header_parsing.cpp:142:11:  [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).
    stdIn.open(stdin, QIODevice::ReadOnly);
data/kmime-20.08.2/autotests/headertest.cpp:1066: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).
    const char *end = data + strlen(data);
data/kmime-20.08.2/src/kmime_headerfactory.cpp:41:63:  [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 (qstrnicmp(type, hdr ::staticType(), std::max(typeLen, strlen(hdr::staticType()))) == 0) \
data/kmime-20.08.2/src/kmime_headers.cpp:1269:34:  [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 int l = (len < 0 ? strlen(type) : len) + 1;
data/kmime-20.08.2/src/kmime_headers.cpp:1745:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const int len = strlen(mediatype);
data/kmime-20.08.2/src/kmime_headers.cpp:1756:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const int len = strlen(subtype);
data/kmime-20.08.2/src/kmime_util.cpp:306: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 nlen = strlen(needle);

ANALYSIS SUMMARY:

Hits = 18
Lines analyzed = 18685 in approximately 1.06 seconds (17610 lines/second)
Physical Source Lines of Code (SLOC) = 11604
Hits@level = [0]   0 [1]   6 [2]   8 [3]   2 [4]   2 [5]   0
Hits@level+ = [0+]  18 [1+]  18 [2+]  12 [3+]   4 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 1.55119 [1+] 1.55119 [2+] 1.03413 [3+] 0.344709 [4+] 0.172354 [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.