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/fcitx5-qt-5.0.0/common/fcitxflags.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtdbustypes.cpp
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtdbustypes.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputcontextproxy.cpp
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputcontextproxy.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputcontextproxy_p.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputcontextproxyimpl.cpp
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputcontextproxyimpl.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputmethodproxy.cpp
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtinputmethodproxy.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtwatcher.cpp
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtwatcher.h
Examining data/fcitx5-qt-5.0.0/qt4/dbusaddons/fcitxqtwatcher_p.h
Examining data/fcitx5-qt-5.0.0/qt4/inputcontext/main.cpp
Examining data/fcitx5-qt-5.0.0/qt4/inputcontext/main.h
Examining data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.cpp
Examining data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtcontrollerproxy.cpp
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtcontrollerproxy.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtdbustypes.cpp
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtdbustypes.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputcontextproxy.cpp
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputcontextproxy.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputcontextproxy_p.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputcontextproxyimpl.cpp
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputcontextproxyimpl.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputmethodproxy.cpp
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtinputmethodproxy.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtwatcher.cpp
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtwatcher.h
Examining data/fcitx5-qt-5.0.0/qt5/dbusaddons/fcitxqtwatcher_p.h
Examining data/fcitx5-qt-5.0.0/qt5/guiwrapper/main.cpp
Examining data/fcitx5-qt-5.0.0/qt5/guiwrapper/mainwindow.cpp
Examining data/fcitx5-qt-5.0.0/qt5/guiwrapper/mainwindow.h
Examining data/fcitx5-qt-5.0.0/qt5/guiwrapper/wrapperapp.cpp
Examining data/fcitx5-qt-5.0.0/qt5/guiwrapper/wrapperapp.h
Examining data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.cpp
Examining data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.h
Examining data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
Examining data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.h
Examining data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qtkey.cpp
Examining data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qtkey.h
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/batchdialog.cpp
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/batchdialog.h
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editor.cpp
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editor.h
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editordialog.cpp
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editordialog.h
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/filelistmodel.cpp
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/filelistmodel.h
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/main.cpp
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/main.h
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/model.cpp
Examining data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/model.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguifactory.cpp
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguifactory.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguifactory_p.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguiplugin.cpp
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguiplugin.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguiwidget.cpp
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtconfiguiwidget.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqti18nhelper.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtkeysequencewidget.cpp
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtkeysequencewidget.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/fcitxqtkeysequencewidget_p.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/qtkeytrans.cpp
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/qtkeytrans.h
Examining data/fcitx5-qt-5.0.0/qt5/widgetsaddons/qtkeytransdata.h
Examining data/fcitx5-qt-5.0.0/test/testkeytrans.cpp

FINAL RESULTS:

data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.cpp:11:58:  [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.
QFcitx5PlatformInputContextPlugin::create(const QString &system,
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.cpp:14:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system.compare(system, QStringLiteral("fcitx5"), Qt::CaseInsensitive) ==
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.cpp:14:24:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system.compare(system, QStringLiteral("fcitx5"), Qt::CaseInsensitive) ==
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.cpp:16:9:  [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.
        system.compare(system, QStringLiteral("fcitx"), Qt::CaseInsensitive) ==
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.cpp:16:24:  [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.
        system.compare(system, QStringLiteral("fcitx"), Qt::CaseInsensitive) ==
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/main.h:22:27:  [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.
    create(const QString &system, const QStringList &paramList) override;
data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.cpp:72: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.
    const char *value = getenv(name);
data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.cpp:86: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.
    const char *locale = getenv("LC_ALL");
data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.cpp:88:18:  [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.
        locale = getenv("LC_CTYPE");
data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.cpp:90:18:  [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.
        locale = getenv("LANG");
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:109: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.
    const char *value = getenv(name);
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.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.
    const char *locale = getenv("LC_ALL");
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:125:18:  [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.
        locale = getenv("LC_CTYPE");
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:127:18:  [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.
        locale = getenv("LANG");
data/fcitx5-qt-5.0.0/qt4/inputcontext/qfcitxinputcontext.cpp:63: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(ev.xclient.data.b, uuid.constData(), 16);
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:101: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(ev.data.data8, uuid.constData(), 16);
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editor.cpp:119: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).
    dialog->open();
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editor.cpp:130: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).
    dialog->open();
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editor.cpp:162: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).
    dialog->open();
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/editor.cpp:170: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).
    dialog->open();
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/model.cpp:141:49:  [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).
        auto fp = fcitx::StandardPath::global().open(
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/model.cpp:148:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if (!file.open(fp.fd(), QFile::ReadOnly)) {
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/model.cpp:220:27:  [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 (!tempFile.open(fd, QIODevice::WriteOnly)) {
data/fcitx5-qt-5.0.0/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:69:48:  [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).
            xcb_intern_atom(connection, false, strlen(atomName), atomName);
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/filelistmodel.cpp:32:35:  [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 size_t length = strlen(QUICK_PHRASE_CONFIG_DIR);
data/fcitx5-qt-5.0.0/qt5/quickphrase-editor/filelistmodel.cpp:35:60:  [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).
                                                  length - strlen(".mb") - 1);

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 10093 in approximately 0.27 seconds (37046 lines/second)
Physical Source Lines of Code (SLOC) = 8054
Hits@level = [0]   0 [1]   3 [2]   9 [3]   8 [4]   6 [5]   0
Hits@level+ = [0+]  26 [1+]  26 [2+]  23 [3+]  14 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 3.22821 [1+] 3.22821 [2+] 2.85572 [3+] 1.73827 [4+] 0.744971 [5+]   0
Symlinks skipped = 22 (--allowlink overrides but see doc for security issue)
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.