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/chicken-5.2.0/core.c Examining data/chicken-5.2.0/chicken.format.import.c Examining data/chicken-5.2.0/chicken.repl.import.c Examining data/chicken-5.2.0/chicken.errno.import.c Examining data/chicken-5.2.0/expand.c Examining data/chicken-5.2.0/chicken.gc.import.c Examining data/chicken-5.2.0/stub.c Examining data/chicken-5.2.0/pathname.c Examining data/chicken-5.2.0/chicken.continuation.import.c Examining data/chicken-5.2.0/chicken.memory.representation.import.c Examining data/chicken-5.2.0/chicken.string.import.c Examining data/chicken-5.2.0/chicken.eval.import.c Examining data/chicken-5.2.0/chicken-ffi-syntax.c Examining data/chicken-5.2.0/chicken.internal.import.c Examining data/chicken-5.2.0/support.c Examining data/chicken-5.2.0/chicken.file.posix.import.c Examining data/chicken-5.2.0/posixwin.c Examining data/chicken-5.2.0/chicken-status.c Examining data/chicken-5.2.0/chicken.irregex.import.c Examining data/chicken-5.2.0/c-backend.c Examining data/chicken-5.2.0/lfa2.c Examining data/chicken-5.2.0/file.c Examining data/chicken-5.2.0/tcp.c Examining data/chicken-5.2.0/chicken.pathname.import.c Examining data/chicken-5.2.0/repl.c Examining data/chicken-5.2.0/scrutinizer.c Examining data/chicken-5.2.0/port.c Examining data/chicken-5.2.0/chicken.file.import.c Examining data/chicken-5.2.0/scheduler.c Examining data/chicken-5.2.0/chicken.fixnum.import.c Examining data/chicken-5.2.0/chicken.flonum.import.c Examining data/chicken-5.2.0/chicken.foreign.import.c Examining data/chicken-5.2.0/chicken.blob.import.c Examining data/chicken-5.2.0/chicken-install.c Examining data/chicken-5.2.0/optimizer.c Examining data/chicken-5.2.0/batch-driver.c Examining data/chicken-5.2.0/eval.c Examining data/chicken-5.2.0/compiler-syntax.c Examining data/chicken-5.2.0/chicken.h Examining data/chicken-5.2.0/eval-modules.c Examining data/chicken-5.2.0/irregex.c Examining data/chicken-5.2.0/tests/embedded1.c Examining data/chicken-5.2.0/tests/embedded3.c Examining data/chicken-5.2.0/chicken-profile.c Examining data/chicken-5.2.0/csi.c Examining data/chicken-5.2.0/csc.c Examining data/chicken-5.2.0/profiler.c Examining data/chicken-5.2.0/continuation.c Examining data/chicken-5.2.0/chicken-syntax.c Examining data/chicken-5.2.0/posixunix.c Examining data/chicken-5.2.0/chicken.tcp.import.c Examining data/chicken-5.2.0/chicken-uninstall.c Examining data/chicken-5.2.0/chicken.process-context.import.c Examining data/chicken-5.2.0/chicken.plist.import.c Examining data/chicken-5.2.0/read-syntax.c Examining data/chicken-5.2.0/internal.c Examining data/chicken-5.2.0/srfi-4.c Examining data/chicken-5.2.0/chicken.syntax.import.c Examining data/chicken-5.2.0/chicken.compiler.user-pass.import.c Examining data/chicken-5.2.0/chicken.keyword.import.c Examining data/chicken-5.2.0/chicken.sort.import.c Examining data/chicken-5.2.0/user-pass.c Examining data/chicken-5.2.0/lolevel.c Examining data/chicken-5.2.0/chicken.random.import.c Examining data/chicken-5.2.0/build-version.c Examining data/chicken-5.2.0/chicken.time.posix.import.c Examining data/chicken-5.2.0/chicken.time.import.c Examining data/chicken-5.2.0/chicken.c Examining data/chicken-5.2.0/chicken.base.import.c Examining data/chicken-5.2.0/runtime.c Examining data/chicken-5.2.0/chicken.read-syntax.import.c Examining data/chicken-5.2.0/chicken.platform.import.c Examining data/chicken-5.2.0/library.c Examining data/chicken-5.2.0/debugger-client.c Examining data/chicken-5.2.0/chicken-do.c Examining data/chicken-5.2.0/chicken.load.import.c Examining data/chicken-5.2.0/data-structures.c Examining data/chicken-5.2.0/chicken.process-context.posix.import.c Examining data/chicken-5.2.0/chicken.io.import.c Examining data/chicken-5.2.0/chicken.process.import.c Examining data/chicken-5.2.0/chicken.pretty-print.import.c Examining data/chicken-5.2.0/srfi-4.import.c Examining data/chicken-5.2.0/chicken.memory.import.c Examining data/chicken-5.2.0/chicken.condition.import.c Examining data/chicken-5.2.0/chicken.locative.import.c Examining data/chicken-5.2.0/extras.c Examining data/chicken-5.2.0/modules.c Examining data/chicken-5.2.0/chicken.process.signal.import.c Examining data/chicken-5.2.0/chicken.csi.import.c Examining data/chicken-5.2.0/chicken.bitwise.import.c Examining data/chicken-5.2.0/chicken.port.import.c Examining data/chicken-5.2.0/dbg-stub.c Examining data/chicken-5.2.0/c-platform.c FINAL RESULTS: data/chicken-5.2.0/chicken.h:973:37: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. # define C_readlink readlink data/chicken-5.2.0/posixunix.c:217:35: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. #define C_chown(fn, u, g) C_fix(chown(C_c_string(fn), C_unfix(u), C_unfix(g))) data/chicken-5.2.0/posixunix.c:219:35: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. #define C_chmod(fn, m) C_fix(chmod(C_c_string(fn), C_unfix(m))) data/chicken-5.2.0/posixunix.c:229:35: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. #define C_do_readlink(f, b) C_fix(readlink(C_c_string(f), C_c_string(b), FILENAME_MAX)) data/chicken-5.2.0/posixwin.c:178:34: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. #define C_chmod(fn, m) C_fix(chmod(C_c_string(fn), C_unfix(m))) data/chicken-5.2.0/posixwin.c:313:21: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. else return C_fix(chmod(path, C_unfix(m))); data/chicken-5.2.0/chicken-do.c:123:5: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[ 0 ], argv); data/chicken-5.2.0/chicken.h:898:37: [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 C_snprintf snprintf data/chicken-5.2.0/chicken.h:899:37: [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. # define C_printf printf data/chicken-5.2.0/chicken.h:900:37: [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 C_fprintf fprintf data/chicken-5.2.0/chicken.h:901:37: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define C_vfprintf vfprintf data/chicken-5.2.0/chicken.h:922:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. # define C_system system data/chicken-5.2.0/chicken.h:975:37: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. # define C_access access data/chicken-5.2.0/file.c:13:36: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. #define C_test_access(fn, m) C_fix(access(C_c_string(fn), C_unfix(m))) data/chicken-5.2.0/posixunix.c:203:60: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define open_binary_input_pipe(a, n, name) C_mpointer(a, popen(C_c_string(name), "r")) data/chicken-5.2.0/posixunix.c:205:60: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define open_binary_output_pipe(a, n, name) C_mpointer(a, popen(C_c_string(name), "w")) data/chicken-5.2.0/posixunix.c:241:35: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define C_u_i_execvp(f,a) C_fix(execvp(C_c_string(f), (char *const *)C_c_pointer_vector_or_null(a))) data/chicken-5.2.0/posixwin.c:184:35: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define C_u_i_execvp(f,a) C_fix(execvp(C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a))) data/chicken-5.2.0/chicken-do.c:96:7: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. if(!CreateProcess(NULL, cmdline, NULL, NULL, TRUE, data/chicken-5.2.0/chicken-do.c:96:7: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. if(!CreateProcess(NULL, cmdline, NULL, NULL, TRUE, data/chicken-5.2.0/chicken.h:977:37: [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. # define C_getenv getenv data/chicken-5.2.0/chicken.h:3556:21: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. # define C_realpath realpath data/chicken-5.2.0/chicken.h:3563:11: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if((p = realpath(path, NULL)) == NULL) data/chicken-5.2.0/dbg-stub.c:505:16: [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 *addr = getenv("CHICKEN_DEBUGGER"); data/chicken-5.2.0/posixunix.c:628:19: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. C_r=C_fix((C_word)chroot(t0)); data/chicken-5.2.0/posixwin.c:513:12: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. success = CreateProcess( data/chicken-5.2.0/posixwin.c:513:12: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. success = CreateProcess( data/chicken-5.2.0/runtime.c:837:3: [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(C_fix(time(NULL))); data/chicken-5.2.0/runtime.c:11988:16: [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. if((handle = LoadLibrary(mname)) != NULL) { data/chicken-5.2.0/runtime.c:13333:20: [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. HMODULE mod = LoadLibrary("advapi32.dll"); data/chicken-5.2.0/chicken-do.c:49:8: [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 *targets[ MAX_TARGETS ]; data/chicken-5.2.0/chicken-do.c:50:8: [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 *depends[ MAX_DEPENDS ]; data/chicken-5.2.0/chicken-do.c:82:10: [2] (buffer) TCHAR: 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 TCHAR cmdline[ MAX_COMMAND_LEN ]; data/chicken-5.2.0/chicken.h:874:37: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define C_memcpy memcpy data/chicken-5.2.0/chicken.h:894:37: [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). # define C_fopen fopen data/chicken-5.2.0/chicken.h:1276:58: [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. #define C_peek_byte(ptr, i) C_fix(((unsigned char *)C_u_i_car(ptr))[ C_unfix(i) ]) data/chicken-5.2.0/chicken.h:1421:58: [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. #define C_u_i_u8vector_ref(x, i) C_fix(((unsigned char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) data/chicken-5.2.0/chicken.h:1422:56: [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. #define C_u_i_s8vector_ref(x, i) C_fix(((signed char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) data/chicken-5.2.0/chicken.h:1436:54: [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. #define C_u_i_u8vector_set(x, i, v) ((((unsigned char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_unfix(v)), C_SCHEME_UNDEFINED) data/chicken-5.2.0/chicken.h:1437:52: [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. #define C_u_i_s8vector_set(x, i, v) ((((signed char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_unfix(v)), C_SCHEME_UNDEFINED) data/chicken-5.2.0/dbg-stub.c:106:8: [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 input_buffer[ INPUT_BUFFER_SIZE + 1 ]; data/chicken-5.2.0/dbg-stub.c:109:8: [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 rw_buffer[ RW_BUFFER_SIZE + 1 ]; data/chicken-5.2.0/dbg-stub.c:413:70: [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. C_snprintf(rw_buffer, sizeof(rw_buffer), " %u", ((unsigned char *)C_data_pointer(x))[ n ]); data/chicken-5.2.0/dbg-stub.c:441: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(((C_SCHEME_BLOCK*)ptr)->data, str, n + 1); data/chicken-5.2.0/dbg-stub.c:507:10: [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 info[ 256 ]; data/chicken-5.2.0/dbg-stub.c:525:12: [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 = atoi(addr + i + 1); data/chicken-5.2.0/eval.c:28:55: [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. #define C_copy_result_string(str, buf, n) (C_memcpy((char *)C_block_item(buf, 0), C_c_string(str), C_unfix(n)), ((char *)C_block_item(buf, 0))[ C_unfix(n) ] = '\0', C_SCHEME_TRUE) data/chicken-5.2.0/eval.c:28:116: [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. #define C_copy_result_string(str, buf, n) (C_memcpy((char *)C_block_item(buf, 0), C_c_string(str), C_unfix(n)), ((char *)C_block_item(buf, 0))[ C_unfix(n) ] = '\0', C_SCHEME_TRUE) data/chicken-5.2.0/posixunix.c:87:8: [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 C_time_string [TIME_STRING_MAXLENGTH + 1]; data/chicken-5.2.0/posixunix.c:282:35: [2] (misc) open: 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). #define C_open(fn, fl, m) C_fix(open(C_c_string(fn), C_unfix(fl), C_unfix(m))) data/chicken-5.2.0/posixunix.c:285:35: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). #define C_mkstemp(t) C_fix(mkstemp(C_c_string(t))) data/chicken-5.2.0/posixwin.c:87:8: [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 C_time_string [TIME_STRING_MAXLENGTH + 1]; data/chicken-5.2.0/posixwin.c:167: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. static C_TLS char C_shlcmd[256] = ""; data/chicken-5.2.0/posixwin.c:170:14: [2] (buffer) TCHAR: 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 C_TLS TCHAR C_username[255 + 1] = ""; data/chicken-5.2.0/posixwin.c:191:35: [2] (misc) open: 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). #define C_open(fn, fl, m) C_fix(open(C_c_string(fn), C_unfix(fl), C_unfix(m))) data/chicken-5.2.0/posixwin.c:202:8: [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 C_time_string [TIME_STRING_MAXLENGTH + 1]; data/chicken-5.2.0/posixwin.c:311:3: [2] (buffer) TCHAR: 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. TCHAR path[MAX_PATH]; data/chicken-5.2.0/posixwin.c:318:3: [2] (buffer) TCHAR: 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. TCHAR path[MAX_PATH]; data/chicken-5.2.0/posixwin.c:439: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. const char modes[3] = "rww"; data/chicken-5.2.0/runtime.c:5824:29: [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. return C_fix(((unsigned char *)C_data_pointer(C_block_item(v, 1)))[j]); data/chicken-5.2.0/runtime.c:5843:27: [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. return C_fix(((signed char *)C_data_pointer(C_block_item(v, 1)))[j]); data/chicken-5.2.0/runtime.c:6274: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 *)C_data_pointer(C_block_item(v, 1)))[j] = n; data/chicken-5.2.0/runtime.c:6299: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. ((signed char *)C_data_pointer(C_block_item(v, 1)))[j] = n; data/chicken-5.2.0/runtime.c:7454:72: [2] (misc) open: 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). C_regparm C_word C_fcall C_i_check_port_2(C_word x, C_word dir, C_word open, C_word loc) data/chicken-5.2.0/runtime.c:13277:10: [2] (misc) open: 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). fd = open("/dev/urandom", O_RDONLY); data/chicken-5.2.0/tcp.c:93:8: [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 addr_buffer[ 20 ]; data/chicken-5.2.0/tests/embedded3.c:19: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 buffer[ 256 ]; data/chicken-5.2.0/chicken.h:876:37: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). # define C_strncpy strncpy data/chicken-5.2.0/chicken.h:879: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). # define C_strlen strlen data/chicken-5.2.0/chicken.h:903:37: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define C_getchar getchar data/chicken-5.2.0/chicken.h:917:37: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define C_getc getc data/chicken-5.2.0/chicken.h:919:37: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define C_fgetc fgetc data/chicken-5.2.0/file.c:56: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). int name_len = strlen(name); data/chicken-5.2.0/file.c:121:113: [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). #define C_foundfile(e,b,l) (C_strlcpy(C_c_string(b), ((struct dirent *) C_block_item(e, 0))->d_name, l), C_fix(strlen(((struct dirent *) C_block_item(e, 0))->d_name))) data/chicken-5.2.0/library.c:24: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). #define C_fetch_c_strlen(b, i) C_fix(strlen((C_char *)C_block_item(b, C_unfix(i)))) data/chicken-5.2.0/library.c:25:36: [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). #define C_asciiz_strlen(str) C_fix(strlen(C_c_string(str))) data/chicken-5.2.0/library.c:144:62: [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). #define C_curdir(buf) (getcwd(C_c_string(buf), 1024) ? C_fix(strlen(C_c_string(buf))) : C_SCHEME_FALSE) data/chicken-5.2.0/posixunix.c:237:35: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). #define C_umask(m) C_fix(umask(C_unfix(m))) data/chicken-5.2.0/posixunix.c:283:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define C_read(fd, b, n) C_fix(read(C_unfix(fd), C_data_pointer(b), C_unfix(n))) data/chicken-5.2.0/posixwin.c:192:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define C_read(fd, b, n) C_fix(read(C_unfix(fd), C_data_pointer(b), C_unfix(n))) data/chicken-5.2.0/posixwin.c:374:10: [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(C_shlcmd)) data/chicken-5.2.0/posixwin.c:377:66: [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). UINT len = GetSystemDirectory(C_shlcmd, sizeof(C_shlcmd) - strlen(cmdnam)); data/chicken-5.2.0/posixwin.c:395:10: [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(C_username)) data/chicken-5.2.0/posixwin.c:479:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (p = env; *p; ++p) len += strlen(*p) + 1; data/chicken-5.2.0/posixwin.c:487: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). pb += strlen(*p) + 1; data/chicken-5.2.0/runtime.c:4973:12: [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 (n != strlen(buf)) data/chicken-5.2.0/runtime.c:10162:14: [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 (n != strlen(buf)) data/chicken-5.2.0/runtime.c:10168:14: [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 (n != strlen(fmode)) /* Shouldn't happen, but never hurts */ data/chicken-5.2.0/runtime.c:11675:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). a = C_alloc(2 + C_bytestowords(strlen(str))); data/chicken-5.2.0/runtime.c:11691:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). a = C_alloc(2 + C_bytestowords(strlen(C_MACHINE_TYPE))); data/chicken-5.2.0/runtime.c:11707:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). a = C_alloc(2 + C_bytestowords(strlen(C_SOFTWARE_TYPE))); data/chicken-5.2.0/runtime.c:11723:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). a = C_alloc(2 + C_bytestowords(strlen(C_BUILD_PLATFORM))); data/chicken-5.2.0/runtime.c:11739:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). a = C_alloc(2 + C_bytestowords(strlen(C_SOFTWARE_VERSION))); data/chicken-5.2.0/runtime.c:13283:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, C_data_pointer(buf) + off, count); data/chicken-5.2.0/scheduler.c:28:6: [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. if(usleep((useconds_t)C_num_to_uint64(ms) * 1000) == -1) return C_SCHEME_FALSE; ANALYSIS SUMMARY: Hits = 95 Lines analyzed = 698610 in approximately 26.69 seconds (26171 lines/second) Physical Source Lines of Code (SLOC) = 579688 Hits@level = [0] 27 [1] 28 [2] 37 [3] 12 [4] 12 [5] 6 Hits@level+ = [0+] 122 [1+] 95 [2+] 67 [3+] 30 [4+] 18 [5+] 6 Hits/KSLOC@level+ = [0+] 0.210458 [1+] 0.163881 [2+] 0.115579 [3+] 0.051752 [4+] 0.0310512 [5+] 0.0103504 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.