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-cbor-0.5.9.6/ext/cbor/unpacker_class.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/rbinit.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/packer_class.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/sysdep_endian.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/core_ext.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/core_ext.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/packer.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/compat.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/cbor.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/unpacker.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/sysdep_types.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/unpacker.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/unpacker_class.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/buffer_class.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/packer.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/packer_class.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/buffer_class.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/renamer.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/rmem.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c Examining data/ruby-cbor-0.5.9.6/ext/cbor/buffer.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/sysdep.h Examining data/ruby-cbor-0.5.9.6/ext/cbor/rmem.h FINAL RESULTS: data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:220:17: [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, b->read_buffer, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:227:13: [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, b->read_buffer, avail); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:436:17: [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->tail.last, data, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:446: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(b->tail.last, data, tail_avail); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:467:13: [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(mem, data, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:490:13: [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(last, data, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:546: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, b->read_buffer, avail); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.c:554: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(buffer, c->first, avail); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.h:95: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 buffer[8]; data/ruby-cbor-0.5.9.6/ext/cbor/buffer.h:216: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(b->tail.last, data, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.h:246: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(b->tail.last, data, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.h:374: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, b->read_buffer, length); data/ruby-cbor-0.5.9.6/ext/cbor/buffer.h:461: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(tmp, b->read_buffer, length); data/ruby-cbor-0.5.9.6/ext/cbor/packer.h:145: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 mem[4]; data/ruby-cbor-0.5.9.6/ext/cbor/packer.h:180: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 mem[8]; data/ruby-cbor-0.5.9.6/ext/cbor/packer.h:263: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[len]; /* XXX */ data/ruby-cbor-0.5.9.6/ext/cbor/unpacker.c:546:11: [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 msdig_str[SIZEOF_BDIGITS]; data/ruby-cbor-0.5.9.6/ext/cbor/unpacker.c:550: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(u.msdig_str + missbytes, sp, SIZEOF_BDIGITS - missbytes); data/ruby-cbor-0.5.9.6/ext/cbor/unpacker.c:554:11: [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(u.msdig_str, sp, SIZEOF_BDIGITS); data/ruby-cbor-0.5.9.6/ext/cbor/unpacker.c:565:11: [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(p, "%02x", *sp++ & 0xFF); data/ruby-cbor-0.5.9.6/ext/cbor/packer.h:225: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). unsigned long len = strlen(name); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 4997 in approximately 0.14 seconds (35759 lines/second) Physical Source Lines of Code (SLOC) = 3435 Hits@level = [0] 1 [1] 1 [2] 20 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 22 [1+] 21 [2+] 20 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 6.40466 [1+] 6.11354 [2+] 5.82242 [3+] 0 [4+] 0 [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.