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/fcode-utils-1.0.2/detok/addfcodes.c Examining data/fcode-utils-1.0.2/detok/addfcodes.h Examining data/fcode-utils-1.0.2/detok/decode.c Examining data/fcode-utils-1.0.2/detok/detok.c Examining data/fcode-utils-1.0.2/detok/detok.h Examining data/fcode-utils-1.0.2/detok/dictionary.c Examining data/fcode-utils-1.0.2/detok/pcihdr.c Examining data/fcode-utils-1.0.2/detok/printformats.c Examining data/fcode-utils-1.0.2/detok/stream.c Examining data/fcode-utils-1.0.2/detok/stream.h Examining data/fcode-utils-1.0.2/romheaders/romheaders.c Examining data/fcode-utils-1.0.2/shared/classcodes.c Examining data/fcode-utils-1.0.2/shared/pcihdr.h Examining data/fcode-utils-1.0.2/shared/types.h Examining data/fcode-utils-1.0.2/toke/clflags.c Examining data/fcode-utils-1.0.2/toke/clflags.h Examining data/fcode-utils-1.0.2/toke/conditl.c Examining data/fcode-utils-1.0.2/toke/conditl.h Examining data/fcode-utils-1.0.2/toke/devnode.c Examining data/fcode-utils-1.0.2/toke/devnode.h Examining data/fcode-utils-1.0.2/toke/dictionary.c Examining data/fcode-utils-1.0.2/toke/dictionary.h Examining data/fcode-utils-1.0.2/toke/emit.h Examining data/fcode-utils-1.0.2/toke/errhandler.c Examining data/fcode-utils-1.0.2/toke/errhandler.h Examining data/fcode-utils-1.0.2/toke/flowcontrol.c Examining data/fcode-utils-1.0.2/toke/flowcontrol.h Examining data/fcode-utils-1.0.2/toke/macros.c Examining data/fcode-utils-1.0.2/toke/macros.h Examining data/fcode-utils-1.0.2/toke/nextfcode.c Examining data/fcode-utils-1.0.2/toke/nextfcode.h Examining data/fcode-utils-1.0.2/toke/parselocals.c Examining data/fcode-utils-1.0.2/toke/parselocals.h Examining data/fcode-utils-1.0.2/toke/scanner.h Examining data/fcode-utils-1.0.2/toke/stack.c Examining data/fcode-utils-1.0.2/toke/stack.h Examining data/fcode-utils-1.0.2/toke/stream.c Examining data/fcode-utils-1.0.2/toke/stream.h Examining data/fcode-utils-1.0.2/toke/strsubvocab.c Examining data/fcode-utils-1.0.2/toke/strsubvocab.h Examining data/fcode-utils-1.0.2/toke/ticvocab.c Examining data/fcode-utils-1.0.2/toke/ticvocab.h Examining data/fcode-utils-1.0.2/toke/toke.h Examining data/fcode-utils-1.0.2/toke/tokzesc.c Examining data/fcode-utils-1.0.2/toke/tokzesc.h Examining data/fcode-utils-1.0.2/toke/tracesyms.c Examining data/fcode-utils-1.0.2/toke/tracesyms.h Examining data/fcode-utils-1.0.2/toke/usersymbols.c Examining data/fcode-utils-1.0.2/toke/usersymbols.h Examining data/fcode-utils-1.0.2/toke/vocabfuncts.h Examining data/fcode-utils-1.0.2/toke/emit.c Examining data/fcode-utils-1.0.2/toke/toke.c Examining data/fcode-utils-1.0.2/toke/scanner.c FINAL RESULTS: data/fcode-utils-1.0.2/detok/addfcodes.c:222:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strbfr, data/fcode-utils-1.0.2/detok/addfcodes.c:298:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strbfr, data/fcode-utils-1.0.2/detok/addfcodes.c:338:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strbfr, data/fcode-utils-1.0.2/detok/addfcodes.c:361:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strbfr, data/fcode-utils-1.0.2/detok/addfcodes.c:381:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( strbuf, "Added Special Function FCode " data/fcode-utils-1.0.2/detok/detok.c:75:32: [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. pfunct = (is_error ? (vfunct) printf : printremark); data/fcode-utils-1.0.2/detok/pcihdr.c:287:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp_buf, " Class Code: 0x%06x (%s)", data/fcode-utils-1.0.2/detok/pcihdr.c:303:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp_buf, " Code Type: 0x%02x (%s)\n", data/fcode-utils-1.0.2/detok/pcihdr.c:314:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp_buf, " %sast PCI Image.\n", data/fcode-utils-1.0.2/toke/clflags.c:459:5: [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_txt, flag_name); data/fcode-utils-1.0.2/toke/devnode.c:183:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( ccs_messg, statbuf ); data/fcode-utils-1.0.2/toke/devnode.c:469:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( in_what_buffr, "in the%s device-node%s", data/fcode-utils-1.0.2/toke/errhandler.c:546:9: [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. vfprintf(ERRMSG_DESTINATION, msg, argp); data/fcode-utils-1.0.2/toke/parselocals.c:176:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bufr,"%s%d",prefix, num); data/fcode-utils-1.0.2/toke/parselocals.c:235:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( eval_buf, "%s %s %s", local_num_buf, local_addr, local_op ); data/fcode-utils-1.0.2/toke/parselocals.c:523:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( eval_buf,"%s %s %s",ilocals_buf, ulocals_buf, push_locals); data/fcode-utils-1.0.2/toke/parselocals.c:902:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( eval_buf,"%s %s",nlocals_buf, pop_locals); data/fcode-utils-1.0.2/toke/scanner.c:2561:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat( as_what, defn_type_name); data/fcode-utils-1.0.2/toke/scanner.c:3196:6: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat( defn_type_buffr, defn_type_name); data/fcode-utils-1.0.2/toke/scanner.c:4066:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( statbuf, save_statbuf); data/fcode-utils-1.0.2/toke/stream.c:422:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( include_list_full_path, "%s", base_name); data/fcode-utils-1.0.2/toke/stream.c:424:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( include_list_full_path, "%s/%s", data/fcode-utils-1.0.2/toke/stream.c:915:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( expansion_buffer, data/fcode-utils-1.0.2/toke/stream.c:917:14: [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. syst_stat = system( expansion_buffer); data/fcode-utils-1.0.2/toke/stream.c:1279:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(retval, new_ext); data/fcode-utils-1.0.2/detok/detok.c:112:7: [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. c = getopt_long(argc, argv, optstring, data/fcode-utils-1.0.2/detok/detok.c:115:7: [3] (buffer) getopt: 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. c = getopt(argc, argv, optstring); data/fcode-utils-1.0.2/toke/stream.c:912:31: [3] (tmpfile) tmpnam: Temporary file race condition (CWE-377). const char *temp_file_name = tmpnam( NULL); data/fcode-utils-1.0.2/toke/toke.c:255:7: [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. c = getopt_long (argc, argv, optstring, data/fcode-utils-1.0.2/toke/toke.c:258:7: [3] (buffer) getopt: 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. c = getopt (argc, argv, optstring); data/fcode-utils-1.0.2/detok/addfcodes.c:309: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 vs_fc_name[36]; data/fcode-utils-1.0.2/detok/addfcodes.c:349:4: [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(strbfr, data/fcode-utils-1.0.2/detok/addfcodes.c:376:6: [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 strbuf[64]; data/fcode-utils-1.0.2/detok/addfcodes.c:400: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 strbfr[32]; data/fcode-utils-1.0.2/detok/addfcodes.c:401: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(strbfr, data/fcode-utils-1.0.2/detok/decode.c:181: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 temp_buf[80]; data/fcode-utils-1.0.2/detok/decode.c:185: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(temp_buf, "Backing up over first byte, which is "); data/fcode-utils-1.0.2/detok/decode.c:188:4: [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(&temp_buf[buf_pos], " %02x", top_byte); data/fcode-utils-1.0.2/detok/decode.c:190:4: [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(&temp_buf[buf_pos], "0x%02x ( =dec %d)", data/fcode-utils-1.0.2/detok/decode.c:632: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 temp_bufr[128] = data/fcode-utils-1.0.2/detok/decode.c:638:5: [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(&(temp_bufr[strlen(temp_bufr)]), data/fcode-utils-1.0.2/detok/decode.c:704: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 temp_bufr[80]; data/fcode-utils-1.0.2/detok/decode.c:709:4: [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(temp_bufr, data/fcode-utils-1.0.2/detok/decode.c:713:4: [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(temp_bufr, data/fcode-utils-1.0.2/detok/decode.c:774: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 temp_bufr[80]; data/fcode-utils-1.0.2/detok/decode.c:775:4: [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(temp_bufr, data/fcode-utils-1.0.2/detok/detok.c:65: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 buffr[512]; data/fcode-utils-1.0.2/detok/detok.c:67:2: [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(buffr, data/fcode-utils-1.0.2/detok/pcihdr.c:229: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 temp_buf[80]; data/fcode-utils-1.0.2/detok/pcihdr.c:234:2: [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(temp_buf, " Offset to Data Structure = 0x%04x (%d)\n", data/fcode-utils-1.0.2/detok/pcihdr.c:269: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 temp_buf[80]; data/fcode-utils-1.0.2/detok/pcihdr.c:275:2: [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(temp_buf, " Data Structure Length = 0x%04x (%d)\n", temp, temp); data/fcode-utils-1.0.2/detok/pcihdr.c:278:2: [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(temp_buf, " Vendor ID: 0x%04x\n", data/fcode-utils-1.0.2/detok/pcihdr.c:282:2: [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(temp_buf, " Device ID: 0x%04x\n", data/fcode-utils-1.0.2/detok/pcihdr.c:293: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(temp_buf, " Vital Prod Data: 0x%02x\n", temp); data/fcode-utils-1.0.2/detok/pcihdr.c:299: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(temp_buf, " Image Revision: 0x%02x\n", temp); data/fcode-utils-1.0.2/detok/pcihdr.c:310:2: [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(temp_buf, " Image Length: 0x%04x blocks (%d bytes)\n", data/fcode-utils-1.0.2/detok/pcihdr.c:445: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 temp_buf[80]; data/fcode-utils-1.0.2/detok/pcihdr.c:460: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(temp_buf, "PCI Image padded with %d bytes of zero", filler_len); data/fcode-utils-1.0.2/detok/pcihdr.c:462: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(temp_buf, "PCI Image padding-field of %d bytes " data/fcode-utils-1.0.2/detok/stream.c:93:11: [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). infile = fopen(name, "r"); data/fcode-utils-1.0.2/romheaders/romheaders.c:202:17: [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). romfile=fopen(name,"r"); data/fcode-utils-1.0.2/toke/devnode.c:143: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 in_what_buffr[50]; /* Ought to be more than enough. */ data/fcode-utils-1.0.2/toke/devnode.c:185:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( ccs_messg, " encountered"); data/fcode-utils-1.0.2/toke/devnode.c:583:6: [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 as_what_buf[AS_WHAT_BUF_SIZE] = ""; data/fcode-utils-1.0.2/toke/parselocals.c:123: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 eval_buf[64]; data/fcode-utils-1.0.2/toke/parselocals.c:231: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 local_num_buf[10]; data/fcode-utils-1.0.2/toke/parselocals.c:518: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 ilocals_buf[10]; data/fcode-utils-1.0.2/toke/parselocals.c:519: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 ulocals_buf[10]; data/fcode-utils-1.0.2/toke/parselocals.c:899:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nlocals_buf[10]; data/fcode-utils-1.0.2/toke/scanner.c:291: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(statbuf, safe, len); data/fcode-utils-1.0.2/toke/scanner.c:632: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(statbuf, pc, len); data/fcode-utils-1.0.2/toke/scanner.c:687: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 func_cpy[FUNC_CPY_BUF_SIZE+1]; data/fcode-utils-1.0.2/toke/scanner.c:1247: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 pval[3]; data/fcode-utils-1.0.2/toke/scanner.c:2143: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 deep_do[64] = ""; data/fcode-utils-1.0.2/toke/scanner.c:2149:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( deep_do, "DO ... "); data/fcode-utils-1.0.2/toke/scanner.c:2155:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( deep_do, " ... "); data/fcode-utils-1.0.2/toke/scanner.c:2157:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( deep_do, "LOOP"); data/fcode-utils-1.0.2/toke/scanner.c:2548:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( as_what, "as a"); data/fcode-utils-1.0.2/toke/scanner.c:2646: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 lookup_where_pt1_buf[AS_WHAT_BUF_SIZE]; data/fcode-utils-1.0.2/toke/scanner.c:3186: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 defn_type_buffr[32] = ""; data/fcode-utils-1.0.2/toke/scanner.c:3197:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( defn_type_buffr, " definition"); data/fcode-utils-1.0.2/toke/scanner.c:3760: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 cmnd_cpy[FUNC_CPY_BUF_SIZE+1]; data/fcode-utils-1.0.2/toke/scanner.c:3828: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 base_cmnd[FUNC_CPY_BUF_SIZE+1]; data/fcode-utils-1.0.2/toke/scanner.c:5109:7: [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 temp_buffr[32]; data/fcode-utils-1.0.2/toke/stream.c:510:18: [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). retval = fopen( include_list_full_path, mode); data/fcode-utils-1.0.2/toke/stream.c:711: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 expansion_buffer[ 2*GET_BUF_MAX]; data/fcode-utils-1.0.2/toke/stream.c:926:14: [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). temp_file = fopen( temp_file_name, "r"); /* Cannot fail. */ data/fcode-utils-1.0.2/toke/stream.c:1103:11: [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). infile = fopen( include_list_full_path, "r"); data/fcode-utils-1.0.2/toke/stream.c:1277: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( retval, base_name, len); data/fcode-utils-1.0.2/toke/stream.c:1396:23: [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). load_list_file = fopen( load_list_name,"w"); data/fcode-utils-1.0.2/toke/stream.c:1402: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). depncy_file = fopen( depncy_list_name,"w"); data/fcode-utils-1.0.2/toke/stream.c:1436:23: [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). missing_list_file = fopen( missing_list_name,"w"); data/fcode-utils-1.0.2/toke/stream.c:1571:14: [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). outfile=fopen( oname,"w"); data/fcode-utils-1.0.2/toke/tracesyms.c:274:2: [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( fc_phrase_buff, data/fcode-utils-1.0.2/toke/tracesyms.c:340: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 fc_token_display[TRACING_FCODE_LENGTH] = ""; data/fcode-utils-1.0.2/toke/tracesyms.c:497: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 fc_token_display[TRACING_FCODE_LENGTH] = ""; data/fcode-utils-1.0.2/toke/tracesyms.c:582: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 fc_token_display[TRACING_FCODE_LENGTH] = ""; data/fcode-utils-1.0.2/toke/tracesyms.c:720: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 fc_token_display[TRACING_FCODE_LENGTH] = ""; data/fcode-utils-1.0.2/detok/addfcodes.c:221: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). char *strbfr = malloc(strlen(vf_file_name) + 65); data/fcode-utils-1.0.2/detok/addfcodes.c:297: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). char *strbfr = malloc(strlen(vf_file_name) + 65); data/fcode-utils-1.0.2/detok/addfcodes.c:322:17: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. scan_result = sscanf(current_vfc_line, "0x%x %32s", data/fcode-utils-1.0.2/detok/addfcodes.c:326:18: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. scan_result = sscanf(current_vfc_line, "0X%x %32s", data/fcode-utils-1.0.2/detok/addfcodes.c:330:18: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. scan_result = sscanf(current_vfc_line, "%x %32s", data/fcode-utils-1.0.2/detok/addfcodes.c:336:15: [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). malloc(strlen(current_vfc_line) + 65); data/fcode-utils-1.0.2/detok/addfcodes.c:359:26: [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). char *strbfr = malloc(strlen(lookup_result) + 85); data/fcode-utils-1.0.2/detok/decode.c:186:13: [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). buf_pos = strlen(temp_buf); data/fcode-utils-1.0.2/detok/decode.c:638: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). sprintf(&(temp_bufr[strlen(temp_bufr)]), data/fcode-utils-1.0.2/detok/printformats.c:97:27: [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). strbfr = (char *) malloc(strlen((char *) str) + 1); data/fcode-utils-1.0.2/detok/printformats.c:105: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). strend = &str[strlen(str)]; data/fcode-utils-1.0.2/detok/printformats.c:119:51: [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). substrlen = (substrend ? (substrend - strtmp) : strlen(strtmp)); data/fcode-utils-1.0.2/detok/printformats.c:121:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(strbfr, strtmp, substrlen); data/fcode-utils-1.0.2/toke/clflags.c:413: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(flag_name) > 3 ) data/fcode-utils-1.0.2/toke/devnode.c:180: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). ccs_messg = safe_malloc(strlen(statbuf) + 32, data/fcode-utils-1.0.2/toke/devnode.c:586:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat( as_what_buf, " "); data/fcode-utils-1.0.2/toke/macros.c:238:23: [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 mac_str_len = strlen(pfield.chr_ptr); data/fcode-utils-1.0.2/toke/macros.c:491:6: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat( statbuf, "\n"); data/fcode-utils-1.0.2/toke/macros.c:493: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). mac_body_len = strlen(macrobody); data/fcode-utils-1.0.2/toke/scanner.c:692:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( func_cpy, func_nam, FUNC_CPY_BUF_SIZE); data/fcode-utils-1.0.2/toke/scanner.c:1703:39: [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). base, val,(size_t)(until-statbuf), strlen((char *)statbuf)); data/fcode-utils-1.0.2/toke/scanner.c:1709: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). if (until==(statbuf+strlen((char *)statbuf))) data/fcode-utils-1.0.2/toke/scanner.c:2558:26: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if ( definer == ALIAS ) strcat( as_what, "n" ); data/fcode-utils-1.0.2/toke/scanner.c:2560:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat( as_what, " "); data/fcode-utils-1.0.2/toke/scanner.c:2705:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(lookup_where_pt1_buf, " "); data/fcode-utils-1.0.2/toke/scanner.c:3761:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( cmnd_cpy, statbuf, FUNC_CPY_BUF_SIZE); data/fcode-utils-1.0.2/toke/scanner.c:3829:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( base_cmnd, statbuf, FUNC_CPY_BUF_SIZE); data/fcode-utils-1.0.2/toke/scanner.c:3889:27: [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). init_inbuf( inp_bufr, strlen(inp_bufr)); data/fcode-utils-1.0.2/toke/scanner.c:4852:15: [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). strlen( last_colon_defname) ); data/fcode-utils-1.0.2/toke/scanner.c:4859:23: [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). emit_string( iname, strlen( iname) ); data/fcode-utils-1.0.2/toke/scanner.c:5123: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). emit_string((u8 *)temp_buffr, strlen(temp_buffr) ); data/fcode-utils-1.0.2/toke/stream.c:201: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). unsigned int new_path_len = strlen( dir_compt); data/fcode-utils-1.0.2/toke/stream.c:259: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). int this_wid = strlen( include_list_next->dir_path) + 1; data/fcode-utils-1.0.2/toke/stream.c:335: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). unsigned int new_path_len = max_dir_path_len + strlen( base_name) + 2; data/fcode-utils-1.0.2/toke/stream.c:420: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). if ( strlen( include_list_next->dir_path) == 0 ) data/fcode-utils-1.0.2/toke/stream.c:1275:51: [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 = ext ? (ext - base_name) : (unsigned int)strlen(base_name) ; data/fcode-utils-1.0.2/toke/stream.c:1276: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). retval = safe_malloc(len+strlen(new_ext)+1, "extending file-name"); data/fcode-utils-1.0.2/toke/tokzesc.c:418:15: [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). lenny = strlen ( pfield.chr_ptr ); data/fcode-utils-1.0.2/toke/usersymbols.c:342: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). if ( strlen(curr->name) > maxlen ) maxlen = strlen(curr->name); data/fcode-utils-1.0.2/toke/usersymbols.c:342: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). if ( strlen(curr->name) > maxlen ) maxlen = strlen(curr->name); data/fcode-utils-1.0.2/toke/usersymbols.c:374: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). for ( strindx = strlen(curr->name) ; ANALYSIS SUMMARY: Hits = 140 Lines analyzed = 26895 in approximately 1.03 seconds (26105 lines/second) Physical Source Lines of Code (SLOC) = 9705 Hits@level = [0] 185 [1] 41 [2] 69 [3] 5 [4] 25 [5] 0 Hits@level+ = [0+] 325 [1+] 140 [2+] 99 [3+] 30 [4+] 25 [5+] 0 Hits/KSLOC@level+ = [0+] 33.4879 [1+] 14.4256 [2+] 10.2009 [3+] 3.09119 [4+] 2.57599 [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.