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/libzt-0.3.1/examples/demo.c
Examining data/libzt-0.3.1/examples/test-root-user.c
Examining data/libzt-0.3.1/zt.c
Examining data/libzt-0.3.1/zt-test.c
Examining data/libzt-0.3.1/zt.h

FINAL RESULTS:

data/libzt-0.3.1/zt-test.c:178:12:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    nfmt = vsnprintf(buf2, buf2_size, fmt, ap);
data/libzt-0.3.1/zt.c:35:54:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define ZT_FORMAT_PRINTF(a, b) __attribute__((format(printf, a, b)))
data/libzt-0.3.1/zt.c:47:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        vfprintf(stream, fmt, ap);
data/libzt-0.3.1/zt-test.c:48:20:  [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.
    tmp_dir_name = getenv("TMPDIR");
data/libzt-0.3.1/zt-test.c:44: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 tmpl[PATH_MAX];
data/libzt-0.3.1/zt-test.c:53:10:  [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).
    fd = open(tmp_dir_name, O_TMPFILE | O_RDWR | O_EXCL, 0600);
data/libzt-0.3.1/zt-test.c:83:9:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    f = tmpfile();
data/libzt-0.3.1/zt-test.c:157: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 buf1[1024], buf2[1024];

ANALYSIS SUMMARY:

Hits = 8
Lines analyzed = 3877 in approximately 0.14 seconds (27637 lines/second)
Physical Source Lines of Code (SLOC) = 3217
Hits@level = [0]  28 [1]   0 [2]   4 [3]   1 [4]   3 [5]   0
Hits@level+ = [0+]  36 [1+]   8 [2+]   8 [3+]   4 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 11.1906 [1+] 2.48679 [2+] 2.48679 [3+] 1.24339 [4+] 0.932546 [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.