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/fcitx-kkc-0.1.4/gui/adddictdialog.cpp
Examining data/fcitx-kkc-0.1.4/gui/adddictdialog.h
Examining data/fcitx-kkc-0.1.4/gui/addshortcutdialog.h
Examining data/fcitx-kkc-0.1.4/gui/common.h
Examining data/fcitx-kkc-0.1.4/gui/dictmodel.cpp
Examining data/fcitx-kkc-0.1.4/gui/dictmodel.h
Examining data/fcitx-kkc-0.1.4/gui/dictwidget.cpp
Examining data/fcitx-kkc-0.1.4/gui/dictwidget.h
Examining data/fcitx-kkc-0.1.4/gui/main.cpp
Examining data/fcitx-kkc-0.1.4/gui/main.h
Examining data/fcitx-kkc-0.1.4/gui/rulemodel.cpp
Examining data/fcitx-kkc-0.1.4/gui/rulemodel.h
Examining data/fcitx-kkc-0.1.4/gui/shortcutmodel.h
Examining data/fcitx-kkc-0.1.4/gui/shortcutwidget.h
Examining data/fcitx-kkc-0.1.4/gui/shortcutwidget.cpp
Examining data/fcitx-kkc-0.1.4/gui/addshortcutdialog.cpp
Examining data/fcitx-kkc-0.1.4/gui/shortcutmodel.cpp
Examining data/fcitx-kkc-0.1.4/src/kkc-config.c
Examining data/fcitx-kkc-0.1.4/src/kkc-internal.h
Examining data/fcitx-kkc-0.1.4/src/kkc.h
Examining data/fcitx-kkc-0.1.4/src/kkc.c

FINAL RESULTS:

data/fcitx-kkc-0.1.4/src/kkc.c:591:71:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
                KkcUserDictionary* userdict = kkc_user_dictionary_new(realpath, NULL);
data/fcitx-kkc-0.1.4/gui/dictmodel.cpp:43: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).
    if (f.open(QIODevice::ReadOnly)) {
data/fcitx-kkc-0.1.4/gui/dictmodel.cpp:55:12:  [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 (!f.open(fp, QIODevice::ReadOnly)) {
data/fcitx-kkc-0.1.4/gui/dictmodel.cpp:110: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 (!tempFile.open()) {
data/fcitx-kkc-0.1.4/gui/shortcutwidget.cpp:74:15:  [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 (f.open(fp, QIODevice::ReadOnly)) {;
data/fcitx-kkc-0.1.4/gui/shortcutwidget.cpp:105: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).
    if (f.open(fp, QIODevice::WriteOnly)) {
data/fcitx-kkc-0.1.4/gui/adddictdialog.cpp:87:42:  [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).
            path = dir.filePath(path.mid(strlen(FCITX_CONFIG_DIR) + 1));
data/fcitx-kkc-0.1.4/src/kkc.c:353:27:  [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).
                offset += strlen(str);
data/fcitx-kkc-0.1.4/src/kkc.c:372:58:  [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).
                FcitxInputStateSetClientCursorPos(input, strlen(str));
data/fcitx-kkc-0.1.4/src/kkc.c:374:52:  [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).
                FcitxInputStateSetCursorPos(input, strlen(str));
data/fcitx-kkc-0.1.4/src/kkc.c:585: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).
                if (strncmp(path, "$FCITX_CONFIG_DIR/", strlen("$FCITX_CONFIG_DIR/")) == 0) {
data/fcitx-kkc-0.1.4/src/kkc.c:586:62:  [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).
                    FcitxXDGGetFileUserWithPrefix("", path + strlen("$FCITX_CONFIG_DIR/"), NULL, &needfree);

ANALYSIS SUMMARY:

Hits = 12
Lines analyzed = 2328 in approximately 0.10 seconds (22577 lines/second)
Physical Source Lines of Code (SLOC) = 1633
Hits@level = [0]   0 [1]   6 [2]   5 [3]   1 [4]   0 [5]   0
Hits@level+ = [0+]  12 [1+]  12 [2+]   6 [3+]   1 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 7.34844 [1+] 7.34844 [2+] 3.67422 [3+] 0.61237 [4+]   0 [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.