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/r-cran-commonmark-1.7/src/cmark/houdini.h Examining data/r-cran-commonmark-1.7/src/cmark/parser.h Examining data/r-cran-commonmark-1.7/src/cmark/references.h Examining data/r-cran-commonmark-1.7/src/cmark/inlines.h Examining data/r-cran-commonmark-1.7/src/cmark/references.c Examining data/r-cran-commonmark-1.7/src/cmark/plugin.c Examining data/r-cran-commonmark-1.7/src/cmark/blocks.c Examining data/r-cran-commonmark-1.7/src/cmark/buffer.c Examining data/r-cran-commonmark-1.7/src/cmark/registry.c Examining data/r-cran-commonmark-1.7/src/cmark/utf8.c Examining data/r-cran-commonmark-1.7/src/cmark/registry.h Examining data/r-cran-commonmark-1.7/src/cmark/node.h Examining data/r-cran-commonmark-1.7/src/cmark/cmark.c Examining data/r-cran-commonmark-1.7/src/cmark/main.c Examining data/r-cran-commonmark-1.7/src/cmark/commonmark.c Examining data/r-cran-commonmark-1.7/src/cmark/cmark-gfm.h Examining data/r-cran-commonmark-1.7/src/cmark/cmark-gfm_version.h Examining data/r-cran-commonmark-1.7/src/cmark/render.c Examining data/r-cran-commonmark-1.7/src/cmark/scanners.c Examining data/r-cran-commonmark-1.7/src/cmark/syntax_extension.c Examining data/r-cran-commonmark-1.7/src/cmark/chunk.h Examining data/r-cran-commonmark-1.7/src/cmark/footnotes.h Examining data/r-cran-commonmark-1.7/src/cmark/man.c Examining data/r-cran-commonmark-1.7/src/cmark/latex.c Examining data/r-cran-commonmark-1.7/src/cmark/render.h Examining data/r-cran-commonmark-1.7/src/cmark/houdini_href_e.c Examining data/r-cran-commonmark-1.7/src/cmark/syntax_extension.h Examining data/r-cran-commonmark-1.7/src/cmark/houdini_html_u.c Examining data/r-cran-commonmark-1.7/src/cmark/linked_list.c Examining data/r-cran-commonmark-1.7/src/cmark/inlines.c Examining data/r-cran-commonmark-1.7/src/cmark/cmark_ctype.h Examining data/r-cran-commonmark-1.7/src/cmark/utf8.h Examining data/r-cran-commonmark-1.7/src/cmark/plaintext.c Examining data/r-cran-commonmark-1.7/src/cmark/cmark-gfm_export.h Examining data/r-cran-commonmark-1.7/src/cmark/houdini_html_e.c Examining data/r-cran-commonmark-1.7/src/cmark/cmark_ctype.c Examining data/r-cran-commonmark-1.7/src/cmark/map.h Examining data/r-cran-commonmark-1.7/src/cmark/footnotes.c Examining data/r-cran-commonmark-1.7/src/cmark/plugin.h Examining data/r-cran-commonmark-1.7/src/cmark/html.h Examining data/r-cran-commonmark-1.7/src/cmark/map.c Examining data/r-cran-commonmark-1.7/src/cmark/xml.c Examining data/r-cran-commonmark-1.7/src/cmark/html.c Examining data/r-cran-commonmark-1.7/src/cmark/node.c Examining data/r-cran-commonmark-1.7/src/cmark/iterator.h Examining data/r-cran-commonmark-1.7/src/cmark/buffer.h Examining data/r-cran-commonmark-1.7/src/cmark/cmark-gfm-extension_api.h Examining data/r-cran-commonmark-1.7/src/cmark/scanners.h Examining data/r-cran-commonmark-1.7/src/cmark/iterator.c Examining data/r-cran-commonmark-1.7/src/cmark/arena.c Examining data/r-cran-commonmark-1.7/src/extensions/ext_scanners.c Examining data/r-cran-commonmark-1.7/src/extensions/cmark-gfm-extensions_export.h Examining data/r-cran-commonmark-1.7/src/extensions/tagfilter.h Examining data/r-cran-commonmark-1.7/src/extensions/strikethrough.h Examining data/r-cran-commonmark-1.7/src/extensions/tagfilter.c Examining data/r-cran-commonmark-1.7/src/extensions/table.c Examining data/r-cran-commonmark-1.7/src/extensions/core-extensions.c Examining data/r-cran-commonmark-1.7/src/extensions/strikethrough.c Examining data/r-cran-commonmark-1.7/src/extensions/cmark-gfm-core-extensions.h Examining data/r-cran-commonmark-1.7/src/extensions/autolink.c Examining data/r-cran-commonmark-1.7/src/extensions/table.h Examining data/r-cran-commonmark-1.7/src/extensions/ext_scanners.h Examining data/r-cran-commonmark-1.7/src/extensions/autolink.h Examining data/r-cran-commonmark-1.7/src/config.h Examining data/r-cran-commonmark-1.7/src/extensions.c Examining data/r-cran-commonmark-1.7/src/init.c Examining data/r-cran-commonmark-1.7/src/wrapper.c FINAL RESULTS: data/r-cran-commonmark-1.7/src/cmark/syntax_extension.c:25:3: [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(res->name, name); data/r-cran-commonmark-1.7/src/config.h:45: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 c99_snprintf data/r-cran-commonmark-1.7/src/config.h:46:9: [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 vsnprintf c99_vsnprintf data/r-cran-commonmark-1.7/src/cmark/arena.c:90: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(new_ptr, ptr, ((size_t *) ptr)[-1]); data/r-cran-commonmark-1.7/src/cmark/blocks.c:471:9: [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 n[32]; data/r-cran-commonmark-1.7/src/cmark/blocks.c:622: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. unsigned char buffer[4096]; data/r-cran-commonmark-1.7/src/cmark/blocks.c:1190:9: [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(&((*container)->as.list), data, sizeof(*data)); data/r-cran-commonmark-1.7/src/cmark/blocks.c:1197:7: [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(&((*container)->as.list), data, sizeof(*data)); data/r-cran-commonmark-1.7/src/cmark/buffer.c:18:10: [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. unsigned char cmark_strbuf__initbuf[1]; data/r-cran-commonmark-1.7/src/cmark/chunk.h:71: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(str, c->data, c->len); data/r-cran-commonmark-1.7/src/cmark/chunk.h:91: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(c->data, str, c->len + 1); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:32: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 encoded[ENCODED_SIZE]; data/r-cran-commonmark-1.7/src/cmark/commonmark.c:176: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 listmarker[LISTMARKER_SIZE]; data/r-cran-commonmark-1.7/src/cmark/commonmark.c:482:7: [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 n[32]; data/r-cran-commonmark-1.7/src/cmark/houdini_html_u.c:16:22: [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. strncmp((const char *)s, (const char *)cmark_entities[i].entity, len); data/r-cran-commonmark-1.7/src/cmark/houdini_html_u.c:16:39: [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. strncmp((const char *)s, (const char *)cmark_entities[i].entity, len); data/r-cran-commonmark-1.7/src/cmark/houdini_html_u.c:18:28: [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. return (const unsigned char *)cmark_entities[i].bytes; data/r-cran-commonmark-1.7/src/cmark/html.c:68: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 n[32]; data/r-cran-commonmark-1.7/src/cmark/html.c:87: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 buffer[BUFFER_SIZE]; data/r-cran-commonmark-1.7/src/cmark/html.c:399:7: [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 n[32]; data/r-cran-commonmark-1.7/src/cmark/html.h:17: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 buffer[BUFFER_SIZE]; data/r-cran-commonmark-1.7/src/cmark/inlines.c:122: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(c.data, src->data, len); data/r-cran-commonmark-1.7/src/cmark/inlines.c:1497:19: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return (char *) memcpy (result, s, len); data/r-cran-commonmark-1.7/src/cmark/latex.c:226: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 list_number_string[LIST_NUMBER_STRING_SIZE]; data/r-cran-commonmark-1.7/src/cmark/main.c:110: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 buffer[4096]; data/r-cran-commonmark-1.7/src/cmark/main.c:241:16: [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). FILE *fp = fopen(argv[files[i]], "rb"); data/r-cran-commonmark-1.7/src/cmark/man.c:132:9: [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 list_number_s[LIST_NUMBER_SIZE]; data/r-cran-commonmark-1.7/src/cmark/plaintext.c:40: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 listmarker[LISTMARKER_SIZE]; data/r-cran-commonmark-1.7/src/cmark/plaintext.c:206:7: [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 n[32]; data/r-cran-commonmark-1.7/src/cmark/xml.c:40: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 buffer[BUFFER_SIZE]; data/r-cran-commonmark-1.7/src/extensions/autolink.c:29:40: [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. if (link_len > len && strncasecmp((char *)link, valid_uris[i], len) == 0 && data/r-cran-commonmark-1.7/src/extensions/strikethrough.c:12: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 buffer[101]; data/r-cran-commonmark-1.7/src/extensions/table.c:743:3: [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(a, alignments, ncols); data/r-cran-commonmark-1.7/src/cmark/buffer.c:99:40: [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). string ? (bufsize_t)strlen(string) : 0); data/r-cran-commonmark-1.7/src/cmark/buffer.c:120:67: [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). cmark_strbuf_put(buf, (const unsigned char *)string, (bufsize_t)strlen(string)); data/r-cran-commonmark-1.7/src/cmark/chunk.h:88:25: [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). c->len = (bufsize_t)strlen(str); data/r-cran-commonmark-1.7/src/cmark/chunk.h:99:37: [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). bufsize_t len = data ? (bufsize_t)strlen(data) : 0; data/r-cran-commonmark-1.7/src/cmark/commonmark.c:71:21: [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 code_len = strlen(code); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:92:21: [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 code_len = strlen(code); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:244:33: [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). marker_width = (bufsize_t)strlen(listmarker); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:286: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). info_len = strlen(info); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:288: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). code_len = strlen(code); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:371: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). code_len = strlen(code); data/r-cran-commonmark-1.7/src/cmark/commonmark.c:444: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). if (strlen(title) > 0) { data/r-cran-commonmark-1.7/src/cmark/commonmark.c:461:11: [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(title) > 0) { data/r-cran-commonmark-1.7/src/cmark/inlines.c:1487: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 (s); data/r-cran-commonmark-1.7/src/cmark/latex.c:172: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). url_len = strlen(url); data/r-cran-commonmark-1.7/src/cmark/latex.c:178: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). title_len = strlen(title); data/r-cran-commonmark-1.7/src/cmark/main.c:167:25: [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 (unparsed && strlen(unparsed) > 0) { data/r-cran-commonmark-1.7/src/cmark/plaintext.c:95:33: [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). marker_width = (bufsize_t)strlen(listmarker); data/r-cran-commonmark-1.7/src/cmark/render.c:25:21: [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). int length = (int)strlen(source); data/r-cran-commonmark-1.7/src/cmark/syntax_extension.c:24:56: [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). res->name = (char *) _mem->calloc(1, sizeof(char) * (strlen(name)) + 1); data/r-cran-commonmark-1.7/src/extensions/autolink.c:27: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(valid_uris[i]); data/r-cran-commonmark-1.7/src/extensions/autolink.c:160:40: [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/r-cran-commonmark-1.7/src/extensions/autolink.c:220:14: [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/r-cran-commonmark-1.7/src/extensions/table.c:183:37: [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). (int)strlen(parent_string)); data/r-cran-commonmark-1.7/src/extensions/table.c:206: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). (int)strlen(parent_string)); data/r-cran-commonmark-1.7/src/extensions/table.c:244: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). table_header->end_column = parent_container->start_column + (int)strlen(parent_string) - 2; data/r-cran-commonmark-1.7/src/extensions/table.c:267: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). (int)strlen((char *)input) - 1 - cmark_parser_get_offset(parser), false); ANALYSIS SUMMARY: Hits = 59 Lines analyzed = 24480 in approximately 0.53 seconds (46331 lines/second) Physical Source Lines of Code (SLOC) = 21037 Hits@level = [0] 55 [1] 26 [2] 30 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 114 [1+] 59 [2+] 33 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 5.41902 [1+] 2.80458 [2+] 1.56866 [3+] 0.142606 [4+] 0.142606 [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.