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/oaklisp-1.3.7/prebuilt/src/emulator/instr-data.c Examining data/oaklisp-1.3.7/src/emulator/cmdline.c Examining data/oaklisp-1.3.7/src/emulator/cmdline.h Examining data/oaklisp-1.3.7/src/emulator/config.h Examining data/oaklisp-1.3.7/src/emulator/data.c Examining data/oaklisp-1.3.7/src/emulator/data.h Examining data/oaklisp-1.3.7/src/emulator/gc.c Examining data/oaklisp-1.3.7/src/emulator/gc.h Examining data/oaklisp-1.3.7/src/emulator/instr.c Examining data/oaklisp-1.3.7/src/emulator/instr.h Examining data/oaklisp-1.3.7/src/emulator/loop.c Examining data/oaklisp-1.3.7/src/emulator/loop.h Examining data/oaklisp-1.3.7/src/emulator/oaklisp.c Examining data/oaklisp-1.3.7/src/emulator/signals.c Examining data/oaklisp-1.3.7/src/emulator/signals.h Examining data/oaklisp-1.3.7/src/emulator/stacks-loop.h Examining data/oaklisp-1.3.7/src/emulator/stacks.c Examining data/oaklisp-1.3.7/src/emulator/stacks.h Examining data/oaklisp-1.3.7/src/emulator/threads.c Examining data/oaklisp-1.3.7/src/emulator/threads.h Examining data/oaklisp-1.3.7/src/emulator/timers.c Examining data/oaklisp-1.3.7/src/emulator/timers.h Examining data/oaklisp-1.3.7/src/emulator/weak.c Examining data/oaklisp-1.3.7/src/emulator/weak.h Examining data/oaklisp-1.3.7/src/emulator/worldio.c Examining data/oaklisp-1.3.7/src/emulator/worldio.h Examining data/oaklisp-1.3.7/src/emulator/xmalloc.c Examining data/oaklisp-1.3.7/src/emulator/xmalloc.h FINAL RESULTS: data/oaklisp-1.3.7/src/emulator/gc.c:391: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, (st), (i)); data/oaklisp-1.3.7/src/emulator/worldio.c:233: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(wfp, control_string, 0 /*val_stk_size */ ); data/oaklisp-1.3.7/src/emulator/worldio.c:234: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(wfp, control_string, 0 /*cxt_stk_size */ ); data/oaklisp-1.3.7/src/emulator/worldio.c:235: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(wfp, control_string, contigify(e_boot_code)); data/oaklisp-1.3.7/src/emulator/worldio.c:236: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(wfp, control_string, data/oaklisp-1.3.7/src/emulator/worldio.c:247: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(wfp, control_string, theref); data/oaklisp-1.3.7/src/emulator/worldio.c:257: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(wfp, control_string, theref); data/oaklisp-1.3.7/src/emulator/worldio.c:264: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(wfp, control_string, wp_index); data/oaklisp-1.3.7/src/emulator/worldio.c:274: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(wfp, control_string, theref); data/oaklisp-1.3.7/src/emulator/cmdline.c:149:14: [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 *w = getenv("OAKWORLD"); data/oaklisp-1.3.7/src/emulator/cmdline.c:218:16: [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). dump_base = atoi(optarg); data/oaklisp-1.3.7/src/emulator/cmdline.c:228:21: [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). gc_before_dump = atoi(optarg); data/oaklisp-1.3.7/src/emulator/cmdline.c:232:36: [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). original_newspace_size = 1024 * atol(optarg); data/oaklisp-1.3.7/src/emulator/cmdline.c:236:23: [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). value_stack.size = atoi(optarg); data/oaklisp-1.3.7/src/emulator/cmdline.c:241:25: [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). context_stack.size = atoi(optarg); data/oaklisp-1.3.7/src/emulator/cmdline.c:246:23: [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). max_segment_size = atoi(optarg); data/oaklisp-1.3.7/src/emulator/cmdline.c:250:15: [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). trace_gc = atoi(optarg); data/oaklisp-1.3.7/src/emulator/loop.c:1831: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). fd = fopen(s, data/oaklisp-1.3.7/src/emulator/threads.c:120: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(register_array[my_index], register_array[info.parent_index], data/oaklisp-1.3.7/src/emulator/worldio.c:148: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). wfp = fopen(dump_file_name, WRITE_BINARY_MODE); data/oaklisp-1.3.7/src/emulator/worldio.c:226: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). wfp = fopen(dump_file_name, WRITE_MODE); data/oaklisp-1.3.7/src/emulator/worldio.c:315: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). if ((d = fopen(str, READ_BINARY_MODE)) == 0) data/oaklisp-1.3.7/src/emulator/cmdline.c:125: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 (char_index > strlen(a)) data/oaklisp-1.3.7/src/emulator/loop.c:664:32: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PUSHVAL_IMM(CHAR_TO_REF(getc(stdin))); data/oaklisp-1.3.7/src/emulator/loop.c:1859:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc((FILE *) PEEKVAL()); data/oaklisp-1.3.7/src/emulator/worldio.c:112:26: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool swapem = (c = getc(d)) == '^'; data/oaklisp-1.3.7/src/emulator/worldio.c:320:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). magichar = getc(d); data/oaklisp-1.3.7/src/emulator/worldio.c:323:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getc(d); data/oaklisp-1.3.7/src/emulator/worldio.c:324:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getc(d); data/oaklisp-1.3.7/src/emulator/worldio.c:325:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getc(d); ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 6258 in approximately 0.19 seconds (32872 lines/second) Physical Source Lines of Code (SLOC) = 4184 Hits@level = [0] 121 [1] 8 [2] 12 [3] 1 [4] 9 [5] 0 Hits@level+ = [0+] 151 [1+] 30 [2+] 22 [3+] 10 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 36.0899 [1+] 7.17017 [2+] 5.25813 [3+] 2.39006 [4+] 2.15105 [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.