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-redcarpet-3.5.0/ext/redcarpet/html.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/stack.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/stack.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/rc_markdown.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/redcarpet.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/html.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/houdini.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/autolink.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/houdini_href_e.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/buffer.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/html_blocks.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/markdown.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/buffer.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/markdown.h Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/rc_render.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/html_smartypants.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/houdini_html_e.c Examining data/ruby-redcarpet-3.5.0/ext/redcarpet/autolink.h FINAL RESULTS: data/ruby-redcarpet-3.5.0/ext/redcarpet/buffer.c:38: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-redcarpet-3.5.0/ext/redcarpet/buffer.h:82: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-redcarpet-3.5.0/ext/redcarpet/html_smartypants.c:32:9: [4] (format) snprintf: 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 snprintf _snprintf data/ruby-redcarpet-3.5.0/ext/redcarpet/html_smartypants.c:32:18: [4] (format) _snprintf: 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 snprintf _snprintf data/ruby-redcarpet-3.5.0/ext/redcarpet/autolink.c:49: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-redcarpet-3.5.0/ext/redcarpet/buffer.c:169: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-redcarpet-3.5.0/ext/redcarpet/houdini_href_e.c:80: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-redcarpet-3.5.0/ext/redcarpet/html.c:782: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-redcarpet-3.5.0/ext/redcarpet/html.c:833: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-redcarpet-3.5.0/ext/redcarpet/html_blocks.h:37: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-redcarpet-3.5.0/ext/redcarpet/html_smartypants.c:121: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 ent[8]; data/ruby-redcarpet-3.5.0/ext/redcarpet/markdown.c:2748: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-redcarpet-3.5.0/ext/redcarpet/autolink.c:46: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-redcarpet-3.5.0/ext/redcarpet/autolink.c:181: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-redcarpet-3.5.0/ext/redcarpet/autolink.c:278: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-redcarpet-3.5.0/ext/redcarpet/buffer.c:177: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-redcarpet-3.5.0/ext/redcarpet/html_smartypants.c:108: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(*p); data/ruby-redcarpet-3.5.0/ext/redcarpet/markdown.c:2094: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 = 18 Lines analyzed = 6553 in approximately 0.17 seconds (38163 lines/second) Physical Source Lines of Code (SLOC) = 4522 Hits@level = [0] 1 [1] 6 [2] 8 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 19 [1+] 18 [2+] 12 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 4.20168 [1+] 3.98054 [2+] 2.65369 [3+] 0.884564 [4+] 0.884564 [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.