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/caml-crush-1.0.10/src/bindings-pkcs11/PRESENT_tables.h Examining data/caml-crush-1.0.10/src/bindings-pkcs11/helpers_pkcs11.h Examining data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h Examining data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h Examining data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_aliasing.h Examining data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.c Examining data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.h Examining data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c Examining data/caml-crush-1.0.10/src/client-lib/modwrap.c Examining data/caml-crush-1.0.10/src/client-lib/modwrap.h Examining data/caml-crush-1.0.10/src/client-lib/modwrap_camlrpc.c Examining data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c Examining data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c Examining data/caml-crush-1.0.10/src/client-lib/pkcs11_rpc.h Examining data/caml-crush-1.0.10/src/tests/c-based/main-shared.c FINAL RESULTS: data/caml-crush-1.0.10/src/bindings-pkcs11/helpers_pkcs11.h:404:2: [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(#name string, __VA_ARGS__);\ data/caml-crush-1.0.10/src/bindings-pkcs11/helpers_pkcs11.h:418:3: [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(#name": Succeed ");\ data/caml-crush-1.0.10/src/bindings-pkcs11/helpers_pkcs11.h:419:3: [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(string, __VA_ARGS__);\ data/caml-crush-1.0.10/src/bindings-pkcs11/helpers_pkcs11.h:422:3: [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(#name": Error ");\ data/caml-crush-1.0.10/src/bindings-pkcs11/helpers_pkcs11.h:424:3: [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(string, __VA_ARGS__);\ data/caml-crush-1.0.10/src/client-lib/modwrap.c:358:2: [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/caml-crush-1.0.10/src/client-lib/modwrap.c:376:5: [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, MODNAME"mygetline: lineptr is NULL\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:380:5: [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, MODNAME"mygetline: stream is NULL\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:389:7: [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, MODNAME"mygetline: line is > to %d\n", MAX_LIBNAME_LEN); data/caml-crush-1.0.10/src/client-lib/modwrap.c:416:9: [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, MODNAME"get_libname_from_file: HOME variable not found\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:424:9: [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, MODNAME"get_libname_from_file: malloc failed\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:435:9: [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/caml-crush-1.0.10/src/client-lib/modwrap.c:442:9: [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, MODNAME"get_libname_from_file: LIBNAME could not be read\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:504: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, MODNAME"Init failed, could not find a LIBNAME\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:525:5: [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, MODNAME"C_SetupArch: failed detecting architecture\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:532:7: [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/caml-crush-1.0.10/src/client-lib/modwrap.c:538:5: [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/caml-crush-1.0.10/src/client-lib/modwrap.c:542:5: [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, MODNAME"C_LoadModule: failed loading PKCS#11 module %s (builtin)\n", data/caml-crush-1.0.10/src/client-lib/modwrap.c:546:5: [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, MODNAME"Init failed\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:742:5: [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, MODNAME"\nC_WaitForSlotEvent called with non block\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:754:5: [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, MODNAME"\nC_WaitForSlotEvent called with block, return\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:782:2: [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, MODNAME"\nC_WaitForSlotEvent NO EVENT, keep BLOCKING\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:789:2: [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, MODNAME"\nC_WaitForSlotEvent GOT EVENT\n"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:1815:5: [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/caml-crush-1.0.10/src/client-lib/modwrap.c:1821: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, MODNAME"Got ppFunctionList = 0x%p\n", (void *)(&function_list)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.c:178:19: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. module_handle = LoadLibrary(libname); data/caml-crush-1.0.10/src/client-lib/modwrap.c:97:3: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(mymutex); data/caml-crush-1.0.10/src/client-lib/modwrap.c:101:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(mymutex); data/caml-crush-1.0.10/src/client-lib/modwrap.c:414:12: [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. home = getenv("HOME"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:490:13: [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. libname = getenv(ENV_LIBNAME); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:477:21: [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. env_socket_path = getenv(ENV_SOCKET_PATH_NAME); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:550:26: [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. env_timeout_override = getenv(ENV_RPC_TIMEOUT); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:300:18: [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. ca_file_path = getenv(xstr(PKCS11PROXY_CA_FILE)); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:301:20: [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. cert_file_path = getenv(xstr(PKCS11PROXY_CERT_FILE)); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:302:22: [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. private_key_path = getenv(xstr(PKCS11PROXY_PRIVKEY_FILE)); data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:198:12: [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 manufacturer_id[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:200:12: [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 library_description[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:215:12: [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 slot_description[64]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:216:12: [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 manufacturer_id[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:231:12: [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 label[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:232:12: [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 manufacturer_id[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:233:12: [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 model[16]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:234:12: [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 serial_number[16]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:248:12: [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 utc_time[16]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:469:12: [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 year[4]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:470:12: [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 month[2]; data/caml-crush-1.0.10/src/bindings-pkcs11/original_pkcs11.h:471:12: [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 day[2]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:194:12: [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 manufacturer_id[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:196:12: [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 library_description[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:205:12: [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 slot_description[64]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:206:12: [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 manufacturer_id[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:213:12: [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 label[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:214:12: [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 manufacturer_id[32]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:215:12: [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 model[16]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:216:12: [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 serial_number[16]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:230:12: [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 utc_time[16]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:265:12: [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 year[4]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:266:12: [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 month[2]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11.h:267:12: [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 day[2]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_aliasing.h:102:12: [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 input[sizeof(u64)] = { 0 }; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_aliasing.h:103:12: [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 output[sizeof(u64)] = { 0 }; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_aliasing.h:107: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(input, &in, sizeof(in)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_aliasing.h:112:14: [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 key[PRESENT128_KEY_SIZE] = { 0 }; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_aliasing.h:115:20: [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_rand = fopen(RANDSOURCE, "r"); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.c:791:12: [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 tmp_label[33]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.c:818: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(tmp_label, label, 32); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.c:820: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(tmp_label, label, strnlen((char *)label, 32)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_functions.c:3167: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(output, data, data_size); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:970:12: [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 buff[sizeof(uint64_t)]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:4143:12: [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 tmp_buff[MAX_BUFF_LEN]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:4328:12: [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 tmp_buff[MAX_BUFF_LEN]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:4427:12: [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 tmp_buff[MAX_BUFF_LEN]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:4512:12: [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 tmp_buff[MAX_BUFF_LEN]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:4567:12: [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 tmp_buff[MAX_BUFF_LEN]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:4647:12: [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 tmp_buff[MAX_BUFF_LEN]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5618:12: [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 tmp[8]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5652:12: [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 tmp[8]; data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5686: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(out->value, in->value, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5698: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(out->value, in->value, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5710: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(out->value, in->value, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5722: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(out->value, in->value, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5734: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(out->value, in->value, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5746: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(out->value, in->value, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5759: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(out->value, &to_send32, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5772: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(out->value, &to_send32, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5785: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(out->value, &to_send64, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5798: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(out->value, &to_send64, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5812: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(out->value, &to_send32, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5826: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(out->value, &to_send64, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5840: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(out->value, &to_send64, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5854: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(out->value, &to_send32, sizeof(uint32_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5868: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(out->value, &to_send64, sizeof(uint64_t)); data/caml-crush-1.0.10/src/bindings-pkcs11/pkcs11_stubs.c:5882: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(out->value, &to_send32, sizeof(uint32_t)); data/caml-crush-1.0.10/src/client-lib/modwrap.c:433: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(file_path, "r"); data/caml-crush-1.0.10/src/client-lib/modwrap.c:468: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 libname_file[32] = {0}; data/caml-crush-1.0.10/src/client-lib/modwrap.h:176: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(output2, elem->out, elem->out_len);\ data/caml-crush-1.0.10/src/client-lib/modwrap.h:192: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(elem->out, ret.c_ ## operation_type ## _value.c_ ## operation_type ## _value_val,\ data/caml-crush-1.0.10/src/client-lib/modwrap.h:224: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(output2, ret.c_ ## operation_type ## _value.c_ ## operation_type ## _value_val,\ data/caml-crush-1.0.10/src/client-lib/modwrap.h:296: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 ct_mcall[MCALL_MSG_SIZE]; data/caml-crush-1.0.10/src/client-lib/modwrap.h:343: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 ct_mcall[MCALL_MSG_SIZE]; /* marshalled callmsg */ data/caml-crush-1.0.10/src/client-lib/modwrap_camlrpc.c:243: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 *dummy_init_args[2] = { (char *)"client-pkcs11", (char *)0 }; data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:90: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(&(out->major), (in->major.major_val), in->major.major_len); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:91: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(&(out->minor), (in->minor.minor_val), in->minor.minor_len); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:101: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(out->manufacturer_id, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:105: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(out->library_description, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:123: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(out->slot_description, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:128: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(out->manufacturer_id, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:149: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(out->label, in->rpc_ck_token_info_label.rpc_ck_token_info_label_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:151: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(out->manufacturer_id, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:156: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(out->model, in->rpc_ck_token_info_model.rpc_ck_token_info_model_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:158: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(out->serial_number, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:178: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(out->utc_time, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:199: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(out->parameter, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:244: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(out->value, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:273: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(out->year, in->rpc_ck_date_year.rpc_ck_date_year_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:275: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(out->month, in->rpc_ck_date_month.rpc_ck_date_month_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:277: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(out->day, in->rpc_ck_date_day.rpc_ck_date_day_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:295: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(out->rpc_ck_attribute_value.rpc_ck_attribute_value_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:349: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(out->rpc_ck_mechanism_parameter.rpc_ck_mechanism_parameter_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:406:7: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(hp->h_addr, (caddr_t) & serv_addr->sin_addr, hp->h_length); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:411:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). port = (unsigned short)atoi(token); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:556:21: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). timeout_value = atol(env_timeout_override); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:1936: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(output2, ret.c_GenerateRandom_data.c_GenerateRandom_data_val, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:180:32: [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. tmp_bio = BIO_new_mem_buf((char *)cert_pem_list[i], -1); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:241:37: [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. ca_file_mem[i].data = (unsigned char *)(ca_file_buff[i]); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:272:43: [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. ca_file_mem_bio[i] = BIO_new_mem_buf((char *)(ca_file_buff[i]), -1); data/caml-crush-1.0.10/src/tests/c-based/main-shared.c:96: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). if ((fp = fopen(argv[2], "r")) == NULL) { data/caml-crush-1.0.10/src/tests/c-based/main-shared.c:199:12: [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 buff[50] = { 0 }; data/caml-crush-1.0.10/src/tests/c-based/main-shared.c:325:12: [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 signed_data2[4] = { 0 }; data/caml-crush-1.0.10/src/client-lib/modwrap.c:383:7: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(stream); data/caml-crush-1.0.10/src/client-lib/modwrap.c:393:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(stream); data/caml-crush-1.0.10/src/client-lib/modwrap.c:421: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). file_path_len = home_len + strlen(LIBNAME_FILE_NAME) + 2; data/caml-crush-1.0.10/src/client-lib/modwrap.c:429:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(file_path, home, home_len); data/caml-crush-1.0.10/src/client-lib/modwrap.c:430:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(file_path+home_len, "/", 1); data/caml-crush-1.0.10/src/client-lib/modwrap.c:431:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(file_path+home_len+1, LIBNAME_FILE_NAME, strlen(LIBNAME_FILE_NAME)); data/caml-crush-1.0.10/src/client-lib/modwrap.c:431:54: [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). strncat(file_path+home_len+1, LIBNAME_FILE_NAME, strlen(LIBNAME_FILE_NAME)); data/caml-crush-1.0.10/src/client-lib/modwrap.c:761:7: [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. usleep(50000); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:389:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(copy, socket_path, strnlen(socket_path, MAX_HOSTNAME_LEN)); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:481:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(serv_addr->sun_path, env_socket_path, data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:488:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(serv_addr->sun_path, xstr(SOCKET_PATH), data/caml-crush-1.0.10/src/client-lib/modwrap_crpc.c:679: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). module.opaque_data_len = strlen(libname); data/caml-crush-1.0.10/src/client-lib/modwrap_crpc_ssl.c:139: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). tmp_cert_pem.size = strlen(cert_pem_list[i]); ANALYSIS SUMMARY: Hits = 142 Lines analyzed = 26398 in approximately 0.62 seconds (42241 lines/second) Physical Source Lines of Code (SLOC) = 21420 Hits@level = [0] 528 [1] 13 [2] 94 [3] 10 [4] 25 [5] 0 Hits@level+ = [0+] 670 [1+] 142 [2+] 129 [3+] 35 [4+] 25 [5+] 0 Hits/KSLOC@level+ = [0+] 31.2792 [1+] 6.62932 [2+] 6.02241 [3+] 1.63399 [4+] 1.16713 [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.