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/libyaml-0.2.2/include/yaml.h Examining data/libyaml-0.2.2/src/api.c Examining data/libyaml-0.2.2/src/dumper.c Examining data/libyaml-0.2.2/src/emitter.c Examining data/libyaml-0.2.2/src/loader.c Examining data/libyaml-0.2.2/src/parser.c Examining data/libyaml-0.2.2/src/reader.c Examining data/libyaml-0.2.2/src/scanner.c Examining data/libyaml-0.2.2/src/writer.c Examining data/libyaml-0.2.2/src/yaml_private.h Examining data/libyaml-0.2.2/tests/example-deconstructor-alt.c Examining data/libyaml-0.2.2/tests/example-deconstructor.c Examining data/libyaml-0.2.2/tests/example-reformatter-alt.c Examining data/libyaml-0.2.2/tests/example-reformatter.c Examining data/libyaml-0.2.2/tests/run-dumper.c Examining data/libyaml-0.2.2/tests/run-emitter-test-suite.c Examining data/libyaml-0.2.2/tests/run-emitter.c Examining data/libyaml-0.2.2/tests/run-loader.c Examining data/libyaml-0.2.2/tests/run-parser-test-suite.c Examining data/libyaml-0.2.2/tests/run-parser.c Examining data/libyaml-0.2.2/tests/run-scanner.c Examining data/libyaml-0.2.2/tests/test-reader.c Examining data/libyaml-0.2.2/tests/test-version.c FINAL RESULTS: data/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/src/api.c:854: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/libyaml-0.2.2/src/api.c:1225: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/libyaml-0.2.2/src/emitter.c:2176: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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/tests/example-deconstructor-alt.c:208:21: [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 number[64]; data/libyaml-0.2.2/tests/example-deconstructor-alt.c:226:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(number, "%d", version->major); data/libyaml-0.2.2/tests/example-deconstructor-alt.c:238:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(number, "%d", version->minor); data/libyaml-0.2.2/tests/example-deconstructor.c:244:21: [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 number[64]; data/libyaml-0.2.2/tests/example-deconstructor.c:275:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(number, "%d", version->major); data/libyaml-0.2.2/tests/example-deconstructor.c:294:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(number, "%d", version->minor); data/libyaml-0.2.2/tests/run-dumper.c:168: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 data[BUFFER_SIZE]; data/libyaml-0.2.2/tests/run-dumper.c:174:12: [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 = fopen(name, "rb"); data/libyaml-0.2.2/tests/run-dumper.c:232:18: [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[BUFFER_SIZE+1]; data/libyaml-0.2.2/tests/run-dumper.c:246: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 = fopen(argv[number], "rb"); data/libyaml-0.2.2/tests/run-emitter-test-suite.c:20: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 line[1024]; data/libyaml-0.2.2/tests/run-emitter-test-suite.c:25:17: [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). input = fopen(argv[1], "rb"); data/libyaml-0.2.2/tests/run-emitter-test-suite.c:42: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 anchor[256]; data/libyaml-0.2.2/tests/run-emitter-test-suite.c:43: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 tag[256]; data/libyaml-0.2.2/tests/run-emitter-test-suite.c:77:13: [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 value[1024]; data/libyaml-0.2.2/tests/run-emitter-test-suite.c:161: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(anchor, start, end - start); data/libyaml-0.2.2/tests/run-emitter-test-suite.c:174: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(tag, start + 1, end - start - 1); data/libyaml-0.2.2/tests/run-emitter.c:191: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 data[BUFFER_SIZE]; data/libyaml-0.2.2/tests/run-emitter.c:197:12: [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 = fopen(name, "rb"); data/libyaml-0.2.2/tests/run-emitter.c:254:18: [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[BUFFER_SIZE+1]; data/libyaml-0.2.2/tests/run-emitter.c:268: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 = fopen(argv[number], "rb"); data/libyaml-0.2.2/tests/run-loader.c:33: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 = fopen(argv[number], "rb"); data/libyaml-0.2.2/tests/run-parser-test-suite.c:17:17: [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). input = fopen(argv[1], "rb"); data/libyaml-0.2.2/tests/run-parser.c:33: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 = fopen(argv[number], "rb"); data/libyaml-0.2.2/tests/run-scanner.c:33: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 = fopen(argv[number], "rb"); data/libyaml-0.2.2/tests/test-version.c:17: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 buf[64]; data/libyaml-0.2.2/tests/test-version.c:20:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%d.%d.%d", major, minor, patch); data/libyaml-0.2.2/src/api.c:741: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/libyaml-0.2.2/src/api.c:744: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/libyaml-0.2.2/src/api.c:805: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/libyaml-0.2.2/src/api.c:836: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/libyaml-0.2.2/src/api.c:842: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/libyaml-0.2.2/src/api.c:848: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/libyaml-0.2.2/src/api.c:886: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/libyaml-0.2.2/src/api.c:892: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/libyaml-0.2.2/src/api.c:941: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/libyaml-0.2.2/src/api.c:947: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/libyaml-0.2.2/src/api.c:1082: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/libyaml-0.2.2/src/api.c:1085: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/libyaml-0.2.2/src/api.c:1214: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/libyaml-0.2.2/src/api.c:1219: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/libyaml-0.2.2/src/api.c:1266: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/libyaml-0.2.2/src/api.c:1311: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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/src/emitter.c:1350: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/libyaml-0.2.2/src/emitter.c:1351: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/libyaml-0.2.2/src/emitter.c:1399: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/libyaml-0.2.2/src/emitter.c:1436: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/libyaml-0.2.2/src/emitter.c:1446: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/libyaml-0.2.2/src/emitter.c:1453: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/libyaml-0.2.2/src/emitter.c:1786: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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/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/libyaml-0.2.2/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; data/libyaml-0.2.2/tests/run-emitter-test-suite.c:160:22: [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). end = line + strlen(line); data/libyaml-0.2.2/tests/run-emitter-test-suite.c:184: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). char *end = line + strlen(line); ANALYSIS SUMMARY: Hits = 69 Lines analyzed = 16722 in approximately 0.39 seconds (43066 lines/second) Physical Source Lines of Code (SLOC) = 10324 Hits@level = [0] 171 [1] 31 [2] 37 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 240 [1+] 69 [2+] 38 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 23.2468 [1+] 6.68346 [2+] 3.68074 [3+] 0.0968617 [4+] 0.0968617 [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.