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/avro-c-1.9.0/tests/test_avro_data.c Examining data/avro-c-1.9.0/tests/test_avro_schema_names.c Examining data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c Examining data/avro-c-1.9.0/tests/test_avro_1238.c Examining data/avro-c-1.9.0/tests/test_avro_1906.c Examining data/avro-c-1.9.0/tests/generate_interop_data.c Examining data/avro-c-1.9.0/tests/test_avro_1572.c Examining data/avro-c-1.9.0/tests/test_avro_1691.c Examining data/avro-c-1.9.0/tests/test_interop_data.c Examining data/avro-c-1.9.0/tests/test_avro_766.c Examining data/avro-c-1.9.0/tests/test_avro_1165.c Examining data/avro-c-1.9.0/tests/test_refcount.c Examining data/avro-c-1.9.0/tests/test_avro_schema.c Examining data/avro-c-1.9.0/tests/test_avro_984.c Examining data/avro-c-1.9.0/tests/test_avro_1034.c Examining data/avro-c-1.9.0/tests/test_avro_values.c Examining data/avro-c-1.9.0/tests/test_avro_1405.c Examining data/avro-c-1.9.0/tests/performance.c Examining data/avro-c-1.9.0/tests/test_avro_1904.c Examining data/avro-c-1.9.0/tests/test_avro_1087.c Examining data/avro-c-1.9.0/tests/test_avro_968.c Examining data/avro-c-1.9.0/tests/test_avro_1237.c Examining data/avro-c-1.9.0/tests/test_avro_1379.c Examining data/avro-c-1.9.0/tests/test_cpp.cpp Examining data/avro-c-1.9.0/tests/test_avro_1279.c Examining data/avro-c-1.9.0/tests/test_avro_1167.c Examining data/avro-c-1.9.0/tests/msdirent.h Examining data/avro-c-1.9.0/tests/test_data_structures.c Examining data/avro-c-1.9.0/tests/test_avro_1084.c Examining data/avro-c-1.9.0/examples/quickstop.c Examining data/avro-c-1.9.0/src/datum_equal.c Examining data/avro-c-1.9.0/src/dump.h Examining data/avro-c-1.9.0/src/codec.c Examining data/avro-c-1.9.0/src/datum.c Examining data/avro-c-1.9.0/src/st.h Examining data/avro-c-1.9.0/src/resolved-reader.c Examining data/avro-c-1.9.0/src/array.c Examining data/avro-c-1.9.0/src/avro.h Examining data/avro-c-1.9.0/src/io.c Examining data/avro-c-1.9.0/src/resolver.c Examining data/avro-c-1.9.0/src/datum_write.c Examining data/avro-c-1.9.0/src/datum_value.c Examining data/avro-c-1.9.0/src/datum_size.c Examining data/avro-c-1.9.0/src/datum_skip.c Examining data/avro-c-1.9.0/src/encoding.h Examining data/avro-c-1.9.0/src/string.c Examining data/avro-c-1.9.0/src/avro_generic_internal.h Examining data/avro-c-1.9.0/src/schema.h Examining data/avro-c-1.9.0/src/avropipe.c Examining data/avro-c-1.9.0/src/st.c Examining data/avro-c-1.9.0/src/resolved-writer.c Examining data/avro-c-1.9.0/src/avrocat.c Examining data/avro-c-1.9.0/src/datum.h Examining data/avro-c-1.9.0/src/codec.h Examining data/avro-c-1.9.0/src/value-write.c Examining data/avro-c-1.9.0/src/value-sizeof.c Examining data/avro-c-1.9.0/src/value-read.c Examining data/avro-c-1.9.0/src/dump.c Examining data/avro-c-1.9.0/src/datafile.c Examining data/avro-c-1.9.0/src/avromod.c Examining data/avro-c-1.9.0/src/generic.c Examining data/avro-c-1.9.0/src/value-hash.c Examining data/avro-c-1.9.0/src/avro/generic.h Examining data/avro-c-1.9.0/src/avro/legacy.h Examining data/avro-c-1.9.0/src/avro/allocation.h Examining data/avro-c-1.9.0/src/avro/data.h Examining data/avro-c-1.9.0/src/avro/msinttypes.h Examining data/avro-c-1.9.0/src/avro/errors.h Examining data/avro-c-1.9.0/src/avro/schema.h Examining data/avro-c-1.9.0/src/avro/msstdint.h Examining data/avro-c-1.9.0/src/avro/value.h Examining data/avro-c-1.9.0/src/avro/consumer.h Examining data/avro-c-1.9.0/src/avro/io.h Examining data/avro-c-1.9.0/src/avro/resolver.h Examining data/avro-c-1.9.0/src/avro/refcount.h Examining data/avro-c-1.9.0/src/avro/basics.h Examining data/avro-c-1.9.0/src/avro/platform.h Examining data/avro-c-1.9.0/src/datum_read.c Examining data/avro-c-1.9.0/src/encoding_binary.c Examining data/avro-c-1.9.0/src/map.c Examining data/avro-c-1.9.0/src/schema_specific.c Examining data/avro-c-1.9.0/src/datum_validate.c Examining data/avro-c-1.9.0/src/avroappend.c Examining data/avro-c-1.9.0/src/wrapped-buffer.c Examining data/avro-c-1.9.0/src/memoize.c Examining data/avro-c-1.9.0/src/allocation.c Examining data/avro-c-1.9.0/src/avro_private.h Examining data/avro-c-1.9.0/src/consume-binary.c Examining data/avro-c-1.9.0/src/consumer.c Examining data/avro-c-1.9.0/src/value.c Examining data/avro-c-1.9.0/src/value-json.c Examining data/avro-c-1.9.0/src/schema_equal.c Examining data/avro-c-1.9.0/src/schema.c Examining data/avro-c-1.9.0/src/errors.c FINAL RESULTS: data/avro-c-1.9.0/src/avro_private.h:37: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 _snprintf data/avro-c-1.9.0/src/avro_private.h:37:18: [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 _snprintf data/avro-c-1.9.0/src/avropipe.c:46:2: [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. snprintf(buf, sizeof(buf), "%" PRIsz, index); data/avro-c-1.9.0/src/errors.c:115:2: [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. vsnprintf(avro_get_error_data()->AVRO_CURRENT_ERROR, AVRO_ERROR_SIZE, fmt, args); data/avro-c-1.9.0/src/errors.c:132:23: [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. int bytes_written = vsnprintf(ERROR_DATA->AVRO_OTHER_ERROR, AVRO_ERROR_SIZE, fmt, args); data/avro-c-1.9.0/src/resolved-reader.c:41:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); \ data/avro-c-1.9.0/src/resolved-writer.c:41:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); \ data/avro-c-1.9.0/src/resolver.c:38:22: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define debug(...) { fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); } data/avro-c-1.9.0/src/schema.c:778:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(full_name, "%s.%s", namespace, name); data/avro-c-1.9.0/src/schema.c:1778:2: [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. snprintf(size, sizeof(size), "%" PRId64, fixed->size); data/avro-c-1.9.0/src/string.c:35:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); \ data/avro-c-1.9.0/tests/test_avro_1034.c:93:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( msg ":\n %s\n", avro_strerror()); \ data/avro-c-1.9.0/tests/test_avro_968.c:26:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, msg ":\n %s\n", avro_strerror()); \ data/avro-c-1.9.0/tests/test_avro_984.c:96:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( msg ":\n %s\n", avro_strerror()); \ data/avro-c-1.9.0/tests/test_avro_values.c:52:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, data/avro-c-1.9.0/tests/test_avro_values.c:136:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, \ data/avro-c-1.9.0/tests/test_avro_values.c:286:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, msg ":\n %s\n", avro_strerror()); \ data/avro-c-1.9.0/tests/test_avro_values.c:1082:4: [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. snprintf(key, 64, "%" PRIsz, j); data/avro-c-1.9.0/src/avromod.c:134:15: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt_long(argc, argv, "b:c:", longopts, NULL)) != -1) { data/avro-c-1.9.0/src/avropipe.c:404:15: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt_long(argc, argv, "s:", longopts, NULL) ) != -1) { data/avro-c-1.9.0/src/datafile.c:65:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/avro-c-1.9.0/tests/performance.c:46:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/avro-c-1.9.0/tests/test_avro_data.c:67:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c:68:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand( (unsigned)time( NULL ) ); data/avro-c-1.9.0/tests/test_avro_schema.c:273:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *srcdir = getenv("srcdir"); data/avro-c-1.9.0/tests/test_avro_values.c:83:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/avro-c-1.9.0/examples/quickstop.c:139:2: [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[15] = {0}; data/avro-c-1.9.0/examples/quickstop.c:158:3: [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)", (int)i); data/avro-c-1.9.0/src/allocation.c:85: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(new_str, str, str_size); data/avro-c-1.9.0/src/allocation.c:98: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(new_str, str, size); data/avro-c-1.9.0/src/avrocat.c:41:8: [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). fp = fopen(filename, "rb"); data/avro-c-1.9.0/src/avropipe.c:45: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. static char buf[100]; data/avro-c-1.9.0/src/codec.c:128: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(c->block_data+outlen, &crc, 4); data/avro-c-1.9.0/src/datafile.c:37:2: [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 sync[16]; data/avro-c-1.9.0/src/datafile.c:48:2: [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 sync[16]; data/avro-c-1.9.0/src/datafile.c:54:2: [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 schema_buf[64 * 1024]; data/avro-c-1.9.0/src/datafile.c:114:8: [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). fp = fopen(path, mode); data/avro-c-1.9.0/src/datafile.c:250:2: [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 magic[4]; data/avro-c-1.9.0/src/datafile.c:287: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 codec_name[11]; data/avro-c-1.9.0/src/datafile.c:336:7: [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). fp = fopen(path, "r+b"); data/avro-c-1.9.0/src/datafile.c:548:7: [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). fp = fopen(path, "rb"); data/avro-c-1.9.0/src/datafile.c:692:2: [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 sync[16]; data/avro-c-1.9.0/src/datafile.c:725:2: [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 sync[16]; data/avro-c-1.9.0/src/datum.c:163: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(bytes_copy, bytes, size); data/avro-c-1.9.0/src/datum.c:204: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(bytes_copy, bytes, size); data/avro-c-1.9.0/src/datum.c:648: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(bytes_copy, bytes, size); data/avro-c-1.9.0/src/datum.c:691: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(bytes_copy, bytes, size); data/avro-c-1.9.0/src/encoding_binary.c:69:2: [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[MAX_VARINT_BUF_SIZE]; data/avro-c-1.9.0/src/errors.c:36: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 AVRO_ERROR1[AVRO_ERROR_SIZE]; data/avro-c-1.9.0/src/errors.c:37: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 AVRO_ERROR2[AVRO_ERROR_SIZE]; data/avro-c-1.9.0/src/generic.c:2425: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(vself, buf, size); data/avro-c-1.9.0/src/io.c:51:2: [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/avro-c-1.9.0/src/io.c:195: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(buf, reader->buf + reader->read, len); data/avro-c-1.9.0/src/io.c:217:4: [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(p, reader->cur, bytes_available(reader)); data/avro-c-1.9.0/src/io.c:230: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(p, reader->cur, needed); data/avro-c-1.9.0/src/io.c:234: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(p, reader->cur, bytes_available(reader)); data/avro-c-1.9.0/src/io.c:254: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(p, reader->cur, needed); data/avro-c-1.9.0/src/io.c:335: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((void *)(writer->buf + writer->written), buf, len); data/avro-c-1.9.0/src/schema.c:1766:2: [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 size[16]; data/avro-c-1.9.0/src/schema_specific.c:201:2: [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[1024]; data/avro-c-1.9.0/src/schema_specific.c:210:15: [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). ctx.header = fopen(buf, "w"); data/avro-c-1.9.0/src/schema_specific.c:215:15: [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). ctx.source = fopen(buf, "w"); data/avro-c-1.9.0/src/st.c:144: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 *f = fopen("/tmp/col", "w"); data/avro-c-1.9.0/src/string.c:209:4: [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->wrapped.buf, orig.buf, to_copy); data/avro-c-1.9.0/src/string.c:223: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((void *) str->wrapped.buf, src, length); data/avro-c-1.9.0/src/string.c:238: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((char *) str->wrapped.buf + str->wrapped.size, src, length); data/avro-c-1.9.0/src/string.c:248: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((void *) str->wrapped.buf, src, length+1); data/avro-c-1.9.0/src/string.c:263: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((char *) str->wrapped.buf + str->wrapped.size - 1, src, length+1); data/avro-c-1.9.0/src/wrapped-buffer.c:76: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((void *) dest->buf, buf, length); data/avro-c-1.9.0/src/wrapped-buffer.c:98: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(dest, src, sizeof(avro_wrapped_buffer_t)); data/avro-c-1.9.0/tests/generate_interop_data.c:28:2: [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 outpath[128]; data/avro-c-1.9.0/tests/generate_interop_data.c:30:2: [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 jsontext[16 * 1024]; data/avro-c-1.9.0/tests/generate_interop_data.c:50:7: [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). fp = fopen(argv[1], "r"); data/avro-c-1.9.0/tests/msdirent.h:156:4: [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 d_name[MAX_PATH + 1]; /* File name */ data/avro-c-1.9.0/tests/msdirent.h:168:4: [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 patt[MAX_PATH + 3]; /* Initial directory name */ data/avro-c-1.9.0/tests/performance.c:126: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. static char buf[4096]; data/avro-c-1.9.0/tests/performance.c:209: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. static char buf[4096]; data/avro-c-1.9.0/tests/performance.c:313: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. static char buf[4096]; data/avro-c-1.9.0/tests/performance.c:392: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. static char buf[4096]; data/avro-c-1.9.0/tests/test_avro_1034.c:349:9: [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). fid = fopen( raw_binary_file_name, "w+"); data/avro-c-1.9.0/tests/test_avro_1379.c:75: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. static char buf[4096]; data/avro-c-1.9.0/tests/test_avro_1691.c:43:24: [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. static char buf[4096]; data/avro-c-1.9.0/tests/test_avro_1691.c:49:17: [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 outpath[64]; data/avro-c-1.9.0/tests/test_avro_984.c:273:9: [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). fid = fopen( raw_binary_file_name, "w+"); data/avro-c-1.9.0/tests/test_avro_984.c:324:9: [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). fid = fopen( raw_binary_file_name, "r" ); data/avro-c-1.9.0/tests/test_avro_data.c:25: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 buf[4096]; data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c:47:2: [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 error_message[THREAD_ERROR_BUFFER_SIZE]; data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c:116:2: [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 first_error_buffer[1024] = ""; data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c:117:2: [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 second_error_buffer[1024] = ""; data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c:118:2: [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 full_error_buffer[1024] = ""; data/avro-c-1.9.0/tests/test_avro_schema.c:35:2: [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 jsontext[4096]; data/avro-c-1.9.0/tests/test_avro_schema.c:36:2: [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 jsontext2[4096]; data/avro-c-1.9.0/tests/test_avro_schema.c:38:2: [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 filepath[1024]; data/avro-c-1.9.0/tests/test_avro_schema.c:62:9: [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). fp = fopen(filepath, "r"); data/avro-c-1.9.0/tests/test_avro_schema.c:274:2: [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 path[1024]; data/avro-c-1.9.0/tests/test_avro_values.c:294: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. static char buf[4096]; data/avro-c-1.9.0/tests/test_avro_values.c:1081:4: [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 key[64]; data/avro-c-1.9.0/src/allocation.c:83: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 str_size = strlen(str)+1; data/avro-c-1.9.0/src/avro/data.h:348: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). (avro_wrapped_buffer_new((dest), (str), strlen((str))+1)) data/avro-c-1.9.0/src/avro/data.h:366:50: [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). (avro_wrapped_buffer_new_copy((dest), (str), strlen((str))+1)) data/avro-c-1.9.0/src/avropipe.c:139: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). print_bytes_value(symbol_name, strlen(symbol_name)); data/avro-c-1.9.0/src/datafile.c:93:58: [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). check(rval, enc->write_bytes(w->writer, w->codec->name, strlen(w->codec->name))); data/avro-c-1.9.0/src/datafile.c:299:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(codec_name, (const char *) buf, size < 10 ? size : 10); data/avro-c-1.9.0/src/datum.c:84: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). int64_t sz = strlen(str)+1; data/avro-c-1.9.0/src/datum.c:135: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). int64_t size = strlen(p)+1; data/avro-c-1.9.0/src/datum_value.c:247: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). *size = strlen(value)+1; data/avro-c-1.9.0/src/datum_value.c:264:7: [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). sz = strlen(str); data/avro-c-1.9.0/src/encoding_binary.c:196: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). int64_t len = strlen(s); data/avro-c-1.9.0/src/encoding_binary.c:202: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). int64_t len = strlen(s); data/avro-c-1.9.0/src/errors.c:140:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&ERROR_DATA->AVRO_OTHER_ERROR[bytes_written], ERROR_DATA->AVRO_CURRENT_ERROR, data/avro-c-1.9.0/src/io.c:64:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int64_t read; data/avro-c-1.9.0/src/io.c:190:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((reader->len - reader->read) < len) { data/avro-c-1.9.0/src/io.c:195:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memcpy(buf, reader->buf + reader->read, len); data/avro-c-1.9.0/src/io.c:280:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((reader->len - reader->read) < len) { data/avro-c-1.9.0/src/io.c:410:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). avro_reader_to_memory(reader)->read); data/avro-c-1.9.0/src/schema.c:53:9: [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). len = strlen(name); data/avro-c-1.9.0/src/schema.c:777:30: [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). full_name = avro_str_alloc(strlen(name) + strlen(namespace) + 2); data/avro-c-1.9.0/src/schema.c:777: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). full_name = avro_str_alloc(strlen(name) + strlen(namespace) + 2); data/avro-c-1.9.0/src/schema.c:962:9: [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(namespace) == 0) { data/avro-c-1.9.0/src/schema.c:1062:9: [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(namespace) == 0) { data/avro-c-1.9.0/src/schema.c:1199:9: [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(namespace) == 0) { data/avro-c-1.9.0/src/schema.c:1684: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). return avro_write(out, (char *)str, strlen(str)); data/avro-c-1.9.0/src/string.c:246:19: [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 = strlen(src); data/avro-c-1.9.0/src/string.c:261:19: [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 = strlen(src); data/avro-c-1.9.0/src/value-hash.c:244:41: [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). element = hash_buffer(element, key, strlen(key)); data/avro-c-1.9.0/tests/msdirent.h:183:40: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). # define DIRENT_STRNCPY(dest,src,size) strncpy((dest),(src),(size)) data/avro-c-1.9.0/tests/msdirent.h:208:8: [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 (dirname) + 3 >= MAX_PATH) { data/avro-c-1.9.0/tests/msdirent.h:301:30: [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). dirp->curentry.d_namlen = strlen (dirp->curentry.d_name); data/avro-c-1.9.0/tests/performance.c:132: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). avro_schema_from_json(schema_json, strlen(schema_json), data/avro-c-1.9.0/tests/performance.c:215: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). avro_schema_from_json(schema_json, strlen(schema_json), data/avro-c-1.9.0/tests/performance.c:319: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). avro_schema_from_json(schema_json, strlen(schema_json), data/avro-c-1.9.0/tests/performance.c:399: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). avro_schema_from_json(schema_json, strlen(schema_json), data/avro-c-1.9.0/tests/test_avro_1165.c:65: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). rval = avro_schema_from_json(json, strlen(json), &schema, &error); data/avro-c-1.9.0/tests/test_avro_1167.c:63: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). rval = avro_schema_from_json(json, strlen(json), &schema, &error); data/avro-c-1.9.0/tests/test_avro_1379.c:83:49: [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). check(rval, avro_schema_from_json(schema_json, strlen(schema_json), &schema, &error)); data/avro-c-1.9.0/tests/test_avro_1691.c:53:64: [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). check(rval, avro_schema_from_json(json_schema, strlen(json_schema), data/avro-c-1.9.0/tests/test_avro_766.c:49: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). rval = avro_schema_from_json(json, strlen(json), &schema, &error); data/avro-c-1.9.0/tests/test_avro_data.c:405:30: [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). avro_schema_from_json(json, strlen(json), &schema, &error); data/avro-c-1.9.0/tests/test_avro_errors_are_thread_safe.c:29:30: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. #define SLEEP_MILLIS(millis) usleep( millis * 1000 ) data/avro-c-1.9.0/tests/test_avro_schema_names.c:35: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). rc = avro_schema_from_json(json, strlen(json), &base, &serror); data/avro-c-1.9.0/tests/test_avro_values.c:765: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). if (actual_size != strlen(strings[i])+1) { data/avro-c-1.9.0/tests/test_avro_values.c:779:20: [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 (wbuf.size != strlen(strings[i])+1) { data/avro-c-1.9.0/tests/test_avro_values.c:793: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). size_t str_length = strlen(strings[i])+1; data/avro-c-1.9.0/tests/test_avro_values.c:802: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). if (actual_size != strlen(strings[i])+1) { data/avro-c-1.9.0/tests/test_avro_values.c:815:20: [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 (wbuf.size != strlen(strings[i])+1) { ANALYSIS SUMMARY: Hits = 145 Lines analyzed = 35433 in approximately 0.89 seconds (39959 lines/second) Physical Source Lines of Code (SLOC) = 25749 Hits@level = [0] 440 [1] 48 [2] 71 [3] 8 [4] 18 [5] 0 Hits@level+ = [0+] 585 [1+] 145 [2+] 97 [3+] 26 [4+] 18 [5+] 0 Hits/KSLOC@level+ = [0+] 22.7193 [1+] 5.63129 [2+] 3.76714 [3+] 1.00975 [4+] 0.699056 [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.