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/haskell-libyaml-0.1.2/c/helper.c Examining data/haskell-libyaml-0.1.2/c/helper.h Examining data/haskell-libyaml-0.1.2/libyaml_src/api.c Examining data/haskell-libyaml-0.1.2/libyaml_src/dumper.c Examining data/haskell-libyaml-0.1.2/libyaml_src/emitter.c Examining data/haskell-libyaml-0.1.2/libyaml_src/loader.c Examining data/haskell-libyaml-0.1.2/libyaml_src/parser.c Examining data/haskell-libyaml-0.1.2/libyaml_src/reader.c Examining data/haskell-libyaml-0.1.2/libyaml_src/scanner.c Examining data/haskell-libyaml-0.1.2/libyaml_src/writer.c Examining data/haskell-libyaml-0.1.2/libyaml_src/yaml_private.h Examining data/haskell-libyaml-0.1.2/libyaml_src/yaml.h FINAL RESULTS: data/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/c/helper.c:28: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(b->buff + b->used, str, size); data/haskell-libyaml-0.1.2/c/helper.c:177:13: [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 *in = fopen(filename, "r"); data/haskell-libyaml-0.1.2/libyaml_src/api.c:115: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/haskell-libyaml-0.1.2/libyaml_src/api.c:266: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/haskell-libyaml-0.1.2/libyaml_src/api.c:428: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/haskell-libyaml-0.1.2/libyaml_src/api.c:437: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/haskell-libyaml-0.1.2/libyaml_src/api.c:858: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1234: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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_src/api.c:743: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/haskell-libyaml-0.1.2/libyaml_src/api.c:746: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/haskell-libyaml-0.1.2/libyaml_src/api.c:807: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/haskell-libyaml-0.1.2/libyaml_src/api.c:840: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/haskell-libyaml-0.1.2/libyaml_src/api.c:846: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/haskell-libyaml-0.1.2/libyaml_src/api.c:852: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/haskell-libyaml-0.1.2/libyaml_src/api.c:890: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/haskell-libyaml-0.1.2/libyaml_src/api.c:896: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/haskell-libyaml-0.1.2/libyaml_src/api.c:945: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/haskell-libyaml-0.1.2/libyaml_src/api.c:951: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1086: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1089: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1223: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1228: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1275: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/haskell-libyaml-0.1.2/libyaml_src/api.c:1320: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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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/haskell-libyaml-0.1.2/libyaml_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 = 42 Lines analyzed = 13033 in approximately 0.27 seconds (48016 lines/second) Physical Source Lines of Code (SLOC) = 7534 Hits@level = [0] 1 [1] 29 [2] 12 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 43 [1+] 42 [2+] 13 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 5.70746 [1+] 5.57473 [2+] 1.72551 [3+] 0.132732 [4+] 0.132732 [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.