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/xserver-xorg-input-keyboard-1.9.0/src/atKeynames.h
Examining data/xserver-xorg-input-keyboard-1.9.0/src/hurd_kbd.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbdMap.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.h
Examining data/xserver-xorg-input-keyboard-1.9.0/src/at_scancode.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.h
Examining data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbd.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/xf86Keymap.h
Examining data/xserver-xorg-input-keyboard-1.9.0/src/kbd.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/bsd_KbdMap.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/lnx_KbdMap.c
Examining data/xserver-xorg-input-keyboard-1.9.0/src/xf86OSKbd.h
Examining data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbd.h

FINAL RESULTS:

data/xserver-xorg-input-keyboard-1.9.0/src/bsd_KbdMap.c:34:17:  [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 unsigned char remap[NUM_KEYCODES] = {
data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c:228:16:  [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).
			pInfo->fd = open(pKbd->wsKbdDev, O_RDONLY | O_NONBLOCK | O_EXCL);
data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c:334: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.
    unsigned char rBuf[64];
data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c:418:14:  [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).
	pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
data/xserver-xorg-input-keyboard-1.9.0/src/lnx_KbdMap.c:255:19:  [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 unsigned char tbl[GLYPHS_PER_KEY] =
data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.c:151: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.
    unsigned char rBuf[64];
data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.c:202:20:  [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).
       pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.c:241:9:  [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/sys/dev/mac_hid/keyboard_sends_linux_keycodes","r");
data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbd.c:492:17:  [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).
    pInfo->fd = open(kbdPath, O_RDONLY | O_NONBLOCK);
data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbdMap.c:58:17:  [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 unsigned char sunmap[256] = {
data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbdMap.c:336:17:  [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 unsigned char usbmap[256] = {
data/xserver-xorg-input-keyboard-1.9.0/src/xf86OSKbd.h:85: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		wsKbdDev[256];
data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c:336:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c:353:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((n = read( pInfo->fd, events, sizeof(events))) > 0) {
data/xserver-xorg-input-keyboard-1.9.0/src/bsd_kbd.c:425:8:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
       strncpy(pKbd->wsKbdDev, s, 256);
data/xserver-xorg-input-keyboard-1.9.0/src/hurd_kbd.c:136:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while( read(pInfo->fd, &ke, sizeof(ke)) == sizeof(ke) )
data/xserver-xorg-input-keyboard-1.9.0/src/kbd.c:335:46:  [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).
                                             strlen(XI_PROP_DEVICE_NODE), TRUE);
data/xserver-xorg-input-keyboard-1.9.0/src/kbd.c:337: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).
                                        PropModeReplace, strlen(device_node),
data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.c:153:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
data/xserver-xorg-input-keyboard-1.9.0/src/lnx_kbd.c:243:13:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (fgetc(f) == '0')
data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbd.c:374:2:  [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(duration * loudness * 20);
data/xserver-xorg-input-keyboard-1.9.0/src/sun_kbd.c:449:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	nBytes = read(pInfo->fd, (char *)event, sizeof(event));

ANALYSIS SUMMARY:

Hits = 22
Lines analyzed = 5343 in approximately 0.13 seconds (42569 lines/second)
Physical Source Lines of Code (SLOC) = 4445
Hits@level = [0]   0 [1]  10 [2]  12 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  22 [1+]  22 [2+]  12 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 4.94938 [1+] 4.94938 [2+] 2.69966 [3+]   0 [4+]   0 [5+]   0
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.