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/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c
Examining data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.h
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_description.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/button_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/main.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_list_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_map_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/rudder_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/remap_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/throttle_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_test_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_list_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/calibrate_maximum_dialog.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/axis_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/calibrate_maximum_dialog.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/rudder_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/button_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/throttle_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/evdev_helper.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/remap_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_test_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/axis_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/evdev_helper.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_calibration_widget.hpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_calibration_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/joystick_map_widget.cpp
Examining data/jstest-gtk-0.1.1~git20160825/src/main.cpp

FINAL RESULTS:

data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:78:10:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		size = readlink (path2, path, buf_size - 1);
data/jstest-gtk-0.1.1~git20160825/src/main.cpp:155: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(cfg_directory.c_str(), R_OK | W_OK) != 0 &&
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:122:6:  [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).
	f = fopen ("/proc/self/maps", "r");
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:188: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 *address_string, line[SIZE], *found;
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:193:6:  [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).
	f = fopen ("/proc/self/maps", "r");
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:253: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 (address_string, "0x", 2);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:254: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 (address_string + 2, start_addr, len);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:258: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 (address_string, "0x", 2);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:259: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 (address_string + 2, end_addr, len);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:675: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 (result, str1, len1);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:676: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 (result + len1, str2, len2);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:721: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 (result, str, size);
data/jstest-gtk-0.1.1~git20160825/src/joystick.cpp:43: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).
  if ((fd = open(filename.c_str(), O_RDONLY)) < 0)
data/jstest-gtk-0.1.1~git20160825/src/joystick.cpp:60: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 name_c_str[1024];
data/jstest-gtk-0.1.1~git20160825/src/joystick.cpp:403:21:  [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 ((evdev_fd = open(out.str().c_str(), O_RDONLY)) < 0)
data/jstest-gtk-0.1.1~git20160825/src/joystick.cpp:409:7:  [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 evdev_name[256];
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:73:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
	strncpy (path2, "/proc/self/exe", buf_size - 1);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:105:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy (path, path2, buf_size - 1);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:141:13:  [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).
	buf_size = strlen (line);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:229: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 (file);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:236: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 (file);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:241: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 (start_addr);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:242:14:  [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 (len != strlen (end_addr))
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:671: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).
	len1 = strlen (str1);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:672: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).
	len2 = strlen (str2);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:690:8:  [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 (dir);
data/jstest-gtk-0.1.1~git20160825/external/binreloc-2.0/binreloc.c:714:8:  [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 (str);
data/jstest-gtk-0.1.1~git20160825/src/joystick.cpp:103:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t len = read(fd, &event, sizeof(event));

ANALYSIS SUMMARY:

Hits = 28
Lines analyzed = 4375 in approximately 0.13 seconds (32656 lines/second)
Physical Source Lines of Code (SLOC) = 2949
Hits@level = [0]   2 [1]  12 [2]  14 [3]   0 [4]   1 [5]   1
Hits@level+ = [0+]  30 [1+]  28 [2+]  16 [3+]   2 [4+]   2 [5+]   1
Hits/KSLOC@level+ = [0+] 10.1729 [1+] 9.49474 [2+] 5.42557 [3+] 0.678196 [4+] 0.678196 [5+] 0.339098
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.