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-yaml-2.2.1/src/yaml.h Examining data/r-cran-yaml-2.2.1/src/emitter.c Examining data/r-cran-yaml-2.2.1/src/r_ext.h Examining data/r-cran-yaml-2.2.1/src/scanner.c Examining data/r-cran-yaml-2.2.1/src/reader.c Examining data/r-cran-yaml-2.2.1/src/yaml_private.h Examining data/r-cran-yaml-2.2.1/src/r_emit.c Examining data/r-cran-yaml-2.2.1/src/api.c Examining data/r-cran-yaml-2.2.1/src/loader.c Examining data/r-cran-yaml-2.2.1/src/r_parse.c Examining data/r-cran-yaml-2.2.1/src/implicit.c Examining data/r-cran-yaml-2.2.1/src/parser.c Examining data/r-cran-yaml-2.2.1/src/writer.c Examining data/r-cran-yaml-2.2.1/src/r_ext.c Examining data/r-cran-yaml-2.2.1/src/dumper.c FINAL RESULTS: data/r-cran-yaml-2.2.1/src/dumper.c:254:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf((char *)anchor, ANCHOR_TEMPLATE, anchor_id); data/r-cran-yaml-2.2.1/src/r_emit.c:116:11: [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. n = snprintf(str, REAL_BUF_SIZE, format, precision, x); data/r-cran-yaml-2.2.1/src/r_ext.c:24:12: [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. result = vsnprintf(Ryaml_error_msg, ERROR_MSG_SIZE, format, args); data/r-cran-yaml-2.2.1/src/api.c:108: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(*a_pointer, *b_start, *b_pointer - *b_start); data/r-cran-yaml-2.2.1/src/api.c:264: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(buffer, parser->input.string.current, size); data/r-cran-yaml-2.2.1/src/api.c:426: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(emitter->output.string.buffer data/r-cran-yaml-2.2.1/src/api.c:435: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(emitter->output.string.buffer data/r-cran-yaml-2.2.1/src/api.c:866: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(value_copy, value, length); data/r-cran-yaml-2.2.1/src/api.c:1237: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(value_copy, value, length); data/r-cran-yaml-2.2.1/src/emitter.c:2178: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 indent_hint[2]; data/r-cran-yaml-2.2.1/src/parser.c:613:25: [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(tag, tag_directive->prefix, prefix_len); data/r-cran-yaml-2.2.1/src/parser.c:614:25: [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(tag+prefix_len, tag_suffix, suffix_len); data/r-cran-yaml-2.2.1/src/r_emit.c:5:8: [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. extern char Ryaml_error_msg[ERROR_MSG_SIZE]; data/r-cran-yaml-2.2.1/src/r_emit.c:57: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((void *)(str + str_end), (void *)CHAR(s_chr), chr_len); data/r-cran-yaml-2.2.1/src/r_emit.c:92: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 str[REAL_BUF_SIZE], format[5] = "%.*f", *strp = NULL; data/r-cran-yaml-2.2.1/src/r_ext.c:15:1: [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 Ryaml_error_msg[ERROR_MSG_SIZE]; data/r-cran-yaml-2.2.1/src/r_parse.c:9:8: [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. extern char Ryaml_error_msg[ERROR_MSG_SIZE]; data/r-cran-yaml-2.2.1/src/r_parse.c:1367: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(error_msg_copy, Ryaml_error_msg, ERROR_MSG_SIZE); data/r-cran-yaml-2.2.1/src/scanner.c:2592: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(string.start, head+1, length-1); data/r-cran-yaml-2.2.1/src/api.c:753: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). strlen((char *)tag_directive->handle))) data/r-cran-yaml-2.2.1/src/api.c:756: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). strlen((char *)tag_directive->prefix))) data/r-cran-yaml-2.2.1/src/api.c:817: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 (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0; data/r-cran-yaml-2.2.1/src/api.c:848:38: [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 (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error; data/r-cran-yaml-2.2.1/src/api.c:854: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 (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; data/r-cran-yaml-2.2.1/src/api.c:860: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). length = strlen((char *)value); data/r-cran-yaml-2.2.1/src/api.c:898:38: [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 (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error; data/r-cran-yaml-2.2.1/src/api.c:904: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 (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; data/r-cran-yaml-2.2.1/src/api.c:953:38: [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 (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error; data/r-cran-yaml-2.2.1/src/api.c:959: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 (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; data/r-cran-yaml-2.2.1/src/api.c:1094: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). strlen((char *)tag_directive->handle))) data/r-cran-yaml-2.2.1/src/api.c:1097: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). strlen((char *)tag_directive->prefix))) data/r-cran-yaml-2.2.1/src/api.c:1226:31: [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 (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; data/r-cran-yaml-2.2.1/src/api.c:1231: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). length = strlen((char *)value); data/r-cran-yaml-2.2.1/src/api.c:1278:31: [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 (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; data/r-cran-yaml-2.2.1/src/api.c:1323:31: [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 (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; data/r-cran-yaml-2.2.1/src/emitter.c:620:29: [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). strlen((char *)tag_directive->handle))) data/r-cran-yaml-2.2.1/src/emitter.c:623:29: [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). strlen((char *)tag_directive->prefix), 1)) data/r-cran-yaml-2.2.1/src/emitter.c:1352: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). handle_length = strlen((char *)tag_directive.handle); data/r-cran-yaml-2.2.1/src/emitter.c:1353: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). prefix_length = strlen((char *)tag_directive.prefix); data/r-cran-yaml-2.2.1/src/emitter.c:1401: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). anchor_length = strlen((char *)anchor); data/r-cran-yaml-2.2.1/src/emitter.c:1438: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). tag_length = strlen((char *)tag); data/r-cran-yaml-2.2.1/src/emitter.c:1448:32: [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 prefix_length = strlen((char *)tag_directive->prefix); data/r-cran-yaml-2.2.1/src/emitter.c:1455:17: [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). strlen((char *)tag_directive->handle); data/r-cran-yaml-2.2.1/src/emitter.c:1788: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). indicator_length = strlen(indicator); data/r-cran-yaml-2.2.1/src/parser.c:606:45: [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 prefix_len = strlen((char *)tag_directive->prefix); data/r-cran-yaml-2.2.1/src/parser.c:607:45: [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 suffix_len = strlen((char *)tag_suffix); data/r-cran-yaml-2.2.1/src/scanner.c:2437:61: [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 (handle[0] == '!' && handle[1] != '\0' && handle[strlen((char *)handle)-1] == '!') data/r-cran-yaml-2.2.1/src/scanner.c:2571:28: [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 length = head ? strlen((char *)head) : 0; ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 17068 in approximately 0.32 seconds (52768 lines/second) Physical Source Lines of Code (SLOC) = 11139 Hits@level = [0] 1 [1] 29 [2] 16 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 49 [1+] 48 [2+] 19 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 4.39896 [1+] 4.30918 [2+] 1.70572 [3+] 0.269324 [4+] 0.269324 [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.