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-github-markdown-0.6.9/ext/markdown/buffer.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/markdown.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/houdini_href_e.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/html.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/stack.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/autolink.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/plaintext.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/autolink.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/plaintext.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/houdini_html_e.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/html.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/houdini.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/markdown.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/stack.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/html_blocks.h Examining data/ruby-github-markdown-0.6.9/ext/markdown/buffer.c Examining data/ruby-github-markdown-0.6.9/ext/markdown/gh-markdown.c FINAL RESULTS: data/ruby-github-markdown-0.6.9/ext/markdown/buffer.c:31:25: [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. # define _buf_vsnprintf vsnprintf data/ruby-github-markdown-0.6.9/ext/markdown/buffer.h:90:73: [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. void bufprintf(struct buf *, const char *, ...) __attribute__ ((format (printf, 2, 3))); data/ruby-github-markdown-0.6.9/ext/markdown/autolink.c:43:17: [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. strncasecmp((char *)link, valid_uris[i], len) == 0 && data/ruby-github-markdown-0.6.9/ext/markdown/buffer.c:162:2: [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(buf->data + buf->size, data, len); data/ruby-github-markdown-0.6.9/ext/markdown/houdini_href_e.c:58:2: [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 hex_str[3]; data/ruby-github-markdown-0.6.9/ext/markdown/html.c:580:2: [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(callbacks, &cb_default, sizeof(struct sd_callbacks)); data/ruby-github-markdown-0.6.9/ext/markdown/html.c:623:2: [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(callbacks, &cb_default, sizeof(struct sd_callbacks)); data/ruby-github-markdown-0.6.9/ext/markdown/html_blocks.h:36:17: [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 unsigned char gperf_downcase[256] = data/ruby-github-markdown-0.6.9/ext/markdown/markdown.c:2489:2: [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(&md->cb, callbacks, sizeof(struct sd_callbacks)); data/ruby-github-markdown-0.6.9/ext/markdown/plaintext.c:186:2: [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(callbacks, &cb_default, sizeof(struct sd_callbacks)); data/ruby-github-markdown-0.6.9/ext/markdown/autolink.c:40:16: [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(valid_uris[i]); data/ruby-github-markdown-0.6.9/ext/markdown/autolink.c:182:39: [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 (size < 4 || memcmp(data, "www.", strlen("www.")) != 0) data/ruby-github-markdown-0.6.9/ext/markdown/autolink.c:283: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). link_end = strlen("://"); data/ruby-github-markdown-0.6.9/ext/markdown/buffer.c:170: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). bufput(buf, str, strlen(str)); data/ruby-github-markdown-0.6.9/ext/markdown/buffer.h:53:24: [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). { (uint8_t *)strname, strlen(strname), 0, 0, 0 } data/ruby-github-markdown-0.6.9/ext/markdown/markdown.c:1912:20: [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 tag_size = strlen(curtag); ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 5166 in approximately 0.15 seconds (34766 lines/second) Physical Source Lines of Code (SLOC) = 3577 Hits@level = [0] 0 [1] 6 [2] 8 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 16 [1+] 16 [2+] 10 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 4.47302 [1+] 4.47302 [2+] 2.79564 [3+] 0.559128 [4+] 0.559128 [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.