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/ruby-rdiscount-2.1.8/ext/generate.c
Examining data/ruby-rdiscount-2.1.8/ext/mkdio.h
Examining data/ruby-rdiscount-2.1.8/ext/docheader.c
Examining data/ruby-rdiscount-2.1.8/ext/tags.c
Examining data/ruby-rdiscount-2.1.8/ext/pgm_options.c
Examining data/ruby-rdiscount-2.1.8/ext/markdown.c
Examining data/ruby-rdiscount-2.1.8/ext/Csio.c
Examining data/ruby-rdiscount-2.1.8/ext/setup.c
Examining data/ruby-rdiscount-2.1.8/ext/pgm_options.h
Examining data/ruby-rdiscount-2.1.8/ext/tags.h
Examining data/ruby-rdiscount-2.1.8/ext/amalloc.c
Examining data/ruby-rdiscount-2.1.8/ext/resource.c
Examining data/ruby-rdiscount-2.1.8/ext/cstring.h
Examining data/ruby-rdiscount-2.1.8/ext/flags.c
Examining data/ruby-rdiscount-2.1.8/ext/mktags.c
Examining data/ruby-rdiscount-2.1.8/ext/config.h
Examining data/ruby-rdiscount-2.1.8/ext/xmlpage.c
Examining data/ruby-rdiscount-2.1.8/ext/mkdio.c
Examining data/ruby-rdiscount-2.1.8/ext/amalloc.h
Examining data/ruby-rdiscount-2.1.8/ext/emmatch.c
Examining data/ruby-rdiscount-2.1.8/ext/xml.c
Examining data/ruby-rdiscount-2.1.8/ext/markdown.h
Examining data/ruby-rdiscount-2.1.8/ext/html5.c
Examining data/ruby-rdiscount-2.1.8/ext/dumptree.c
Examining data/ruby-rdiscount-2.1.8/ext/css.c
Examining data/ruby-rdiscount-2.1.8/ext/version.c
Examining data/ruby-rdiscount-2.1.8/ext/basename.c
Examining data/ruby-rdiscount-2.1.8/ext/github_flavoured.c
Examining data/ruby-rdiscount-2.1.8/ext/toc.c
Examining data/ruby-rdiscount-2.1.8/ext/rdiscount.c

FINAL RESULTS:

data/ruby-rdiscount-2.1.8/ext/Csio.c:29:8:  [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.
	siz = vsnprintf(T(*iot)+S(*iot), ALLOCATED(*iot)-S(*iot), fmt, ptr);
data/ruby-rdiscount-2.1.8/ext/basename.c:24:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(ret, base);
data/ruby-rdiscount-2.1.8/ext/flags.c:62:6:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	    fprintf(f, htmlplease ? "<s>" : "!");
data/ruby-rdiscount-2.1.8/ext/generate.c:175:5:  [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.
    vsnprintf(bfr, sizeof bfr, fmt, ptr);
data/ruby-rdiscount-2.1.8/ext/markdown.c:824:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(p->ident, "%s=\"%.*s\"", prefix, S(q->text)-(i+2),
data/ruby-rdiscount-2.1.8/ext/pgm_options.c:97:7:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		    fprintf(stderr, opts[i].off ? "disable " : "enable ");
data/ruby-rdiscount-2.1.8/ext/amalloc.c:106:10:  [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("AMALLOC_STATISTICS") ) {
data/ruby-rdiscount-2.1.8/ext/config.h:22:21:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define COINTOSS() (random()&1)
data/ruby-rdiscount-2.1.8/ext/config.h:28:20:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define INITRNG(x) srandom((unsigned int)x)
data/ruby-rdiscount-2.1.8/ext/config.h:30:20:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define INITRNG(x) srand((unsigned int)x)
data/ruby-rdiscount-2.1.8/ext/Csio.c:44:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(T(*iot)+S(*iot), bfr, size);
data/ruby-rdiscount-2.1.8/ext/cstring.h:40:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	    memcpy(((S(t) += (sz)) - (sz)) + \
data/ruby-rdiscount-2.1.8/ext/cstring.h:48:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	    memcpy( T(t), (p), (sz) ); \
data/ruby-rdiscount-2.1.8/ext/emmatch.c:95: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 open[10];
data/ruby-rdiscount-2.1.8/ext/emmatch.c:95: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).
    char open[10];
data/ruby-rdiscount-2.1.8/ext/emmatch.c:96: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 close[10];
data/ruby-rdiscount-2.1.8/ext/emmatch.c:144:40:  [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).
	PREFIX(start->b_text, emtags[match-1].open, emtags[match-1].size-1);
data/ruby-rdiscount-2.1.8/ext/generate.c:171: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 bfr[80];
data/ruby-rdiscount-2.1.8/ext/basename.c:23:60:  [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 ( base && string && (*string == '/') && (ret=malloc(strlen(base)+size+2)) ) {
data/ruby-rdiscount-2.1.8/ext/basename.c:25:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(ret, string, size);
data/ruby-rdiscount-2.1.8/ext/generate.c:589:19:  [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).
	    puturl(edit, strlen(edit), f, 0);
data/ruby-rdiscount-2.1.8/ext/generate.c:1114: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).
    if ( !(len = strlen(s)) )
data/ruby-rdiscount-2.1.8/ext/github_flavoured.c:24:24:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
gfm_populate(getc_func getc, void* ctx, int flags)
data/ruby-rdiscount-2.1.8/ext/github_flavoured.c:37:20:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ( (c = (*getc)(ctx)) != EOF ) {
data/ruby-rdiscount-2.1.8/ext/github_flavoured.c:99:36:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return gfm_populate((getc_func)fgetc, f, flags & INPUT_MASK);
data/ruby-rdiscount-2.1.8/ext/markdown.c:823:27:  [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 ( p->ident = malloc(4+strlen(prefix)+S(q->text)) )
data/ruby-rdiscount-2.1.8/ext/mkdio.c:91:20:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
populate(getc_func getc, void* ctx, int flags)
data/ruby-rdiscount-2.1.8/ext/mkdio.c:104:20:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ( (c = (*getc)(ctx)) != EOF ) {
data/ruby-rdiscount-2.1.8/ext/mkdio.c:147:32:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return populate((getc_func)fgetc, f, flags & INPUT_MASK);
data/ruby-rdiscount-2.1.8/ext/mktags.c:20:15:  [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).
    p->size = strlen(id);
data/ruby-rdiscount-2.1.8/ext/tags.c:28:36:  [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 ( !(p = mkd_search_tags(id, strlen(id))) ) {
data/ruby-rdiscount-2.1.8/ext/tags.c:34: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).
	p->size = strlen(id);
data/ruby-rdiscount-2.1.8/ext/xml.c:73:26:  [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).
	    Cswrite(&f, entity, strlen(entity));

ANALYSIS SUMMARY:

Hits = 33
Lines analyzed = 5884 in approximately 0.15 seconds (40178 lines/second)
Physical Source Lines of Code (SLOC) = 4122
Hits@level = [0]  41 [1]  15 [2]   8 [3]   4 [4]   6 [5]   0
Hits@level+ = [0+]  74 [1+]  33 [2+]  18 [3+]  10 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 17.9525 [1+] 8.00582 [2+] 4.36681 [3+] 2.42601 [4+] 1.4556 [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.