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/ukui-window-switch-3.0.0/src/ukws_helper.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_config.h
Examining data/ukui-window-switch-3.0.0/src/ukws_window_info.h
Examining data/ukui-window-switch-3.0.0/src/ukws_window_info.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_window_icon.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_workspace_box.h
Examining data/ukui-window-switch-3.0.0/src/ukws_manager.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_wnck_operator.h
Examining data/ukui-window-switch-3.0.0/src/ukws_workspace_multiview.h
Examining data/ukui-window-switch-3.0.0/src/qhotkey_x11.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_stack_blur.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_flowlayout.h
Examining data/ukui-window-switch-3.0.0/src/ukws_dbus.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_worker.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_workspace_box.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_workspace_manager.h
Examining data/ukui-window-switch-3.0.0/src/qhotkey.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_fake_desktop.h
Examining data/ukui-window-switch-3.0.0/src/ukws_fake_desktop.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_helper.h
Examining data/ukui-window-switch-3.0.0/src/ukws_stack_blur.h
Examining data/ukui-window-switch-3.0.0/src/ukws_window_extra_label.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_config.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_workspace_multiview.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_dbus.h
Examining data/ukui-window-switch-3.0.0/src/ukws_window_box.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_window_icon.h
Examining data/ukui-window-switch-3.0.0/src/ukws_workspace_manager.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_worker.h
Examining data/ukui-window-switch-3.0.0/src/ukws_indicator.h
Examining data/ukui-window-switch-3.0.0/src/main.cpp
Examining data/ukui-window-switch-3.0.0/src/qhotkey_p.h
Examining data/ukui-window-switch-3.0.0/src/ukws_manager.h
Examining data/ukui-window-switch-3.0.0/src/ukws_wnck_operator.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_window_box.h
Examining data/ukui-window-switch-3.0.0/src/ukws_indicator.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_window_extra_label.h
Examining data/ukui-window-switch-3.0.0/src/ukws_flowlayout.cpp
Examining data/ukui-window-switch-3.0.0/src/qhotkey.h
Examining data/ukui-window-switch-3.0.0/src/ukws_new_workspace_button.cpp
Examining data/ukui-window-switch-3.0.0/src/ukws_new_workspace_button.h
Examining data/ukui-window-switch-3.0.0/src/ukws_common.h

FINAL RESULTS:

data/ukui-window-switch-3.0.0/src/main.cpp:103:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(logPath, "/run/user/%d/%s.log", uid, PROGRAM_NAME);
data/ukui-window-switch-3.0.0/src/main.cpp:106:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(logPath, F_OK|W_OK) == 0) {
data/ukui-window-switch-3.0.0/src/main.cpp:121:21:  [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 *ctrlEnv = getenv("UKWS_DEBUG");
data/ukui-window-switch-3.0.0/src/main.cpp:65: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 pid_file[PATH_MAX_LEN] = {0};
data/ukui-window-switch-3.0.0/src/main.cpp:66: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 pid_string[PID_STRING_LEN] = {0};
data/ukui-window-switch-3.0.0/src/main.cpp:69:23:  [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 pid_file_fd = open(pid_file, O_CREAT | O_TRUNC | O_RDWR, 0666);
data/ukui-window-switch-3.0.0/src/main.cpp:95:12:  [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.
    static char logPath[255] = {0};
data/ukui-window-switch-3.0.0/src/main.cpp:109: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).
            fp = fopen(logPath, "a+");
data/ukui-window-switch-3.0.0/src/qhotkey_x11.cpp:168: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 errStr[256];
data/ukui-window-switch-3.0.0/src/ukws_config.cpp:195: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).
        ukwsTheme.open(QFile::ReadOnly);
data/ukui-window-switch-3.0.0/src/ukws_manager.cpp:234: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 keymap[32] = {0};
data/ukui-window-switch-3.0.0/src/ukws_manager.cpp:322: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 keymap[32] = {0};
data/ukui-window-switch-3.0.0/src/main.cpp:86: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).
    write(pid_file_fd, pid_string, strlen(pid_string));
data/ukui-window-switch-3.0.0/src/ukws_indicator.cpp:557:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(5 * 1000);
data/ukui-window-switch-3.0.0/src/ukws_manager.cpp:134:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(UKWS_WM_SHOW_STATUS_CHECK_INTERVAL_TIME_MS * 1000);
data/ukui-window-switch-3.0.0/src/ukws_manager.cpp:348:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(UKWS_WM_KEY_CHECK_INTERVAL_TIME_MS * 1000);
data/ukui-window-switch-3.0.0/src/ukws_manager.cpp:369:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(UKWS_WM_SHOW_STATUS_CHECK_INTERVAL_TIME_MS * 1000);

ANALYSIS SUMMARY:

Hits = 17
Lines analyzed = 7590 in approximately 0.20 seconds (37056 lines/second)
Physical Source Lines of Code (SLOC) = 4927
Hits@level = [0]   6 [1]   5 [2]   9 [3]   1 [4]   2 [5]   0
Hits@level+ = [0+]  23 [1+]  17 [2+]  12 [3+]   3 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 4.66816 [1+] 3.45038 [2+] 2.43556 [3+] 0.60889 [4+] 0.405927 [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.