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/debsig-verify-0.22/src/ar-parse.c
Examining data/debsig-verify-0.22/src/debsig-verify.c
Examining data/debsig-verify-0.22/src/debsig.h
Examining data/debsig-verify-0.22/src/gpg-parse.c
Examining data/debsig-verify-0.22/src/misc.c
Examining data/debsig-verify-0.22/src/xml-parse.c

FINAL RESULTS:

data/debsig-verify-0.22/src/gpg-parse.c:54:7:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      execlp("rm", "rm", "-rf", gpg_tmpdir, NULL);
data/debsig-verify-0.22/src/misc.c:43:9:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	(void) vprintf(buf, ap);
data/debsig-verify-0.22/src/gpg-parse.c:75: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.
    prog = getenv("DEBSIG_GNUPG_PROGRAM");
data/debsig-verify-0.22/src/ar-parse.c:55: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 magic[SARMAG + 1];
data/debsig-verify-0.22/src/debsig-verify.c:128:15:  [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).
    if ((fd = mkstemp(tmp_data)) == -1) {
data/debsig-verify-0.22/src/debsig-verify.c:199: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).
	if ((fd = mkstemp(tmp_sig)) == -1) {
data/debsig-verify-0.22/src/gpg-parse.c:114:12:  [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 char buf[2048];
data/debsig-verify-0.22/src/gpg-parse.c:205:12:  [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 char buf[2048];
data/debsig-verify-0.22/src/gpg-parse.c:284: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 keyring[8192];
data/debsig-verify-0.22/src/misc.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 buf[8096];
data/debsig-verify-0.22/src/misc.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 buf[16];
data/debsig-verify-0.22/src/xml-parse.c:135:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		cur_grp->min_opt = atoi(c);
data/debsig-verify-0.22/src/xml-parse.c:185:37:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                cur_m->day_expiry = atoi(c);
data/debsig-verify-0.22/src/xml-parse.c:246: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 buf[BUFSIZ];
data/debsig-verify-0.22/src/xml-parse.c:259:14:  [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).
    pol_fs = fopen(filename, "r");
data/debsig-verify-0.22/src/ar-parse.c:59:18:  [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_t len = strlen(name);
data/debsig-verify-0.22/src/debsig-verify.c:118:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(022);
data/debsig-verify-0.22/src/gpg-parse.c:159:35:  [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 (strncmp(buf, USER_MAGIC, strlen(USER_MAGIC)) != 0)
data/debsig-verify-0.22/src/gpg-parse.c:174: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).
	    if (strncmp(buf, SIG_MAGIC, strlen(SIG_MAGIC)) != 0)
data/debsig-verify-0.22/src/gpg-parse.c:255:30:  [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 (strncmp(buf, SIG_MAGIC, strlen(SIG_MAGIC)) == 0) {
data/debsig-verify-0.22/src/xml-parse.c:84:49:  [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).
		ret.id = obstack_copy0(&deb_obs, atts[i + 1], strlen(atts[i + 1]));
data/debsig-verify-0.22/src/xml-parse.c:86:51:  [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).
		ret.name = obstack_copy0(&deb_obs, atts[i + 1], strlen(atts[i + 1]));
data/debsig-verify-0.22/src/xml-parse.c:88: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).
		ret.description = obstack_copy0(&deb_obs, atts[i + 1], strlen(atts[i + 1]));
data/debsig-verify-0.22/src/xml-parse.c:172:68:  [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).
                cur_m->name = obstack_copy0(&deb_obs, atts[i + 1], strlen(atts[i + 1]));
data/debsig-verify-0.22/src/xml-parse.c:174:54:  [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).
		cur_m->file = obstack_copy0(&deb_obs, atts[i + 1], strlen(atts[i + 1]));;
data/debsig-verify-0.22/src/xml-parse.c:176:52:  [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).
		cur_m->id = obstack_copy0(&deb_obs, atts[i + 1], strlen(atts[i + 1]));;

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 1425 in approximately 0.12 seconds (11682 lines/second)
Physical Source Lines of Code (SLOC) = 992
Hits@level = [0]   7 [1]  11 [2]  12 [3]   1 [4]   2 [5]   0
Hits@level+ = [0+]  33 [1+]  26 [2+]  15 [3+]   3 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 33.2661 [1+] 26.2097 [2+] 15.121 [3+] 3.02419 [4+] 2.01613 [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.