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/libxau-1.0.8/AuLock.c
Examining data/libxau-1.0.8/AuGetBest.c
Examining data/libxau-1.0.8/AuWrite.c
Examining data/libxau-1.0.8/AuFileName.c
Examining data/libxau-1.0.8/AuGetAddr.c
Examining data/libxau-1.0.8/include/X11/Xauth.h
Examining data/libxau-1.0.8/Autest.c
Examining data/libxau-1.0.8/AuUnlock.c
Examining data/libxau-1.0.8/AuDispose.c
Examining data/libxau-1.0.8/AuRead.c

FINAL RESULTS:

data/libxau-1.0.8/AuGetAddr.c:65: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 (auth_name, R_OK) != 0)		/* checks REAL id */
data/libxau-1.0.8/AuGetBest.c:77: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 (auth_name, R_OK) != 0)		/* checks REAL id */
data/libxau-1.0.8/AuFileName.c:55:17:  [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.
    if ((name = getenv ("XAUTHORITY")))
data/libxau-1.0.8/AuFileName.c:57:12:  [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.
    name = getenv ("HOME");
data/libxau-1.0.8/AuFileName.c:60:14:  [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.
	if ((name = getenv("USERNAME"))) {
data/libxau-1.0.8/AuFileName.c:51: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    dir[128];
data/libxau-1.0.8/AuGetAddr.c:67:17:  [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).
    auth_file = fopen (auth_name, "rb");
data/libxau-1.0.8/AuGetBest.c:79:17:  [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).
    auth_file = fopen (auth_name, "rb");
data/libxau-1.0.8/AuLock.c:51: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	creat_name[1025], link_name[1025];
data/libxau-1.0.8/AuLock.c:74: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).
	    creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
data/libxau-1.0.8/AuRead.c:36: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   file_short[2];
data/libxau-1.0.8/AuUnlock.c:38: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	creat_name[1025];
data/libxau-1.0.8/AuUnlock.c:40: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	link_name[1025];
data/libxau-1.0.8/AuWrite.c:35: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   file_short[2];
data/libxau-1.0.8/Autest.c:65:11:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	output = tmpfile();
data/libxau-1.0.8/Autest.c:67:11:  [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).
	output = fopen (file, "w");
data/libxau-1.0.8/AuFileName.c:68:12:  [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).
    size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
data/libxau-1.0.8/AuFileName.c:68:28:  [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).
    size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
data/libxau-1.0.8/AuGetBest.c:93:34:  [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).
	    fully_qual_address_length = strlen(fully_qual_address);
data/libxau-1.0.8/AuLock.c:56: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).
    if (strlen (file_name) > 1022)
data/libxau-1.0.8/AuUnlock.c:42: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).
    if (strlen (file_name) > 1022)
data/libxau-1.0.8/Autest.c:60:29:  [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).
    test_data.name_length = strlen (name);
data/libxau-1.0.8/Autest.c:62:29:  [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).
    test_data.data_length = strlen (data);

ANALYSIS SUMMARY:

Hits = 23
Lines analyzed = 961 in approximately 0.05 seconds (20312 lines/second)
Physical Source Lines of Code (SLOC) = 605
Hits@level = [0]   8 [1]   7 [2]  11 [3]   3 [4]   2 [5]   0
Hits@level+ = [0+]  31 [1+]  23 [2+]  16 [3+]   5 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 51.2397 [1+] 38.0165 [2+] 26.4463 [3+] 8.26446 [4+] 3.30579 [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.