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/phoc-0.5.1/src/cursor.c
Examining data/phoc-0.5.1/src/cursor.h
Examining data/phoc-0.5.1/src/desktop.c
Examining data/phoc-0.5.1/src/desktop.h
Examining data/phoc-0.5.1/src/gtk-shell.c
Examining data/phoc-0.5.1/src/gtk-shell.h
Examining data/phoc-0.5.1/src/ini.c
Examining data/phoc-0.5.1/src/ini.h
Examining data/phoc-0.5.1/src/input.c
Examining data/phoc-0.5.1/src/input.h
Examining data/phoc-0.5.1/src/keybindings.c
Examining data/phoc-0.5.1/src/keybindings.h
Examining data/phoc-0.5.1/src/keyboard.c
Examining data/phoc-0.5.1/src/keyboard.h
Examining data/phoc-0.5.1/src/layer_shell.c
Examining data/phoc-0.5.1/src/layers.h
Examining data/phoc-0.5.1/src/main.c
Examining data/phoc-0.5.1/src/output.c
Examining data/phoc-0.5.1/src/output.h
Examining data/phoc-0.5.1/src/phosh.c
Examining data/phoc-0.5.1/src/phosh.h
Examining data/phoc-0.5.1/src/render.c
Examining data/phoc-0.5.1/src/render.h
Examining data/phoc-0.5.1/src/seat.c
Examining data/phoc-0.5.1/src/seat.h
Examining data/phoc-0.5.1/src/server.c
Examining data/phoc-0.5.1/src/server.h
Examining data/phoc-0.5.1/src/settings.c
Examining data/phoc-0.5.1/src/settings.h
Examining data/phoc-0.5.1/src/switch.c
Examining data/phoc-0.5.1/src/switch.h
Examining data/phoc-0.5.1/src/text_input.c
Examining data/phoc-0.5.1/src/text_input.h
Examining data/phoc-0.5.1/src/touch.c
Examining data/phoc-0.5.1/src/touch.h
Examining data/phoc-0.5.1/src/utils.c
Examining data/phoc-0.5.1/src/utils.h
Examining data/phoc-0.5.1/src/view.c
Examining data/phoc-0.5.1/src/view.h
Examining data/phoc-0.5.1/src/virtual.c
Examining data/phoc-0.5.1/src/virtual.h
Examining data/phoc-0.5.1/src/xcursor.h
Examining data/phoc-0.5.1/src/xdg_shell.c
Examining data/phoc-0.5.1/src/xwayland.c
Examining data/phoc-0.5.1/src/xwayland.h
Examining data/phoc-0.5.1/tests/test-client.c
Examining data/phoc-0.5.1/tests/test-layer-shell.c
Examining data/phoc-0.5.1/tests/test-phosh.c
Examining data/phoc-0.5.1/tests/test-run.c
Examining data/phoc-0.5.1/tests/test-server.c
Examining data/phoc-0.5.1/tests/test-xdg-shell.c
Examining data/phoc-0.5.1/tests/testlib.c
Examining data/phoc-0.5.1/tests/testlib.h

FINAL RESULTS:

data/phoc-0.5.1/src/desktop.c:405:14:  [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 const char *atom_map[XWAYLAND_ATOM_LAST] = {
data/phoc-0.5.1/src/desktop.c:497: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 cursor_size_fmt[16];
data/phoc-0.5.1/src/ini.c:78: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 line[INI_MAX_LINE];
data/phoc-0.5.1/src/ini.c:82: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 section[MAX_SECTION] = "";
data/phoc-0.5.1/src/ini.c:83: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 prev_name[MAX_NAME] = "";
data/phoc-0.5.1/src/ini.c:189:12:  [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 = fopen(filename, "r");
data/phoc-0.5.1/src/layer_shell.c:279: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(&output->usable_area, &usable_area, sizeof(struct wlr_box));
data/phoc-0.5.1/src/settings.c:24: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 hsync[16];
data/phoc-0.5.1/src/settings.c:25: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 vsync[16];
data/phoc-0.5.1/src/settings.c:302: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 cwd[MAXPATHLEN];
data/phoc-0.5.1/src/settings.c:304:4:  [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 buf[MAXPATHLEN];
data/phoc-0.5.1/src/settings.c:367: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 name[88];
data/phoc-0.5.1/src/view.c:281: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(&usable_area, &roots_output->usable_area,
data/phoc-0.5.1/src/view.c:465: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(&usable_area, &roots_output->usable_area, sizeof(struct wlr_box));
data/phoc-0.5.1/src/view.c:514: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(&usable_area, &roots_output->usable_area,
data/phoc-0.5.1/src/view.c:569: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(&usable_area, &roots_output->usable_area, sizeof(struct wlr_box));
data/phoc-0.5.1/tests/testlib.c:430:8:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
  fd = mkstemp(template);
data/phoc-0.5.1/src/desktop.c:425: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).
    cookies[i] = xcb_intern_atom (xcb_conn, 0, strlen (atom_map[i]), atom_map[i]);
data/phoc-0.5.1/src/ini.c:30: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).
    char* p = s + strlen(s);
data/phoc-0.5.1/src/ini.c:67:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dest, src, size-1);
data/phoc-0.5.1/src/ini.c:156: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).
				memset(value, 0, strlen(value));
data/phoc-0.5.1/src/keybindings.c:303:9:  [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).
  len = strlen (accelerator);
data/phoc-0.5.1/src/settings.c:30:6:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
	if (sscanf(s, "%f %hd %hd %hd %hd %hd %hd %hd %hd %15s %15s",
data/phoc-0.5.1/src/settings.c:150:45:  [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).
	} else if (strncmp(output_prefix, section, strlen(output_prefix)) == 0) {
data/phoc-0.5.1/src/settings.c:151:39:  [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 *output_name = section + strlen(output_prefix);
data/phoc-0.5.1/src/settings.c:234:45:  [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).
	} else if (strncmp(cursor_prefix, section, strlen(cursor_prefix)) == 0) {
data/phoc-0.5.1/src/settings.c:235: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).
		const char *seat_name = section + strlen(cursor_prefix);
data/phoc-0.5.1/src/settings.c:240:45:  [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).
	} else if (strncmp(device_prefix, section, strlen(device_prefix)) == 0) {
data/phoc-0.5.1/src/settings.c:241:39:  [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 *device_name = section + strlen(device_prefix);
data/phoc-0.5.1/src/settings.c:275:45:  [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).
	} else if (strncmp(switch_prefix, section, strlen(switch_prefix)) == 0) {
data/phoc-0.5.1/src/settings.c:276:39:  [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 *switch_name = section + strlen(switch_prefix);

ANALYSIS SUMMARY:

Hits = 31
Lines analyzed = 14881 in approximately 0.30 seconds (49230 lines/second)
Physical Source Lines of Code (SLOC) = 11824
Hits@level = [0]   5 [1]  14 [2]  17 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  36 [1+]  31 [2+]  17 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 3.04465 [1+] 2.62179 [2+] 1.43775 [3+]   0 [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.