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/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c

FINAL RESULTS:

data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:114:7:  [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 (getenv("TMP")) {
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:115: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.
    tmpdir = getenv("TMP");
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:52:60:  [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.
void new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]) {
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:52:85:  [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.
void new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]) {
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:52:107:  [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.
void new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]) {
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:52:132:  [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.
void new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]) {
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:118: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 private_key_file[256];
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:120:12:  [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).
  int fd = mkstemp(private_key_file);
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:133: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 buf[4096];
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:137: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(message) == 0) {
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:140: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).
    message[strlen(message) - 1] = 0;
data/golang-github-twstrike-otr3-0.0~git20161015.0.744856d/compat/libotr_test_helper.c:162: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).
      write(1, newmessage, strlen(newmessage));

ANALYSIS SUMMARY:

Hits = 12
Lines analyzed = 171 in approximately 0.08 seconds (2114 lines/second)
Physical Source Lines of Code (SLOC) = 127
Hits@level = [0]  11 [1]   3 [2]   7 [3]   2 [4]   0 [5]   0
Hits@level+ = [0+]  23 [1+]  12 [2+]   9 [3+]   2 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 181.102 [1+] 94.4882 [2+] 70.8661 [3+] 15.748 [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.