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/gnucobol-4.0~early~20200606/cobc/codegen.c Examining data/gnucobol-4.0~early~20200606/cobc/codeoptim.c Examining data/gnucobol-4.0~early~20200606/cobc/config.c Examining data/gnucobol-4.0~early~20200606/cobc/ppparse.c Examining data/gnucobol-4.0~early~20200606/cobc/tree.h Examining data/gnucobol-4.0~early~20200606/cobc/cobc.c Examining data/gnucobol-4.0~early~20200606/cobc/typeck.c Examining data/gnucobol-4.0~early~20200606/cobc/parser.h Examining data/gnucobol-4.0~early~20200606/cobc/cobc.h Examining data/gnucobol-4.0~early~20200606/cobc/scanner.c Examining data/gnucobol-4.0~early~20200606/cobc/parser.c Examining data/gnucobol-4.0~early~20200606/cobc/reserved.c Examining data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c Examining data/gnucobol-4.0~early~20200606/cobc/tree.c Examining data/gnucobol-4.0~early~20200606/cobc/error.c Examining data/gnucobol-4.0~early~20200606/cobc/ppparse.h Examining data/gnucobol-4.0~early~20200606/cobc/help.c Examining data/gnucobol-4.0~early~20200606/cobc/field.c Examining data/gnucobol-4.0~early~20200606/cobc/pplex.c Examining data/gnucobol-4.0~early~20200606/bin/gcdiff.c Examining data/gnucobol-4.0~early~20200606/bin/cobcrun.c Examining data/gnucobol-4.0~early~20200606/libcob/call.c Examining data/gnucobol-4.0~early~20200606/libcob/common.h Examining data/gnucobol-4.0~early~20200606/libcob/fileio.c Examining data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c Examining data/gnucobol-4.0~early~20200606/libcob/strings.c Examining data/gnucobol-4.0~early~20200606/libcob/libcobdi.c Examining data/gnucobol-4.0~early~20200606/libcob/focextfh.c Examining data/gnucobol-4.0~early~20200606/libcob/foci.c Examining data/gnucobol-4.0~early~20200606/libcob/libcobvb.c Examining data/gnucobol-4.0~early~20200606/libcob/fisam.c Examining data/gnucobol-4.0~early~20200606/libcob/fileio.h Examining data/gnucobol-4.0~early~20200606/libcob/fbdb.c Examining data/gnucobol-4.0~early~20200606/libcob/intrinsic.c Examining data/gnucobol-4.0~early~20200606/libcob/numeric.c Examining data/gnucobol-4.0~early~20200606/libcob/reportio.c Examining data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c Examining data/gnucobol-4.0~early~20200606/libcob/move.c Examining data/gnucobol-4.0~early~20200606/libcob/libcobci.c Examining data/gnucobol-4.0~early~20200606/libcob/sysdefines.h Examining data/gnucobol-4.0~early~20200606/libcob/screenio.c Examining data/gnucobol-4.0~early~20200606/libcob/termio.c Examining data/gnucobol-4.0~early~20200606/libcob/common.c Examining data/gnucobol-4.0~early~20200606/libcob/cobgetopt.h Examining data/gnucobol-4.0~early~20200606/libcob/fextfh.c Examining data/gnucobol-4.0~early~20200606/libcob/fodbc.c Examining data/gnucobol-4.0~early~20200606/libcob/coblocal.h Examining data/gnucobol-4.0~early~20200606/libcob/flmdb.c Examining data/gnucobol-4.0~early~20200606/libcob/mlio.c Examining data/gnucobol-4.0~early~20200606/lib/dummymac.c Examining data/gnucobol-4.0~early~20200606/lib/gettext.h Examining data/gnucobol-4.0~early~20200606/libcob.h Examining data/gnucobol-4.0~early~20200606/tarstamp.h FINAL RESULTS: data/gnucobol-4.0~early~20200606/cobc/cobc.c:3242:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod (cob_schema_dir, 0777); data/gnucobol-4.0~early~20200606/libcob/common.c:8057:12: [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. i = (int)readlink (path, s, (size_t)COB_LARGE_MAX); data/gnucobol-4.0~early~20200606/bin/cobcrun.c:92:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. status = sscanf (__DATE__, "%s %d %d", month, &day, &year); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:241:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. status = sscanf (__DATE__, "%s %d %d", month, &day, &year); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:603:3: [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(referencefile,arg); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:606:3: [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(testfile,arg); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:719:3: [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(referencefile,argv[cob_optind++]); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:723:3: [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(testfile,argv[cob_optind++]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:806:2: [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 (stderr, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/cobc.c:813:3: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf (errmsg, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1395:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (p->value, "'%s'", value); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1610:2: [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 (stderr, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1721: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 (*var, s1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1723:3: [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 (*var, s2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1726:3: [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 (*var, s3); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1734:15: [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. if (!name || access (name, F_OK)) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:1820:10: [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. if (!access (cobc_buffer, F_OK)) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3229: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(temp_buff,cob_schema_dir); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3232:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((void*)cob_schema_dir,"%s%s%s",temp_buff,SLASH_STR,cb_sqldb_schema); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3235:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((void*)cob_schema_dir,"%s%s%s",COB_SCHEMA_DIR,SLASH_STR,cb_sqldb_schema); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3591:24: [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. if (!file_is_stdin && access (filename, R_OK) != 0) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3698:3: [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 (full_path, fn->translate); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3872:11: [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. status = system (cobc_buffer); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4025:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffptr, "CRTCMOD MODULE(%s) SRCSTMF('%s') ", data/gnucobol-4.0~early~20200606/cobc/cobc.c:4034: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 (buffptr, incl[i]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4046: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 (buffptr, defs[i]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4054:4: [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 (buffptr, optc[i]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4069:10: [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. ret = system (buffptr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4093:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffptr, "CRTSRVPGM SRVPGM(%s) MODULE(", objname); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4095:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffptr, "CRTPGM PGM(%s) MODULE(", objname); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4098:3: [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 (buffptr, cobjname); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4104:3: [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 (buffptr, objs[i]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4113:4: [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 (buffptr, libs[i]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4119:3: [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 (buffptr, optl[i]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4128:9: [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. ret = system (buffptr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4156:8: [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. ret = system (cmd); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4184:9: [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. pipe = popen (cmd, "r"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4211:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (search_pattern, "%s\n%c", fn->translate + i, PATTERN_DELIM); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4214:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (search_pattern2, "%s.lib%c%s.exp%c", output_name_temp, PATTERN_DELIM, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4285:8: [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. ret = system (buffptr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4428:10: [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. ret = system (cobc_buffer); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4589: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 (cb_src_list_file, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4610:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf (cb_src_list_file, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4696:2: [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 (picture_usage, cb_get_usage_string (field->usage)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4727: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 (picture, picture_usage); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4889:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pd_off += sprintf (print_data + pd_off, "%-30.30s %s, ", lcl_name, picture); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4891:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pd_off += sprintf (print_data + pd_off, "%-30.30s %s", lcl_name, picture); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4895:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pd_off += sprintf (print_data + pd_off, "%s", lcl_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4907:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pd_off += sprintf (print_data + pd_off, ", REDEFINES %s", top->redefines->name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5308:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (print_data, data/gnucobol-4.0~early~20200606/cobc/cobc.c:5347:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (print_data, data/gnucobol-4.0~early~20200606/cobc/cobc.c:5377:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (print_data, data/gnucobol-4.0~early~20200606/cobc/cobc.c:5752:3: [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 (cb_listing_title, print_data); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5787:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (print_data, format_str, line_num, pch, line + i); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5812:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (print_data, format_str, line_num, pch, line + i); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6065:2: [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 (pline[*pline_cnt + 1], pline[*pline_cnt]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6066:2: [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 (pline[*pline_cnt], pline[*pline_cnt - 1]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6170: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 (&pline[out_line][out_col], new_token); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6231:4: [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 (pline[i], new_token); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6232:4: [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 (pline[i], token_terminator); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6336:3: [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 (from_line, rfp); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6367: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 (newline, ttoken); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6368: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 (newline, tterm); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6373: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 (from_line, rfp); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6389:4: [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 (newline, rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6390:4: [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 (newline, lterm); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6396: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 (newline, ttoken); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6397: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 (newline, tterm); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6398: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 (newline, to_ptr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6461:3: [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 (from_line, rfp); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6501:7: [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 (newline, rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6502:7: [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 (newline, &ttoken[from_token_len]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6505:7: [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 (newline, rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6507:7: [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 (newline, rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6510: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 (newline, rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6518: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 (newline, ttoken); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6520:4: [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 (newline, tterm); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6849: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 (pline[0], pline[pline_cnt]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7082:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (lf->local_name, "%s.l.h", fn->translate); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7084:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (lf->local_name, "%s.l%d.h", fn->translate, ret); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7092:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (lf->local_name, "%s.h", buffer); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7094:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (lf->local_name, "%s%d.h", buffer, ret); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7190:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (cobc_buffer, gflag_set ? data/gnucobol-4.0~early~20200606/cobc/cobc.c:7201:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -fe=\"%s\" -s %s %s %s", cobc_cc, name, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7207:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -S -o \"%s\" %s %s %s \"%s\"", cobc_cc, name, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7210:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -S -o \"%s\" %s %s \"%s\"", cobc_cc, name, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7241:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (cobc_buffer, gflag_set ? data/gnucobol-4.0~early~20200606/cobc/cobc.c:7253:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -c %s %s -o %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7261:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -c %s %s %s -fe=\"%s\" \"%s\"", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7265:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -c %s %s -fe=\"%s\" \"%s\"", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7275:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -c %s %s %s -o \"%s\" \"%s\"", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7280:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s -c %s %s -o \"%s\" \"%s\"", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7306:3: [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 (name, output_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7311:4: [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 (name, "." COB_MODULE_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7317:3: [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 (name, "." COB_MODULE_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7342:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (cobc_buffer, gflag_set ? data/gnucobol-4.0~early~20200606/cobc/cobc.c:7355:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7359:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.manifest", exe_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7363:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.exp", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7365:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.lib", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7367:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.%s", name, COB_OBJECT_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7377:3: [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 (p, fn->translate); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7383:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s %s %s %s %s -fe=\"%s\" \"%s\" %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7388:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s %s %s %s %s -o \"%s\" \"%s\" %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7397:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s \"%s\"", COB_STRIP_CMD, name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7420:3: [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 (name, output_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7425:4: [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 (name, "." COB_MODULE_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7431:3: [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 (name, "." COB_MODULE_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7452:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (cobc_buffer, gflag_set ? data/gnucobol-4.0~early~20200606/cobc/cobc.c:7464:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7468:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.manifest", exe_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7472:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.exp", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7474:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.lib", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7476:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.obj", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7480:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s %s %s -fe=\"%s\" \"%s\" %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7484:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s %s %s -o \"%s\" \"%s\" %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7492:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s \"%s\"", COB_STRIP_CMD, name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7524:3: [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 (cobc_objects_buffer, f->object); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7530:3: [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 (name, output_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7535:4: [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 (name, "." COB_MODULE_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7541:3: [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 (name, "." COB_MODULE_EXT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7561:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (cobc_buffer, gflag_set ? data/gnucobol-4.0~early~20200606/cobc/cobc.c:7573:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7577:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.manifest", exe_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7581:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.exp", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7583:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.lib", name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7593:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s %s %s -fe=\"%s\" %s %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7598:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s %s %s -o \"%s\" %s %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7606:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s \"%s\"", COB_STRIP_CMD, name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7639:3: [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 (cobc_objects_buffer, f->object); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7643:3: [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 (cobc_objects_buffer, f->object); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7678:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (cobc_buffer, gflag_set ? data/gnucobol-4.0~early~20200606/cobc/cobc.c:7690:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, data/gnucobol-4.0~early~20200606/cobc/cobc.c:7694:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s.manifest", exe_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7700:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s -fe=\"%s\" %s %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7704:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s %s -o \"%s\" %s %s %s %s", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7713:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "chatr -s +s enable \"%s%s\" 1>/dev/null 2>&1", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7725:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s \"%s%s\"", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7728:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (cobc_buffer, "%s \"%s\"", data/gnucobol-4.0~early~20200606/cobc/cobc.c:7750:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf (__DATE__, "%s %d %d", month, &day, &year) == 3) { data/gnucobol-4.0~early~20200606/cobc/codegen.c:542:3: [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 (output_target, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/codegen.c:583:3: [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 (output_target, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/codegen.c:661:3: [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 (cb_storage_file, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/codegen.c:674:3: [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 (cb_local_file, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/codegen.c:7530:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (last_line_num, "#line %d \"%s\"", x->source_line, x->source_file); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8652:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&features[strlen(features)],"%sCOB_SELECT_FILE_STATUS",nxt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8656:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&features[strlen(features)],"%sCOB_SELECT_LINAGE",nxt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8660:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&features[strlen(features)],"%sCOB_SELECT_EXTERNAL",nxt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8664:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&features[strlen(features)],"%s%d",nxt,f->special); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8671:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (file_name, "%s%s", CB_PREFIX_FILE, f->cname); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8682:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (extname, "\"%s\"", file_name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9551:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&fname[strlen(fname)]," %s",cb_code_field(f->report_control)->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9556:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fname,"%s of ",f->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9692:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&fname[strlen(fname)]," %s",cb_code_field(f->report_control)->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9695:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fname,"%s",f->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:11601:4: [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 (string_buffer, f->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:11744:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (fdname, "FD %s", fl->name); data/gnucobol-4.0~early~20200606/cobc/codeoptim.c:46:3: [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 (cb_storage_file, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/config.c:272:7: [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. if (access(conf_file, F_OK) != 0) { /* and file does not exist */ data/gnucobol-4.0~early~20200606/cobc/config.c:289:10: [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. if (access (filename, F_OK) == 0) { /* and prefixed file exist */ data/gnucobol-4.0~early~20200606/cobc/config.c:300:9: [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. if (access (filename, F_OK) == 0) { /* and prefixed file exist */ data/gnucobol-4.0~early~20200606/cobc/config.c:321:10: [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. return access (words_file, F_OK); data/gnucobol-4.0~early~20200606/cobc/error.c:107:2: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf (errmsg, fmt, ap); data/gnucobol-4.0~early~20200606/cobc/error.c:412:2: [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 (stderr, fmt, args); data/gnucobol-4.0~early~20200606/cobc/error.c:443:2: [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 (stderr, fmt, args); data/gnucobol-4.0~early~20200606/cobc/error.c:675:4: [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 (errnamebuff, CB_NAME (c)); data/gnucobol-4.0~early~20200606/cobc/error.c:714:4: [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 (errnamebuff, CB_NAME (l)); data/gnucobol-4.0~early~20200606/cobc/error.c:723:4: [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 (errnamebuff, w->name); data/gnucobol-4.0~early~20200606/cobc/error.c:728: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 (errnamebuff, cb_name (CB_TREE(p))); data/gnucobol-4.0~early~20200606/cobc/error.c:735: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 (errnamebuff, data/gnucobol-4.0~early~20200606/cobc/field.c:347:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (result, CB_FMT_LLD, xval); data/gnucobol-4.0~early~20200606/cobc/parser.c:11620:21: [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 YYFPRINTF fprintf data/gnucobol-4.0~early~20200606/cobc/pplex.c:5595:6: [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. if (access (s, R_OK) == 0) { data/gnucobol-4.0~early~20200606/cobc/pplex.c:5604:7: [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. if (access (plexbuff2, R_OK) == 0) { data/gnucobol-4.0~early~20200606/cobc/pplex.c:5620:9: [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. if (access (plexbuff2, R_OK) == 0) { data/gnucobol-4.0~early~20200606/cobc/pplex.c:5630:8: [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. (void)access (s, R_OK); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5807:4: [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 (repl->from, l->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5815:4: [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 (repl->to, l->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6086:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. k = sprintf(wrk,"%s",&buff[k]); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6094:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. n = sprintf(buff," $SET XFD %c%s%c\n",qt,wrk,qt); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6104:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. k = sprintf(wrk,"%s",&buff[k]); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6118:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. n = sprintf(buff," $SET XFD %c%s%c\n",qt,wrk,qt); data/gnucobol-4.0~early~20200606/cobc/ppparse.c:1456:21: [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 YYFPRINTF fprintf data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2482:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (q, "'%s'", s); data/gnucobol-4.0~early~20200606/cobc/reserved.c:3972:2: [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 ((char *) cobc_reserved.name, user_reserved.word); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4244:4: [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 (amendment->word, default_reserved_words[i].name); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4386:3: [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 (aliases_str, aliases[j]); data/gnucobol-4.0~early~20200606/cobc/scanner.c:3031:3: [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(name, suffix); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4508:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf ((char *)plex_buff, CB_FMT_LLU, val); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4685:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf ((char *)plex_buff, CB_FMT_LLU, val); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4776:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf ((char *)plex_buff, CB_FMT_LLU, val); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4853:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf ((char *)plex_buff, CB_FMT_LLU, val); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4980:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. n = sscanf (text, COB_FLOAT_DIGITS_WIDTH "[0-9.,+-]%*1[Ee]%7[0-9.,+-]", data/gnucobol-4.0~early~20200606/cobc/scanner.c:5007:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. n = sscanf (significand_pos, data/gnucobol-4.0~early~20200606/cobc/scanner.c:5099:2: [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 (result, significand_int); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5100: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 (result, significand_dec); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:68:2: [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(xfd[hasxfd],str); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:106: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 (dateformat[ndate++], f->sql_date_format); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:127:2: [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(sdf->format,format); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:331:4: [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(p1,p2); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:332:4: [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(p2,p3); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:333:4: [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(p3,p4); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:519:3: [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(name,f->sql_name); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1066:10: [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(expr,get_col_name(fl,x,sub,idx)); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1068:10: [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(expr,name); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1256:3: [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(tblname,fl->sql_name); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1273:3: [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(tblname,fl->cname); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1325:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname,"%s%s%s.xd",cob_schema_dir,SLASH_STR,tblname); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1335:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname,"%s%s%s.ddl",cob_schema_dir,SLASH_STR,tblname); data/gnucobol-4.0~early~20200606/cobc/tree.c:512:10: [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. s += snprintf (s, size - (s - orig), CB_CHAIN (l) ? ", " : ")"); data/gnucobol-4.0~early~20200606/cobc/tree.c:569:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. s += snprintf (s, size - (s - orig), (i == 0) ? "(" : ", "); data/gnucobol-4.0~early~20200606/cobc/tree.c:1185:3: [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 (tmp2, tmp + 1); data/gnucobol-4.0~early~20200606/cobc/tree.c:1186:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. tlen = sprintf (tmp, _("literal '%s'"), tmp2); data/gnucobol-4.0~early~20200606/cobc/tree.c:5350:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(result, CB_FMT_LLD, rslt); data/gnucobol-4.0~early~20200606/cobc/tree.c:5359:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(result, CB_FMT_LLD, rslt); data/gnucobol-4.0~early~20200606/cobc/tree.c:5366:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(result, CB_FMT_LLD, xval / yval); data/gnucobol-4.0~early~20200606/cobc/tree.c:5384:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (result, CB_FMT_LLD, rslt); data/gnucobol-4.0~early~20200606/cobc/tree.c:6474:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(result, CB_FMT_LLD, rslt); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1141: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 (buff, CB_FIELD (z)->name); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1946:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(full_name, _("'%s'"), f1->name); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1948:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(full_name, _("'%s' (accessed by '%s')"), f1->name, f2->name); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2311:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, CB_INTEGER(x)->val); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2356:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, f->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2359:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, f->memory_size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2554:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, (int)l->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2567:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, cb_field_size (x) * f->occurs_max); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2572:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, cb_field_size (x)); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2591:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, FMT_LEN, cb_field_size (x)); data/gnucobol-4.0~early~20200606/libcob/call.c:477:6: [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. if (access (path, R_OK) != 0) { data/gnucobol-4.0~early~20200606/libcob/call.c:796:2: [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 (call_filename_buff, s); data/gnucobol-4.0~early~20200606/libcob/call.c:816:7: [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. if (access (call_filename_buff, R_OK) != 0) { data/gnucobol-4.0~early~20200606/libcob/call.c:850:7: [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. if (access (call_filename_buff, R_OK) == 0) { data/gnucobol-4.0~early~20200606/libcob/call.c:1617:3: [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(prog, COB_MODULE_PTR->module_name); data/gnucobol-4.0~early~20200606/libcob/common.c:3192:2: [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 (eptr->ename, exname); data/gnucobol-4.0~early~20200606/libcob/common.c:3989:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (env, "%s=%s", name, value); data/gnucobol-4.0~early~20200606/libcob/common.c:4003:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (env, "%s=", name); data/gnucobol-4.0~early~20200606/libcob/common.c:4400:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (filename, (size_t)COB_FILE_MAX, TEMP_EXT_SCHEMA, data/gnucobol-4.0~early~20200606/libcob/common.c:4403:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (filename, (size_t)COB_FILE_MAX, TEMP_SORT_SCHEMA, data/gnucobol-4.0~early~20200606/libcob/common.c:4622:8: [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. i = system (buff); data/gnucobol-4.0~early~20200606/libcob/common.c:5738:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (number, "%3.2f %s", d, byte_unit); data/gnucobol-4.0~early~20200606/libcob/common.c:5776:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (strbuff, "%s%s", temp1, temp2); data/gnucobol-4.0~early~20200606/libcob/common.c:5977:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. j += sprintf (&env[j], "%s", penv); data/gnucobol-4.0~early~20200606/libcob/common.c:6329:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value, CB_FMT_LLU, numval); data/gnucobol-4.0~early~20200606/libcob/common.c:6333:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value, CB_FMT_LLD, numval); data/gnucobol-4.0~early~20200606/libcob/common.c:6340:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value, CB_FMT_LLD" GB", numval / (1024 * 1024 * 1024)); data/gnucobol-4.0~early~20200606/libcob/common.c:6346:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value, CB_FMT_LLD" MB", numval / (1024 * 1024)); data/gnucobol-4.0~early~20200606/libcob/common.c:6352:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value, CB_FMT_LLD" KB", numval / 1024); data/gnucobol-4.0~early~20200606/libcob/common.c:6357:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (value, CB_FMT_LLD, numval); data/gnucobol-4.0~early~20200606/libcob/common.c:6410:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (value, "'%s'", (char *)data); data/gnucobol-4.0~early~20200606/libcob/common.c:6423: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 (orgvalue, value); data/gnucobol-4.0~early~20200606/libcob/common.c:6425: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 (value, gc_conf[pos].enums[i].match); data/gnucobol-4.0~early~20200606/libcob/common.c:6432:4: [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 (orgvalue, value); data/gnucobol-4.0~early~20200606/libcob/common.c:6439:3: [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(value,gc_conf[pos].default_val); data/gnucobol-4.0~early~20200606/libcob/common.c:6580:3: [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 (buf, str); data/gnucobol-4.0~early~20200606/libcob/common.c:6659:7: [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. if (access (config_file, F_OK) != 0) { /* and file does not exist */ data/gnucobol-4.0~early~20200606/libcob/common.c:6672:10: [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. if (access (filename, F_OK) == 0) { /* and prefixed file exist */ data/gnucobol-4.0~early~20200606/libcob/common.c:6689:9: [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. if (access (filename, F_OK) == 0) { /* and prefixed file exist */ data/gnucobol-4.0~early~20200606/libcob/common.c:6886:2: [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 (stderr, fmt, args); data/gnucobol-4.0~early~20200606/libcob/common.c:6910:2: [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 (stderr, fmt, args); data/gnucobol-4.0~early~20200606/libcob/common.c:6928:2: [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 (stderr, fmt, args); data/gnucobol-4.0~early~20200606/libcob/common.c:6960:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (runtime_err_str, "%s:%u: ", data/gnucobol-4.0~early~20200606/libcob/common.c:6963:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (runtime_err_str, "%s: ", data/gnucobol-4.0~early~20200606/libcob/common.c:6969:4: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf (p, fmt, ap); data/gnucobol-4.0~early~20200606/libcob/common.c:7020:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (reason, sizeof(reason), fmt, ap); data/gnucobol-4.0~early~20200606/libcob/common.c:7038:2: [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 (stderr, fmt, ap); data/gnucobol-4.0~early~20200606/libcob/common.c:7276:2: [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 (stderr, fmt, args); data/gnucobol-4.0~early~20200606/libcob/common.c:7303:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. status = sscanf (__DATE__, "%s %d %d", month, &day, &year); data/gnucobol-4.0~early~20200606/libcob/common.c:7453:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if ((sscanf (versbuff2, "%s %s %d.%d.%d", (char *)&versbuff, (char *)&versbuff, &major, &minor, &patch) < 4) data/gnucobol-4.0~early~20200606/libcob/common.c:7454:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. && (sscanf (versbuff2, "%s %d.%d.%d", (char *)&versbuff, &major, &minor, &patch) < 3) data/gnucobol-4.0~early~20200606/libcob/common.c:8018:7: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. s = getlogin (); data/gnucobol-4.0~early~20200606/libcob/common.c:8048:7: [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. if (!access ("/proc/self/exe", R_OK)) { data/gnucobol-4.0~early~20200606/libcob/common.c:8050:14: [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. } else if (!access ("/proc/curproc/file", R_OK)) { data/gnucobol-4.0~early~20200606/libcob/common.c:8052:14: [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. } else if (!access ("/proc/self/path/a.out", R_OK)) { data/gnucobol-4.0~early~20200606/libcob/common.c:8373: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 (cob_debug_modules[j], module_name); data/gnucobol-4.0~early~20200606/libcob/common.c:8509:2: [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 (cob_debug_file, fmt, ap); data/gnucobol-4.0~early~20200606/libcob/common.h:336:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/gnucobol-4.0~early~20200606/libcob/common.h:336:19: [4] (format) _snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/gnucobol-4.0~early~20200606/libcob/common.h:338:9: [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 access _access data/gnucobol-4.0~early~20200606/libcob/common.h:339:9: [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 popen _popen data/gnucobol-4.0~early~20200606/libcob/common.h:441:46: [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 COB_A_FORMAT12 __attribute__((format(printf, 1, 2))) data/gnucobol-4.0~early~20200606/libcob/common.h:442:46: [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 COB_A_FORMAT23 __attribute__((format(printf, 2, 3))) data/gnucobol-4.0~early~20200606/libcob/common.h:443:46: [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 COB_A_FORMAT34 __attribute__((format(printf, 3, 4))) data/gnucobol-4.0~early~20200606/libcob/common.h:444:46: [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 COB_A_FORMAT45 __attribute__((format(printf, 4, 5))) data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1112:4: [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(bdb_buff, filename); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1113:7: [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. if (access (filename, F_OK) && errno == ENOENT) { data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1129:7: [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. if (access (bdb_buff, F_OK) == 0 || errno != ENOENT) { data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1138:7: [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. if (access (bdb_buff, F_OK) == 0 || errno != ENOENT) { data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1364:2: [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 (p->filename, filename); data/gnucobol-4.0~early~20200606/libcob/fileio.c:335:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp,"%s%cdata.mdb",filename,SLASH_CHAR); data/gnucobol-4.0~early~20200606/libcob/fileio.c:342:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp,"%s.idx",filename); data/gnucobol-4.0~early~20200606/libcob/fileio.c:353:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp,"%s.%d",filename,idx); data/gnucobol-4.0~early~20200606/libcob/fileio.c:428:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. k += sprintf(&out[k],"type=IX format=%s",io_rtn_name[f->io_routine]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:432:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. k += sprintf(&out[k],",%s",file_format[f->file_format]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:436:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. k += sprintf(&out[k],",%s",file_format[f->file_format]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:683:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outdd,"%s%c%s.%s",file_setptr->cob_dictionary_path, data/gnucobol-4.0~early~20200606/libcob/fileio.c:686:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outdd,"%s.%s",filename,dict_ext); data/gnucobol-4.0~early~20200606/libcob/fileio.c:710:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(inpdd,"%s%c%s.%s",file_setptr->cob_dictionary_path, data/gnucobol-4.0~early~20200606/libcob/fileio.c:713:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(inpdd,"%s.%s",filename,dict_ext); data/gnucobol-4.0~early~20200606/libcob/fileio.c:838:4: [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 (file_open_env, file_open_name); data/gnucobol-4.0~early~20200606/libcob/fileio.c:888:9: [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. if (access (file_open_buff, F_OK) == 0) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:896:9: [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. if (access (file_open_buff, F_OK) == 0) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:938:3: [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 (file_open_buff, SLASH_STR); data/gnucobol-4.0~early~20200606/libcob/fileio.c:962: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 (file_open_buff, SLASH_STR); data/gnucobol-4.0~early~20200606/libcob/fileio.c:973:2: [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 (file_open_name, file_open_buff); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1415:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)f->xfdschema, "%s%c%s",COB_SCHEMA_DIR,SLASH_CHAR,value); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2697:6: [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. if (access (filename, F_OK) && errno == ENOENT) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:2887:8: [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. fp = popen (filename+1, "w"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2905:8: [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. fp = popen (filename+1, "r"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2979:4: [4] (shell) execv: 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. execv (filename, args); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2989:6: [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. if (access (filename, F_OK) && errno == ENOENT) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:7027:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (runtime_buffer, "%s ('%s' => %s)", data/gnucobol-4.0~early~20200606/libcob/fileio.c:7030:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (runtime_buffer, "%s ('%s')", data/gnucobol-4.0~early~20200606/libcob/fisam.c:706:6: [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. if (access (a->file_open_buff, checkvalue)) { data/gnucobol-4.0~early~20200606/libcob/fisam.c:722:6: [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. if (access (a->file_open_buff, checkvalue) data/gnucobol-4.0~early~20200606/libcob/fisam.c:728:6: [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. if (access (a->file_open_buff, checkvalue)) { data/gnucobol-4.0~early~20200606/libcob/flmdb.c:337:7: [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. if ((access(filename,(F_OK | R_OK | W_OK)) != 0)) { data/gnucobol-4.0~early~20200606/libcob/flmdb.c:374:12: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if( (n = sscanf(line, "%d%d%d%s", &maj, &min, &nblock, devname)) == EOF ) { data/gnucobol-4.0~early~20200606/libcob/flmdb.c:879:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(dir, "%s", filename); data/gnucobol-4.0~early~20200606/libcob/focextfh.c:119:7: [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. if (access (filename, F_OK) && errno == ENOENT) { data/gnucobol-4.0~early~20200606/libcob/focextfh.c:320:7: [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. if (access (filename, F_OK) && errno == ENOENT) { data/gnucobol-4.0~early~20200606/libcob/foci.c:280:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)env,"ORACLE_UID=%s",db->dbUser); data/gnucobol-4.0~early~20200606/libcob/foci.c:285:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)env,"ORACLE_PWD=%s",db->dbPwd); data/gnucobol-4.0~early~20200606/libcob/foci.c:290:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)env,"ORACLE_SID=%s",db->dbName); data/gnucobol-4.0~early~20200606/libcob/foci.c:394:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg,"BindColumn %s.%s Pos %d",fx->tablename,col->colname,pos); data/gnucobol-4.0~early~20200606/libcob/foci.c:436:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg,"BindParam %s.%s Pos %d",fx->tablename,col->colname,pos); data/gnucobol-4.0~early~20200606/libcob/foci.c:830:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp,"Attach DBNAME=%s",db->dbName); data/gnucobol-4.0~early~20200606/libcob/foci.c:838:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp,"Attach Default %s",db->dbSid); data/gnucobol-4.0~early~20200606/libcob/foci.c:932:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp,"ALTER SESSION SET NLS_DATE_FORMAT = '%s'",db->dateFormat); data/gnucobol-4.0~early~20200606/libcob/foci.c:939:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp,"ALTER SESSION SET NLS_DATE_FORMAT = '%s'",db->dateFormat); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:500:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg,"BindColumn %s.%s Pos %d",fx->tablename,col->colname,pos); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:530:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg,"BindParam %s.%s Pos %d",fx->tablename,col->colname,pos); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:860: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(varFetch2,&varFetch[k]); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:986:22: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. len = (SQLSMALLINT)sprintf(tmp,"%s",db->dbCon); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1109:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp,"ALTER SESSION SET NLS_DATE_FORMAT = '%s'",db->dateFormat); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1001:2: [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(tblname,&xfdbuf[i]); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1015:3: [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(tblname,&xfdbuf[i]); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1292:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. k = sprintf (xfdbuf, "%s%s%s.ddl",sdir,SLASH_STR,fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1367:4: [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(&fx->create_table[fx->lncreate], xfdbuf); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1377:4: [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 (&fx->key[idx]->create_index[fx->key[idx]->lncreate], xfdbuf); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1662:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s",db->dbSchema,suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1673:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s",sch,suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1678:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s","COB_SCHEMA",suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1683:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s","MYSQL",suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1686: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(out,env); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1691:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s","ORACLE",suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1695:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s","SQL",suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1700:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s","DB2",suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1706:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(envname,"%s%s","ODBC",suffix); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1713:4: [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(out,env); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1763:10: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,andstr,fx->map[k].colname,rel,j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1764:10: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,orstr,fx->map[k].colname,"=",j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1768:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,andstr,fx->map[k].colname,condstr[cond],j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1805:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(rowcol,"rid_%s",fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1844:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos += sprintf(&sbuf[pos],"%s%s",comma,fx->map[k].colname); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1868:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos = sprintf(sbuf,"%s %s FROM %s",stmt,fx->select,fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1898:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,rowcol,op,1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1904:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,fx->map[k].colname,"=",j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1910:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,fx->map[k].colname,"<>", j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1927:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos += sprintf(&sbuf[pos],"%s%s",rowcol,fmt); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1931:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos += sprintf(&sbuf[pos],"%s%s%s",comma,fx->map[k].colname,fmt); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1971:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos = sprintf(sbuf,"INSERT INTO %s (",fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1975:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos += sprintf(&sbuf[pos],"%s%s",comma,fx->map[k].colname); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1982:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1991:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos = sprintf(sbuf,"UPDATE %s SET ",fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2000:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,fx->map[k].colname,"=",++j); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2007:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,rowcol,"=",1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2011:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,fx->map[k].colname,"=",j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2020:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. pos = sprintf(sbuf,"DELETE FROM %s ",fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2028:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,rowcol,"=",1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2032:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. pos += sprintf(&sbuf[pos],fmt,comma,fx->map[k].colname,"=",j+1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2432:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(idxname,"pk_%s",fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2434:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(idxname,"k%d_%s",nx,fx->tablename); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2003:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (unlikely (!sscanf (str, scanf_str, &hours, &minutes, &seconds))) { data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2054:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, format_str, year, month, day_of_month); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2067:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, format_str, year, day_of_year); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2143:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, format_str, year, week, day_of_week + 1); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2304:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (local_buff, sizeof (local_buff), format_str, data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2399:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buff, format_str, hours, minutes, seconds); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2919:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (unlikely (!sscanf (final_part, scanf_str, &month, &day))) { data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2952:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (unlikely (!sscanf (final_part, scanf_str, &week, &day_of_week))) { data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3001:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buff, "%sT%s", formatted_date, formatted_time); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6481:3: [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 (format_str, original_format_str); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6492:3: [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 (date_str, original_date_str); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1602: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 (fp, CB_FMT_PLLD, size, size, llval.val); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1606: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 (fp, CB_FMT_PLLU, size, size, llval.uval); data/gnucobol-4.0~early~20200606/libcob/reportio.c:428: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(wrk,c->name); data/gnucobol-4.0~early~20200606/libcob/reportio.c:500:7: [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(wrk,rc->name); data/gnucobol-4.0~early~20200606/libcob/screenio.c:3189:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. size = vsnprintf (buff, COB_NORMAL_BUFF, fmt, ap); data/gnucobol-4.0~early~20200606/libcob/termio.c:315:9: [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. fp = popen (cobsetptr->cob_display_print_pipe, mode); data/gnucobol-4.0~early~20200606/libcob/termio.c:610:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(lvlwrk,"%*s%02d",indent," ",level); data/gnucobol-4.0~early~20200606/bin/cobcrun.c:209: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. envptr = getenv ("COB_LIBRARY_PATH"); data/gnucobol-4.0~early~20200606/bin/cobcrun.c:225: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. envptr = getenv ("COB_PRE_LOAD"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1663:6: [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. p = getenv (env); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1678:6: [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. p = getenv (env); data/gnucobol-4.0~early~20200606/cobc/cobc.c:2169:11: [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. if ((s = getenv ("COB_CC")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2173:11: [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. if ((s = getenv ("COB_CFLAGS")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2177:11: [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. if ((s = getenv ("COB_LDFLAGS")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2181:11: [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. if ((s = getenv ("COB_LIBS")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2185:11: [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. if ((s = getenv ("COB_CONFIG_DIR")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2189:11: [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. if ((s = getenv ("COB_COPY_DIR")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2193:11: [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. if ((s = getenv ("COB_SCHEMA_DIR")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2196:11: [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. if ((s = getenv ("COBCPY")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2204:11: [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. if ((s = getenv ("COB_MSG_FORMAT")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2239:11: [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. if ((s = getenv ("COB_VARSEQ_FORMAT")) != NULL) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3033:8: [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. if (getenv ("COB_IS_RUNNING_IN_TESTMODE")) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:8002:25: [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. process_env_copy_path (getenv ("COB_COPY_DIR")); data/gnucobol-4.0~early~20200606/cobc/cobc.c:8003:25: [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. process_env_copy_path (getenv ("COBCPY")); data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2469:6: [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. s = getenv ((yyvsp[-3].s)); data/gnucobol-4.0~early~20200606/cobc/tree.c:1988:5: [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. if(getenv("COBC_TRACE")) { data/gnucobol-4.0~early~20200606/libcob/call.c:61:9: [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. return LoadLibrary(x); data/gnucobol-4.0~early~20200606/libcob/call.c:563:7: [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 (realpath (path, s) != NULL) { data/gnucobol-4.0~early~20200606/libcob/common.c:1493: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. && (env = getenv(gc_conf[i].env_name)) != NULL data/gnucobol-4.0~early~20200606/libcob/common.c:4084:6: [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. p = getenv (buff); data/gnucobol-4.0~early~20200606/libcob/common.c:4099:7: [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. p = getenv (cob_local_env); data/gnucobol-4.0~early~20200606/libcob/common.c:4240:7: [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. p = getenv (name); data/gnucobol-4.0~early~20200606/libcob/common.c:4336:8: [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. dir = getenv (envname); data/gnucobol-4.0~early~20200606/libcob/common.c:4379: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. tmpdir = getenv ("TMPDIR"); data/gnucobol-4.0~early~20200606/libcob/common.c:5948:11: [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. penv = getenv (ename); data/gnucobol-4.0~early~20200606/libcob/common.c:6564: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. if ((env = getenv (value)) != NULL ) { data/gnucobol-4.0~early~20200606/libcob/common.c:6681: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. penv = getenv ("COB_CONFIG_DIR"); data/gnucobol-4.0~early~20200606/libcob/common.c:6781: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. if ((env = getenv ("COB_RUNTIME_CONFIG")) != NULL && env[0]) { data/gnucobol-4.0~early~20200606/libcob/common.c:6792: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. if ((env = getenv ("COB_CONFIG_DIR")) != NULL && env[0]) { data/gnucobol-4.0~early~20200606/libcob/common.c:7071:7: [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. p = getenv ("COB_UNIX_LF"); data/gnucobol-4.0~early~20200606/libcob/common.c:7503:11: [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. if ((s = getenv ("COB_VARSEQ_FORMAT")) != NULL) { data/gnucobol-4.0~early~20200606/libcob/common.c:7827:15: [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. localedir = getenv ("LOCALEDIR"); data/gnucobol-4.0~early~20200606/libcob/common.c:7843: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. char *s = getenv ("COB_UNIX_LF"); data/gnucobol-4.0~early~20200606/libcob/common.c:7999:7: [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. s = getenv (runtime_err_str); data/gnucobol-4.0~early~20200606/libcob/common.c:8073:7: [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 (realpath (path, s) != NULL) { data/gnucobol-4.0~early~20200606/libcob/common.c:8095:7: [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 (realpath (argv[0], s) != NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:774: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. if ((file_open_io_env = getenv (file_open_env)) == NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:778: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. file_open_io_env = getenv (file_open_env); data/gnucobol-4.0~early~20200606/libcob/fileio.c:781: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. file_open_io_env = getenv("IO_OPTIONS"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:790: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. if ((file_open_io_env = getenv (file_open_env)) == NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:792:27: [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. if ((file_open_io_env = getenv (file_open_env)) == NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:797:23: [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. file_open_io_env = getenv (file_open_env); data/gnucobol-4.0~early~20200606/libcob/fileio.c:803:27: [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. if ((file_open_io_env = getenv (file_open_env)) == NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:805:28: [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. if ((file_open_io_env = getenv (file_open_env)) == NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:810:24: [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. file_open_io_env = getenv (file_open_env); data/gnucobol-4.0~early~20200606/libcob/fileio.c:820: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. if ((p = getenv (file_open_env)) != NULL) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:833: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. if ((p = getenv (file_open_env)) != NULL) { data/gnucobol-4.0~early~20200606/libcob/flmdb.c:362:6: [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. if (getenv ("MDB_NO_LOCAL_FS_CHK") != NULL) { data/gnucobol-4.0~early~20200606/libcob/flmdb.c:873:6: [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. if (getenv("MDB_NO_SHARED_FS_CHK") == NULL) { data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:977:19: [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. else if ((sdir = getenv("COB_SCHEMA_DIR")) == NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1290: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. if ((sdir = getenv("COB_SCHEMA_DIR")) == NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1655: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. if( (env = getenv("COB_SCHEMA_NAME")) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1663: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. if( (env = getenv(envname)) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1674: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. if( (env = getenv(envname)) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1679: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. if( (env = getenv(envname)) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1684: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. if( (env = getenv(envname)) != NULL) { data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1692: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. if( (env = getenv(envname)) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1696: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. if( (env = getenv(envname)) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1701: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. if( (env = getenv(envname)) != NULL) data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1707:9: [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 = getenv(envname); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5128:3: [3] (random) srandom: 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. srandom ((unsigned int)seed); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5130: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 ((unsigned int)seed); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5136:17: [3] (random) random: 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. randnum = (int)random (); data/gnucobol-4.0~early~20200606/bin/cobcrun.c:83: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 cob_build_stamp[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/bin/cobcrun.c:84: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 month[64]; data/gnucobol-4.0~early~20200606/bin/cobcrun.c:193: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 env_space[COB_MEDIUM_BUFF], *envptr; data/gnucobol-4.0~early~20200606/bin/cobcrun.c:301:4: [2] (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). Risk is low because the source is a constant string. strcpy (argv[0], "cobcrun"); /* set for simple compare in test suite data/gnucobol-4.0~early~20200606/bin/gcdiff.c:73: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 referencefile[256] = ""; data/gnucobol-4.0~early~20200606/bin/gcdiff.c:74: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 testfile[256] = ""; data/gnucobol-4.0~early~20200606/bin/gcdiff.c:129: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 const char *days[7] = data/gnucobol-4.0~early~20200606/bin/gcdiff.c:132: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 const char *months[12] = data/gnucobol-4.0~early~20200606/bin/gcdiff.c:157: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(&tt, &templates[j], sizeof(struct template_t)); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:158: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(&templates[j], &templates[j+1],sizeof(struct template_t)); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:159: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(&templates[j+1], &tt, sizeof(struct template_t)); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:232: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 cob_build_stamp[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/bin/gcdiff.c:233: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 month[64]; data/gnucobol-4.0~early~20200606/bin/gcdiff.c:347: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 rbuf[4096], nbuf[4096]; data/gnucobol-4.0~early~20200606/bin/gcdiff.c:396:6: [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(&tval, (void*)ptm, sizeof(struct tm)); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:626:19: [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). time_tol = (int)atol(arg); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:673:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/gnucobol-4.0~early~20200606/bin/gcdiff.c:697:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ref = fopen("gcdiff.conf","r"); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:748: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). ref = fopen(referencefile,"r"); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:761:10: [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). rslt = fopen(testfile,"r"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:160:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char print_data[CB_PRINT_LEN + 1]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:175:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cb_listing_date[CB_LISTING_DATE_BUFF]; /* Date/Time buffer for listing */ data/gnucobol-4.0~early~20200606/cobc/cobc.c:314: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 cb_listing_filename[FILENAME_MAX]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:316: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 cb_listing_title[81]; /* Listing title (defaults to PACKAGE_NAME + Version */ data/gnucobol-4.0~early~20200606/cobc/cobc.c:317: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 cb_listing_header[133]; /* Listing header */ data/gnucobol-4.0~early~20200606/cobc/cobc.c:812: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 errmsg[BUFSIZ]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:940: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 (p, dupstr, n); data/gnucobol-4.0~early~20200606/cobc/cobc.c:960: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 (p, str1, m); data/gnucobol-4.0~early~20200606/cobc/cobc.c:961: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 (p + m, str2, n); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1017: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 (p, dupstr, n); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1036: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 (p, str1, m); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1037: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 (p + m, str2, n); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1079: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 (m->memptr, curr->memptr, curr->memlen); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1153: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 (p, dupstr, n); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1195: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 (m->memptr, curr->memptr, curr->memlen); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1268: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 (p, dupstr, n); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1438:3: [2] (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). Risk is low because the source is a constant string. strcpy ((char *)(name + 32), "..."); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1742: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_buff[COB_MEDIUM_BUFF]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2150: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 buff[16]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2151: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 versbuff[56]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2540: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 ext[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2677:4: [2] (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). Risk is low because the source is a constant string. strcpy (argv[0], "cobc"); /* set for simple compare in test suite data/gnucobol-4.0~early~20200606/cobc/cobc.c:2995:24: [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). cb_lines_per_page = atoi (cob_optarg); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3228: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 temp_buff[COB_MEDIUM_BUFF]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3899: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 *incl[100]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3900: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 *defs[100]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3901: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 *objs[100]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3902: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 *libs[100]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3903: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 *optc[100]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3904: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 *optl[100]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4028:4: [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 (buffptr, "INCDIR("); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4035: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 (buffptr, "' "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4037:4: [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 (buffptr, ") "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4040:4: [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 (buffptr, "DEFINE("); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4047: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 (buffptr, "' "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4049:4: [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 (buffptr, ") "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4051: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 (buffptr, "SYSIFCOPT(*IFSIO)"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4057:4: [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 (buffptr, " OPTIMIZE(40)"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4060:4: [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 (buffptr, " DBGVIEW(*ALL)"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4063:4: [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 (buffptr, " OUTPUT(*PRINT)"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4108: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 (buffptr, " BNDSRVPGM("); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4122: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 (buffptr, " EXPORT(*ALL)"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4273:10: [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. p += sprintf (p, "\\$"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4340: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). ppout = fopen(fn->preprocess, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4342: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). ppout = fopen(fn->preprocess, "w"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4369:22: [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). cb_listing_file = fopen (fn->listing_file, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4371:22: [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). cb_listing_file = fopen (fn->listing_file, "w"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4450:26: [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). cb_src_list_file = fopen (cb_listing_outputfile, "ab"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4452:26: [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). cb_src_list_file = fopen (cb_listing_outputfile, "a"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4482:2: [2] (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). Risk is low because the source is a constant string. strcpy (cb_listing_header, "LINE "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4484: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 (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4490: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 (cb_listing_header, "SEQUENCE"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4492: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 (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4498:4: [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 (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4501: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 (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4505:4: [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 (cb_listing_header, "........"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4513:2: [2] (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). Risk is low because the source is a constant string. strcpy (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4526:3: [2] (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). Risk is low because the source is a constant string. strcpy (cb_listing_header, "FUNCTION"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4528:3: [2] (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). Risk is low because the source is a constant string. strcpy (cb_listing_header, "LABEL "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4530:3: [2] (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). Risk is low because the source is a constant string. strcpy (cb_listing_header, "NAME "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4533: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 (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4536: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 (cb_listing_header, data/gnucobol-4.0~early~20200606/cobc/cobc.c:4540: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 (cb_listing_header, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4542: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 (cb_listing_header, "REFERENCES"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4558: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 version[30]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4658: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 picture_usage[CB_LIST_PICSIZE]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4691:3: [2] (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). Risk is low because the source is a constant string. strcpy (picture, "INVALID"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4736:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "INDEX"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4740:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "POINTER"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4743:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "ALPHANUMERIC"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4746:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "NATIONAL"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4749:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "BOOLEAN"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4752:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "NUMERIC"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4765:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "ALPHABETIC"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4769:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "ALPHANUMERIC"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4772:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "BOOLEAN"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4775:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "INDEX"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4779:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "NATIONAL"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4784:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "NUMERIC"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4787:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "OBJECT REF"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4791:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "POINTER"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4794:3: [2] (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). Risk is low because the source is a constant string. strcpy (type, "UNKNOWN"); /* LCOV_EXCL_LINE */ data/gnucobol-4.0~early~20200606/cobc/cobc.c:4814: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 lcl_name[LCL_NAME_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4834: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 type[20]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4835: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 picture[CB_LIST_PICSIZE]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4836: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 lcl_name[LCL_NAME_LEN]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4857:4: [2] (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). Risk is low because the source is a constant string. strcpy (type, "GROUP"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4881:13: [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. pd_off = sprintf (print_data, "????? "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4883:13: [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. pd_off = sprintf (print_data, "%05d ", top->size * top->occurs_max); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4885:13: [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. pd_off = sprintf (print_data, "%05d ", top->size); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4887:13: [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. pd_off += sprintf (print_data + pd_off, "%-14.14s %02d ", type, top->level); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4893:14: [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. pd_off += sprintf (print_data + pd_off, "%-30.30s ", lcl_name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4899:15: [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. pd_off += sprintf (print_data + pd_off, "OCCURS %d TO UNBOUNDED", top->occurs_min); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4901:15: [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. pd_off += sprintf (print_data + pd_off, "OCCURS %d TO %d", top->occurs_min, top->occurs_max); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4903:15: [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. pd_off += sprintf (print_data + pd_off, "OCCURS %d", top->occurs_max); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5084: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 (print_data + pd_off, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5092: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 (print_data + pd_off, "referenced by parent/child"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5094: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 (print_data + pd_off, "referenced by parent"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5096: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 (print_data + pd_off, "referenced by child"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5098: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 (print_data + pd_off, "not referenced"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5101: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 (print_data + pd_off, "not referenced"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5109:13: [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. pd_off += sprintf (print_data + pd_off, " %c%-6u", data/gnucobol-4.0~early~20200606/cobc/cobc.c:5116:14: [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. pd_off = sprintf (print_data, "%38.38s", " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5130: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 lcl_name[LCL_NAME_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/cobc.c:5134:12: [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. pd_off = sprintf (print_data, data/gnucobol-4.0~early~20200606/cobc/cobc.c:5145: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 lcl_name[LCL_NAME_LEN]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:5165:12: [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. pd_off = sprintf (print_data, "%-30.30s %-6u ", data/gnucobol-4.0~early~20200606/cobc/cobc.c:5194:12: [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. pd_off = sprintf (print_data, "%-30.30s %-6u ", data/gnucobol-4.0~early~20200606/cobc/cobc.c:5232: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 (print_data, "E %-28.28s %d", data/gnucobol-4.0~early~20200606/cobc/cobc.c:5241:13: [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. pd_off = sprintf (print_data, "%c %-28.28s %-6u ", data/gnucobol-4.0~early~20200606/cobc/cobc.c:5267:12: [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. pd_off = sprintf (print_data, "%c %-28.28s %-6.6s ", data/gnucobol-4.0~early~20200606/cobc/cobc.c:5285: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 err_msg[BUFSIZ]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:5572: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 in_line[CB_LINE_LENGTH + 2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:5905:18: [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. compare_prepare (char *cmp_line, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:5905:34: [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. compare_prepare (char *cmp_line, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6057:35: [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. make_new_continuation_line (const char *cfile_name, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6057:53: [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. make_new_continuation_line (const char *cfile_name, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6075:38: [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. add_token_over_multiple_lines (const char *cfile_name, data/gnucobol-4.0~early~20200606/cobc/cobc.c:6076: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. char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6123:42: [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. reflow_replaced_fixed_format_text (const char *cfile_name, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6123:60: [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. reflow_replaced_fixed_format_text (const char *cfile_name, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6130: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 token_terminator[2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6205:35: [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. reflow_replaced_free_format_text (char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6211: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 token_terminator[2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6246: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. reflow_replaced_text (const char *cfile_name, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6246:47: [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. reflow_replaced_text (const char *cfile_name, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6267:33: [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. struct list_replace *rep, char *pline[CB_READ_AHEAD], data/gnucobol-4.0~early~20200606/cobc/cobc.c:6287: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 lterm[2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6288: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 fterm[2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6289: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 ftoken[CB_LINE_LENGTH + 2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6290: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 tterm[2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6291: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 ttoken[CB_LINE_LENGTH + 2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6292: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 cmp_line[CB_LINE_LENGTH + 2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6293: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 from_line[CB_LINE_LENGTH + 2]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6563: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 (copy, src, sizeof (struct list_replace)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6598: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 *pline[CB_READ_AHEAD], int pline_cnt, int line_num) data/gnucobol-4.0~early~20200606/cobc/cobc.c:6610: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 tterm[2] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6611: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 ttoken[CB_LINE_LENGTH + 2] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6612: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 cmp_line[CB_LINE_LENGTH + 2] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6733: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 *pline[CB_READ_AHEAD] = { NULL }; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6777:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = fopen (cfile->name, "r"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6799:18: [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). line_num = atoi (&pline[0][6]); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6966: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). yyin = fopen (fn->preprocess, "r"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7046: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). yyout = fopen (fn->translate, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7048: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). yyout = fopen (fn->translate, "w"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7057:21: [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). cb_storage_file = fopen (cb_storage_file_name, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7059:21: [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). cb_storage_file = fopen (cb_storage_file_name, "w"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7068:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void *) cb_storage_file_name, (void *) buffer, strlen (buffer) + 1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7099:19: [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). lf->local_fp = fopen (lf->local_name, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7101:19: [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). lf->local_fp = fopen (lf->local_name, "w"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7175: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 (name, ".s"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7525: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 (cobc_objects_buffer, "\" "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7644: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 (cobc_objects_buffer, "\" "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7745: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 month[32]; data/gnucobol-4.0~early~20200606/cobc/cobc.c:8200:22: [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). cb_listing_file = fopen (cobc_list_file, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:8202:22: [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). cb_listing_file = fopen (cobc_list_file, "w"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:8215:24: [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). cb_src_list_file = fopen (cb_listing_outputfile, "wb"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:8217:24: [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). cb_src_list_file = fopen (cb_listing_outputfile, "w"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:182: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 last_line_num[80] = ""; data/gnucobol-4.0~early~20200606/cobc/codegen.c:1707: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 cb_source_file_cleaned[FILENAME_MAX]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:2757: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 text_cleaned[FILENAME_MAX]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:2796: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 text_cleaned[FILENAME_MAX]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:3576: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 fname[12]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:3858: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 (fname, "f%d", stack_id++); data/gnucobol-4.0~early~20200606/cobc/codegen.c:4930:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (litbuff, l->data, (size_t)size); data/gnucobol-4.0~early~20200606/cobc/codegen.c:4932:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (litbuff, l->data, (size_t)l->size); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8004:13: [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[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:8604: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 nxt[8]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:8605: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 features[128]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:8607: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 file_name[FNAME_SIZE], extname[FNAME_SIZE + 2]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:8684:3: [2] (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). Risk is low because the source is a constant string. strcpy (extname, "NULL"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8700: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 msg[80]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:9497: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 fname[64]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:9532:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"PAGE HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9534:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"PAGE HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9536:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"REPORT HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9538:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"REPORT FOOTING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9540:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9542:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL FOOTING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9544:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL FOOTING FINAL"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9546:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL HEADING FINAL"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9554:4: [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(fname," of "); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9644: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 fname[64]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:9677:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"PAGE HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9679:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"PAGE HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9681:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL HEADING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9683:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL FOOTING"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9685:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL FOOTING FINAL"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9687:4: [2] (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). Risk is low because the source is a constant string. strcpy(fname,"CONTROL HEADING FINAL"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:10522: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 wrk[64]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:10534: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(wrk,"module->next->cob_procedure_params[%d]->size",i); data/gnucobol-4.0~early~20200606/cobc/codegen.c:10628: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 wrk[64]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:10640: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(wrk,"module->next->cob_procedure_params[%d]->size",i); data/gnucobol-4.0~early~20200606/cobc/codegen.c:11743: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 fdname[48]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:12159: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. const char *s_type[MAX_CALL_FIELD_PARAMS]; data/gnucobol-4.0~early~20200606/cobc/codegen.c:12659: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 buff[COB_MEDIUM_BUFF]; data/gnucobol-4.0~early~20200606/cobc/config.c:182:6: [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). v = atol (val); data/gnucobol-4.0~early~20200606/cobc/config.c:215: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 word_buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/config.c:265: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 buff[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/cobc/config.c:266: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 filename[COB_NORMAL_BUFF]; data/gnucobol-4.0~early~20200606/cobc/config.c:325:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (conf_file, "r"); data/gnucobol-4.0~early~20200606/cobc/config.c:367: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 buff[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/cobc/config.c:410: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 buff[COB_NORMAL_BUFF]; data/gnucobol-4.0~early~20200606/cobc/config.c:468:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (words_file, "r"); data/gnucobol-4.0~early~20200606/cobc/config.c:488: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 *val, valx[24]; data/gnucobol-4.0~early~20200606/cobc/config.c:771: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(valx,"%ld",atol(val)*1024); data/gnucobol-4.0~early~20200606/cobc/config.c:771:24: [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). sprintf(valx,"%ld",atol(val)*1024); data/gnucobol-4.0~early~20200606/cobc/config.c:776: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(valx,"%ld",atol(val)*1024*1024); data/gnucobol-4.0~early~20200606/cobc/config.c:776:24: [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). sprintf(valx,"%ld",atol(val)*1024*1024); data/gnucobol-4.0~early~20200606/cobc/config.c:781: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(valx,"%ld",atol(val)*1024*1024*1024); data/gnucobol-4.0~early~20200606/cobc/config.c:781:24: [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). sprintf(valx,"%ld",atol(val)*1024*1024*1024); data/gnucobol-4.0~early~20200606/cobc/error.c:72: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 errmsg[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/cobc/error.c:674:4: [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 (errnamebuff, " IN "); data/gnucobol-4.0~early~20200606/cobc/error.c:713:4: [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 (errnamebuff, " IN "); data/gnucobol-4.0~early~20200606/cobc/error.c:727: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 (errnamebuff, " IN "); data/gnucobol-4.0~early~20200606/cobc/error.c:734: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 (errnamebuff, " IN "); data/gnucobol-4.0~early~20200606/cobc/field.c:58: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 op_type [CB_MAX_OPS+1]; data/gnucobol-4.0~early~20200606/cobc/field.c:59: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 op_prec [CB_MAX_OPS+1]; data/gnucobol-4.0~early~20200606/cobc/field.c:231: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 result[48]; data/gnucobol-4.0~early~20200606/cobc/field.c:356:9: [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). return atoi (CB_NAME (x)); data/gnucobol-4.0~early~20200606/cobc/field.c:674: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 (target, source, sizeof (struct cb_field)); data/gnucobol-4.0~early~20200606/cobc/field.c:799: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 pic[24]; data/gnucobol-4.0~early~20200606/cobc/field.c:861: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 (pic, "9(%d)", size_implied); data/gnucobol-4.0~early~20200606/cobc/field.c:863: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 (pic, "X(%d)", size_implied); data/gnucobol-4.0~early~20200606/cobc/field.c:871: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 (pic, "X(%d)", size_implied); data/gnucobol-4.0~early~20200606/cobc/field.c:895:11: [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. pp += sprintf (pp, "9(%d)", size_implied); data/gnucobol-4.0~early~20200606/cobc/field.c:898: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 (pp, "V9(%d)", lp->scale); data/gnucobol-4.0~early~20200606/cobc/field.c:908: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 (pic, "X(%d)", (int)lp->size); data/gnucobol-4.0~early~20200606/cobc/field.c:953: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 (pic, "9(%d)", size_implied); data/gnucobol-4.0~early~20200606/cobc/field.c:955: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 (pic, "X(%d)", size_implied); data/gnucobol-4.0~early~20200606/cobc/field.c:2161: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 pic[8]; data/gnucobol-4.0~early~20200606/cobc/field.c:2162: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 (pic, "9(%d)", pic_digits[f->pic->size - 1]); data/gnucobol-4.0~early~20200606/cobc/help.c:192: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 buff[78]; data/gnucobol-4.0~early~20200606/cobc/parser.c:220: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 const char *stack_progid[PROG_DEPTH]; data/gnucobol-4.0~early~20200606/cobc/parser.c:420: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 buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/parser.c:524: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 buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/parser.c:567: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 terminator[32]; data/gnucobol-4.0~early~20200606/cobc/parser.c:594: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 terminator[32]; data/gnucobol-4.0~early~20200606/cobc/parser.c:973: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 message[MESSAGE_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/parser.c:11866: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/gnucobol-4.0~early~20200606/cobc/parser.c:12053: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 yymsgbuf[128]; data/gnucobol-4.0~early~20200606/cobc/parser.c:15998:45: [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. current_field->ename = cb_to_cname ((const char *)CB_LITERAL ((yyvsp[0]))->data); data/gnucobol-4.0~early~20200606/cobc/parser.c:18969: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 name[32]; data/gnucobol-4.0~early~20200606/cobc/parser.c:19235: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 name[32]; data/gnucobol-4.0~early~20200606/cobc/parser.c:19238: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 (name, "L$%d", next_label_id); data/gnucobol-4.0~early~20200606/cobc/parser.c:22016: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. if (!cobc_check_valid_name ((char *)(CB_LITERAL ((yyvsp[-2]))->data), ENTRY_NAME)) { data/gnucobol-4.0~early~20200606/cobc/parser.c:22017:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. emit_entry ((char *)(CB_LITERAL ((yyvsp[-2]))->data), 1, (yyvsp[0]), call_conv); data/gnucobol-4.0~early~20200606/cobc/parser.c:22028:21: [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. emit_entry_goto ((char *)(CB_LITERAL ((yyvsp[0]))->data)); data/gnucobol-4.0~early~20200606/cobc/parser.c:22486: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 name[64]; data/gnucobol-4.0~early~20200606/cobc/parser.c:22494: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 (name, "EXIT PERFORM CYCLE %d", cb_id); data/gnucobol-4.0~early~20200606/cobc/parser.c:22513: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 name[64]; data/gnucobol-4.0~early~20200606/cobc/parser.c:22521: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 (name, "EXIT PERFORM %d", cb_id); data/gnucobol-4.0~early~20200606/cobc/parser.c:22539: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 name[64]; data/gnucobol-4.0~early~20200606/cobc/parser.c:22546: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 (name, "EXIT SECTION %d", cb_id); data/gnucobol-4.0~early~20200606/cobc/parser.c:22564: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 name[64]; data/gnucobol-4.0~early~20200606/cobc/parser.c:22571: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 (name, "EXIT PARAGRAPH %d", cb_id); data/gnucobol-4.0~early~20200606/cobc/parser.c:25638: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 name[64]; data/gnucobol-4.0~early~20200606/cobc/parser.c:25662: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 (name, "EXIT SECTION %d", cb_id); data/gnucobol-4.0~early~20200606/cobc/parser.c:27399:33: [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. (yyval) = cb_build_reference ((char *)(CB_LITERAL ((yyvsp[0]))->data)); data/gnucobol-4.0~early~20200606/cobc/parser.c:27442:33: [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. (yyval) = cb_build_reference ((char *)(CB_LITERAL ((yyvsp[0]))->data)); data/gnucobol-4.0~early~20200606/cobc/pplex.c:2939: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 display_msg[PPLEX_BUFF_LEN]; data/gnucobol-4.0~early~20200606/cobc/pplex.c:5458: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. unsigned char bom[4]; data/gnucobol-4.0~early~20200606/cobc/pplex.c:5493: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). ppin = fopen (name, "r"); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5495: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). ppin = fopen (name, "rb"); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5870: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 *bp, qt, wrk[256]; data/gnucobol-4.0~early~20200606/cobc/pplex.c:6417: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 (tp, text, size); data/gnucobol-4.0~early~20200606/cobc/ppparse.c:1702: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:1889: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 yymsgbuf[128]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:3700:23: [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 const unsigned char cob_lower_tab[256] = { data/gnucobol-4.0~early~20200606/cobc/reserved.c:3729:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char cob_lower_tab[256]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:3934:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char upper_word[43]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:4339: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 (*aliases)[COB_MAX_WORDLEN + 1]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:4381:2: [2] (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). Risk is low because the source is a constant string. strcpy (aliases_str, "(aliased with "); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4384:4: [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 (aliases_str, ", "); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4436: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 system_name[COB_MAX_WORDLEN + 1]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:4644:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char upper_name[43]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:4712: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 argnum [20]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:4745:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char upper_name[43]; data/gnucobol-4.0~early~20200606/cobc/reserved.c:4888: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 name_display[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/scanner.c:1545: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 err_msg[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/scanner.c:2182: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 type[3] = "x#"; data/gnucobol-4.0~early~20200606/cobc/scanner.c:2217: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). value = atoi (yytext); data/gnucobol-4.0~early~20200606/cobc/scanner.c:2999: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 suffix[3] = ""; data/gnucobol-4.0~early~20200606/cobc/scanner.c:3000: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 name[10] = ""; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4285: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 lit_out[39]; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4297:5: [2] (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). Risk is low because the source is a constant string. strcpy (lit_out + 35, "..."); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4445: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 (plex_buff, text, curr_len); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4495:6: [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 (plex_buff, text, curr_len + 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4527:6: [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 (plex_buff, text, curr_len + 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4551: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 (plex_buff, text, curr_len + 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4601: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 (plex_buff, text, currlen); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4633: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 (plex_buff, text, currlen + 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4735: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 (plex_buff, text, currlen + 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4808: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 (plex_buff, text, currlen + 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4846: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 xbuff[19]; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4847: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 ((char *)&xbuff, "'%X'", (unsigned int)val); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4968: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 significand_str[COB_FLOAT_DIGITS_STR_MAX] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4970: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 significand_dec[COB_FLOAT_DIGITS_STR_MAX] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4971: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 significand_int[COB_FLOAT_DIGITS_STR_MAX] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4972: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 exponent_str[8] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4975: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 result[128] = { '\0' }; data/gnucobol-4.0~early~20200606/cobc/scanner.c:5210: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 (x, l, sizeof (struct cb_literal)); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:40: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 xfd[MAX_XFD][80]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:44: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 dateformat[MAX_DATE][40]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:47: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 eol[6] = ""; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:48: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 prefix[8] = ""; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:310: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 *p, p1[64], p2[64], p3[64], p4[64], *pw, expr[COB_NORMAL_BUFF]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:516:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char name[85]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:545:9: [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. j += sprintf(&name[j],"_%02d",idx[i]); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:550: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(name,"_x"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:562:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char datatype[85]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:564: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(datatype,"BINARY(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:567: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(datatype,"CHAR(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:570: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(datatype,"VARCHAR(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:573: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(datatype,"CHAR(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:576: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(datatype,"DECIMAL(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:579: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(datatype,"DATE"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:590:6: [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(datatype,"DECIMAL(%d,%d)",f->pic->digits,f->pic->scale); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:592:6: [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(datatype,"DECIMAL(%d)",f->pic->digits); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:594: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(datatype,"DECIMAL(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:601:6: [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(datatype,"DECIMAL(%d,%d)",f->pic->digits,f->pic->scale); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:603:6: [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(datatype,"DECIMAL(%d)",f->pic->digits); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:605: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(datatype,"CHAR(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:624: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(datatype,"CHAR(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:635:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char datatype[85]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:738: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(datatype,"%02d,%04d",sqltype,sqlsz); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:776:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char wrk[256]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:777: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 lop[80],rop[80],opcd[32]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:812: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 partexp[MAX_NEST][68], *p; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:947: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 expr[COB_NORMAL_BUFF], name[80]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1160:4: [2] (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). Risk is low because the source is a constant string. strcpy(eol,",\n"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1171:4: [2] (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). Risk is low because the source is a constant string. strcpy(eol,",\n"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1217: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 outname[COB_FILE_BUFF], tblname[64], time_stamp[32]; data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1253:3: [2] (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). Risk is low because the source is a constant string. strcpy(time_stamp,"Time unknown"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1271: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(tblname,"%.*s",ln,p); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1327:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fx = fopen (outname, "wb"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1329:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fx = fopen (outname, "w"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1337:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fs = fopen (outname, "wb"); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1339:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fs = fopen (outname, "w"); data/gnucobol-4.0~early~20200606/cobc/tree.c:134: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 err_msg[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/tree.c:896: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 (p->data, ldata, lsize); data/gnucobol-4.0~early~20200606/cobc/tree.c:897: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 (p->data + lsize, rdata, rsize); data/gnucobol-4.0~early~20200606/cobc/tree.c:1164: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 (p->data, data, size); data/gnucobol-4.0~early~20200606/cobc/tree.c:1172: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 tmp[COB_SMALL_BUFF] = { 0 }; data/gnucobol-4.0~early~20200606/cobc/tree.c:1179: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 tmp2[40] = { 0 }; data/gnucobol-4.0~early~20200606/cobc/tree.c:1181:4: [2] (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). Risk is low because the source is a constant string. strcpy (tmp + 36, "..."); data/gnucobol-4.0~early~20200606/cobc/tree.c:1198: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 tmp[COB_NORMAL_BUFF] = { 0 }; data/gnucobol-4.0~early~20200606/cobc/tree.c:1604: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 lit_out[39]; data/gnucobol-4.0~early~20200606/cobc/tree.c:1609:3: [2] (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). Risk is low because the source is a constant string. strcpy (lit_out + 35, "..."); data/gnucobol-4.0~early~20200606/cobc/tree.c:2505: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 lit_out[39]; data/gnucobol-4.0~early~20200606/cobc/tree.c:2530:3: [2] (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). Risk is low because the source is a constant string. strcpy (lit_out + 35, "..."); data/gnucobol-4.0~early~20200606/cobc/tree.c:3113: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 err_chars[10] = { 0 }; data/gnucobol-4.0~early~20200606/cobc/tree.c:3217: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 symbol[2] = { 0 }; data/gnucobol-4.0~early~20200606/cobc/tree.c:3532: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 (pic->str, pic_buff, idx * sizeof(cob_pic_symbol)); data/gnucobol-4.0~early~20200606/cobc/tree.c:3538: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 (pic->str, pic_buff, idx * sizeof(cob_pic_symbol)); data/gnucobol-4.0~early~20200606/cobc/tree.c:3547: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 (pic->str, pic_buff, idx * sizeof(cob_pic_symbol)); data/gnucobol-4.0~early~20200606/cobc/tree.c:3586: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 pic[32]; data/gnucobol-4.0~early~20200606/cobc/tree.c:3614: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 buff[COB_MINI_BUFF], pic[30]; data/gnucobol-4.0~early~20200606/cobc/tree.c:3622: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(pic,"X(%d)",cb_get_int(ref->length)); data/gnucobol-4.0~early~20200606/cobc/tree.c:3629: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(pic,"SV9(%d)",dec); data/gnucobol-4.0~early~20200606/cobc/tree.c:3631: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(pic,"SP(%d)V9(%d)",-(dig-dec),dec); data/gnucobol-4.0~early~20200606/cobc/tree.c:3633: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(pic,"S9(%d)V9(%d)",dig-dec,dec); data/gnucobol-4.0~early~20200606/cobc/tree.c:3636: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(pic,"S9(%d)",dig); data/gnucobol-4.0~early~20200606/cobc/tree.c:3639: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(pic,"X(%d)",f->size); data/gnucobol-4.0~early~20200606/cobc/tree.c:3808: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. unsigned char buff[4]; data/gnucobol-4.0~early~20200606/cobc/tree.c:3841: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 buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/tree.c:3879: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 buff[COB_MINI_BUFF],pic[30]; data/gnucobol-4.0~early~20200606/cobc/tree.c:3901: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(pic,"SV9(%d)",dec); data/gnucobol-4.0~early~20200606/cobc/tree.c:3903: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(pic,"SP(%d)V9(%d)",-(dig-dec),dec); data/gnucobol-4.0~early~20200606/cobc/tree.c:3905: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(pic,"S9(%d)V9(%d)",dig-dec,dec); data/gnucobol-4.0~early~20200606/cobc/tree.c:3908: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(pic,"S9(%d)",dig); data/gnucobol-4.0~early~20200606/cobc/tree.c:4205: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 pic[32]; data/gnucobol-4.0~early~20200606/cobc/tree.c:4234: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 (pic, "X(%d)", cb); data/gnucobol-4.0~early~20200606/cobc/tree.c:4545: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 name[20]; data/gnucobol-4.0~early~20200606/cobc/tree.c:4547: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 (name, "FILLER %d", filler_id++); data/gnucobol-4.0~early~20200606/cobc/tree.c:4567: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 (x, ref, sizeof (struct cb_reference)); data/gnucobol-4.0~early~20200606/cobc/tree.c:4883: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 lit_disp[COB_MAX_DIGITS + 2]; data/gnucobol-4.0~early~20200606/cobc/tree.c:5242: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 result[48]; data/gnucobol-4.0~early~20200606/cobc/tree.c:6264: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 result[64]; data/gnucobol-4.0~early~20200606/cobc/tree.c:6479:10: [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. if (sprintf(result, "%.*f", k, drslt) < 40) data/gnucobol-4.0~early~20200606/cobc/tree.h:35:9: [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). #ifndef atol data/gnucobol-4.0~early~20200606/cobc/tree.h:36:9: [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). #define atol(x) strtol(x, NULL, 10) data/gnucobol-4.0~early~20200606/cobc/typeck.c:137:23: [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 const unsigned char expr_prio[256] = { data/gnucobol-4.0~early~20200606/cobc/typeck.c:158:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char expr_prio[256]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:163:23: [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 const unsigned char cob_refer_ascii[256] = { data/gnucobol-4.0~early~20200606/cobc/typeck.c:199:23: [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 const unsigned char cob_refer_ebcdic[256] = { data/gnucobol-4.0~early~20200606/cobc/typeck.c:1077: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 buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:1140: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 (buff, " OF "); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1286: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 buff[32]; /* 32: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/cobc/typeck.c:1333: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 definition[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:1334: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[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:1595: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 buff[36]; /* 36: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/cobc/typeck.c:1664: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. unsigned char buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:1942:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char full_name[COB_MAX_WORDLEN * 2 + 10]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:2305: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 buff[32]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:2315: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 (buff, "%d", CB_LITERAL(x)->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2397: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 buff[32]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:2473: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 buff[32]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:2543: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 buff[32]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:2711: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 errmsg[256]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:2913:8: [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(&errmsg[i], ", ..."); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2918:8: [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(&errmsg[i], ", "); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2924:8: [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(&errmsg[i], "x'%02x'", n); data/gnucobol-4.0~early~20200606/cobc/typeck.c:3457: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 buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:6193: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 buff[32]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:6214: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 (buff, "%d", i); data/gnucobol-4.0~early~20200606/cobc/typeck.c:6903: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 buff[32]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:6941: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 (buff, "%d", CB_FIELD_PTR (target1)->memory_size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:7219: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 xname[7]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:7223:6: [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 (xname, "X\"%2X\"", (unsigned char)psyst->syst_name[0]); data/gnucobol-4.0~early~20200606/cobc/typeck.c:8215: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 sbuf[16]; data/gnucobol-4.0~early~20200606/cobc/typeck.c:10136: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 (buff, l->data - diff, (size_t)f->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:10139: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 (buff + diff, l->data, (size_t)l->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:10170:6: [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 (buff, l->data - diff, (size_t)f->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:10173:6: [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 (buff + diff, l->data, (size_t)l->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:10177:6: [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 (buff, l->data, (size_t)f->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:10179:6: [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 (buff, l->data, (size_t)l->size); data/gnucobol-4.0~early~20200606/cobc/typeck.c:10534: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). bgnpos = atoi((const char*)lt->data); data/gnucobol-4.0~early~20200606/cobc/typeck.c:12683: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 (copy, namespace->data, size); data/gnucobol-4.0~early~20200606/lib/gettext.h:218: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 msg_ctxt_id[msgctxt_len + msgid_len]; data/gnucobol-4.0~early~20200606/lib/gettext.h:220: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 buf[1024]; data/gnucobol-4.0~early~20200606/lib/gettext.h:229: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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/gnucobol-4.0~early~20200606/lib/gettext.h:231: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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/gnucobol-4.0~early~20200606/lib/gettext.h:266: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 msg_ctxt_id[msgctxt_len + msgid_len]; data/gnucobol-4.0~early~20200606/lib/gettext.h:268: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 buf[1024]; data/gnucobol-4.0~early~20200606/lib/gettext.h:277: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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/gnucobol-4.0~early~20200606/lib/gettext.h:279: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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/gnucobol-4.0~early~20200606/libcob/call.c:83: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 errbuf[64]; data/gnucobol-4.0~early~20200606/libcob/call.c:87: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(errbuf, _("LoadLibrary/GetProcAddress error %d"), (int)GetLastError()); data/gnucobol-4.0~early~20200606/libcob/call.c:197:23: [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 const unsigned char valid_char[256] = { data/gnucobol-4.0~early~20200606/libcob/call.c:264:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char valid_char[256]; data/gnucobol-4.0~early~20200606/libcob/call.c:706: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 call_entry_buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/libcob/call.c:707: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 call_entry2_buff[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/libcob/call.c:1991:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (char_field, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/call.c:2013: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 (f->data, char_field, len); data/gnucobol-4.0~early~20200606/libcob/call.c:2020:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)t, (void*)f, sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/call.c:2021:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)a, (void*)f->attr, sizeof(cob_field_attr)); data/gnucobol-4.0~early~20200606/libcob/call.c:2032:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)t, (void*)f, sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/call.c:2033:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)a, (void*)f->attr, sizeof(cob_field_attr)); data/gnucobol-4.0~early~20200606/libcob/call.c:2044:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)t, (void*)f, sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/call.c:2045:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)a, (void*)f->attr, sizeof(cob_field_attr)); data/gnucobol-4.0~early~20200606/libcob/coblocal.h:49:9: [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). #ifndef atol data/gnucobol-4.0~early~20200606/libcob/coblocal.h:50:9: [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). #define atol(x) strtol(x, NULL, 10) data/gnucobol-4.0~early~20200606/libcob/common.c:238: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 cob_debug_modules[DEBUG_MOD_MAX][DEBUG_MOD_LEN+1] = data/gnucobol-4.0~early~20200606/libcob/common.c:327: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 varrel_dflt[8] = "gc"; /* Default Variable length Relative file format */ data/gnucobol-4.0~early~20200606/libcob/common.c:328: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 fixrel_dflt[8] = "gc"; /* Default Fixed length Relative file format */ data/gnucobol-4.0~early~20200606/libcob/common.c:333: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 varseq_dflt[8] = "0"; /* varseq0: Default Variable length Sequential file format */ data/gnucobol-4.0~early~20200606/libcob/common.c:557: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 (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:561:6: [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 (data, &str, sizeof (char *)); /* Reset pointer to NULL */ data/gnucobol-4.0~early~20200606/libcob/common.c:705: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 reason[80]; data/gnucobol-4.0~early~20200606/libcob/common.c:1401: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). return fopen (filename, mode); data/gnucobol-4.0~early~20200606/libcob/common.c:1660: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 (mptr, optr, osize); data/gnucobol-4.0~early~20200606/libcob/common.c:1701: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 (mptr, p, len); data/gnucobol-4.0~early~20200606/libcob/common.c:1737:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (mptr, cache_ptr->cob_pointer, cache_ptr->size); data/gnucobol-4.0~early~20200606/libcob/common.c:1875: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 val[60]; data/gnucobol-4.0~early~20200606/libcob/common.c:1905: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 val[60]; data/gnucobol-4.0~early~20200606/libcob/common.c:1935: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 val[60]; data/gnucobol-4.0~early~20200606/libcob/common.c:1962: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 val[60]; data/gnucobol-4.0~early~20200606/libcob/common.c:1989: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 val[60]; data/gnucobol-4.0~early~20200606/libcob/common.c:2037: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 (&tmptr, srcptr, sizeof (void *)); data/gnucobol-4.0~early~20200606/libcob/common.c:2773: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. unsigned char buff[256]; data/gnucobol-4.0~early~20200606/libcob/common.c:2839: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 (&fval.fpf, f->data, sizeof (float)); data/gnucobol-4.0~early~20200606/libcob/common.c:2842: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 (&fval.fpd, f->data, sizeof (double)); data/gnucobol-4.0~early~20200606/libcob/common.c:3071:11: [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. p += sprintf (p, "\\%03o", data[i]); data/gnucobol-4.0~early~20200606/libcob/common.c:3075:9: [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. p += sprintf (p, "0x"); data/gnucobol-4.0~early~20200606/libcob/common.c:3077:10: [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. p += sprintf (p, "%02x", data[i]); data/gnucobol-4.0~early~20200606/libcob/common.c:3433: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 iso_timezone[7] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/common.c:3434: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 nanoseconds[10]; data/gnucobol-4.0~early~20200606/libcob/common.c:3631:3: [2] (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). Risk is low because the source is a constant string. strcpy (nanoseconds, "000000000"); data/gnucobol-4.0~early~20200606/libcob/common.c:3643:8: [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). ns = atoi(nanoseconds); data/gnucobol-4.0~early~20200606/libcob/common.c:3655:4: [2] (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). Risk is low because the source is a constant string. strcpy (iso_timezone_ptr + 3, "00"); data/gnucobol-4.0~early~20200606/libcob/common.c:3772: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 buff[16]; /* 16: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/libcob/common.c:3788: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 buff[16]; /* 16: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/libcob/common.c:3804: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 buff[11]; /* 11: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/libcob/common.c:3818: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 buff[11]; /* 11: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/libcob/common.c:3843: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 buff[21]; /* 11: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/libcob/common.c:3864: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 (commlnptr, f->data, commlncnt); data/gnucobol-4.0~early~20200606/libcob/common.c:3897: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 (buff + size, cob_argv[i], len); data/gnucobol-4.0~early~20200606/libcob/common.c:4119:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (data, cob_argv[parm], len); data/gnucobol-4.0~early~20200606/libcob/common.c:4121:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (data, cob_argv[parm], size); data/gnucobol-4.0~early~20200606/libcob/common.c:4365:5: [2] (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). Risk is low because the source is a constant string. strcpy (tmp, "/tmp"); data/gnucobol-4.0~early~20200606/libcob/common.c:4492: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 (&p, &pptr, sizeof (void *)); data/gnucobol-4.0~early~20200606/libcob/common.c:4537: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 (&p, &pptr, sizeof (void *)); data/gnucobol-4.0~early~20200606/libcob/common.c:4608: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 (buff + 1, cmd, (size_t)i + 1); data/gnucobol-4.0~early~20200606/libcob/common.c:4613: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 (buff, cmd, (size_t)i + 1); data/gnucobol-4.0~early~20200606/libcob/common.c:5342: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 (data, COB_MODULE_PTR->next->module_name, msize); data/gnucobol-4.0~early~20200606/libcob/common.c:5447: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 (&longoptions->flag, l->return_value_pointer, sizeof (l->return_value_pointer)); data/gnucobol-4.0~early~20200606/libcob/common.c:5448: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 (&longoptions->val, &l->return_value, 4); data/gnucobol-4.0~early~20200606/libcob/common.c:5505: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 (return_char, &return_value, 4); data/gnucobol-4.0~early~20200606/libcob/common.c:5516: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 (opt_val, cob_optarg, optlen); data/gnucobol-4.0~early~20200606/libcob/common.c:5714: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 (number, "%i", i); data/gnucobol-4.0~early~20200606/libcob/common.c:5836: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 dflt[40]; data/gnucobol-4.0~early~20200606/libcob/common.c:5857: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 dflt[40]; data/gnucobol-4.0~early~20200606/libcob/common.c:5870: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 dflt[40]; data/gnucobol-4.0~early~20200606/libcob/common.c:5928: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 ename[128] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/common.c:5989:9: [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. j += sprintf(&env[j],"%d",cob_sys_getpid()); data/gnucobol-4.0~early~20200606/libcob/common.c:6044:10: [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). return atoi (ptr); /* 0 or 1 */ data/gnucobol-4.0~early~20200606/libcob/common.c:6083:20: [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. ptr = value = (char *)gc_conf[pos].enums[i].value; data/gnucobol-4.0~early~20200606/libcob/common.c:6099: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. fprintf (stderr, "%s", (char *)gc_conf[pos].enums[i].match); data/gnucobol-4.0~early~20200606/libcob/common.c:6101: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. fprintf (stderr, "(%s)", (char *)gc_conf[pos].enums[i].value); data/gnucobol-4.0~early~20200606/libcob/common.c:6228: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 (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6240: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 (data, &str, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6251: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 (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6256: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 (data, &str, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6272: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 (data, value, slen); data/gnucobol-4.0~early~20200606/libcob/common.c:6325:2: [2] (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). Risk is low because the source is a constant string. strcpy (value, _("unknown")); data/gnucobol-4.0~early~20200606/libcob/common.c:6342: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 (value, "%.2f GB", dval / (1024.0 * 1024.0 * 1024.0)); data/gnucobol-4.0~early~20200606/libcob/common.c:6348: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 (value, "%.2f MB", dval / (1024.0 * 1024.0)); data/gnucobol-4.0~early~20200606/libcob/common.c:6354: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 (value, "%.2f KB", dval / 1024.0); data/gnucobol-4.0~early~20200606/libcob/common.c:6366:4: [2] (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). Risk is low because the source is a constant string. strcpy (value, _("yes")); data/gnucobol-4.0~early~20200606/libcob/common.c:6368:4: [2] (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). Risk is low because the source is a constant string. strcpy (value, _("no")); data/gnucobol-4.0~early~20200606/libcob/common.c:6373: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 (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6390: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 (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6399: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 (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6408:4: [2] (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). Risk is low because the source is a constant string. strcpy (value, "Nul"); data/gnucobol-4.0~early~20200606/libcob/common.c:6412: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 (value, "0x%02X", *(char *)data); data/gnucobol-4.0~early~20200606/libcob/common.c:6476: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 keyword[COB_MINI_BUFF], value[COB_SMALL_BUFF], value2[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/libcob/common.c:6600:21: [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. set_config_val ((char *)gc_conf[i].default_val, i); data/gnucobol-4.0~early~20200606/libcob/common.c:6605:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&str, data, sizeof (char *)); data/gnucobol-4.0~early~20200606/libcob/common.c:6610:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (data, &str, sizeof (char *)); /* Reset pointer to NULL */ data/gnucobol-4.0~early~20200606/libcob/common.c:6650: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 buff[COB_FILE_BUFF-10], filename[COB_FILE_BUFF]; data/gnucobol-4.0~early~20200606/libcob/common.c:6708: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). conf_fd = fopen (config_file, "r"); data/gnucobol-4.0~early~20200606/libcob/common.c:6776: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 conf_file[COB_MEDIUM_BUFF]; data/gnucobol-4.0~early~20200606/libcob/common.c:6806: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 (varseq_dflt, "%d", WITH_VARSEQ); /* Default comes from config.h */ data/gnucobol-4.0~early~20200606/libcob/common.c:6830:23: [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. set_config_val ((char *)gc_conf[i].default_val, i); data/gnucobol-4.0~early~20200606/libcob/common.c:6833:22: [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. set_config_val ((char *)gc_conf[i].default_val, i); /* Set default value */ data/gnucobol-4.0~early~20200606/libcob/common.c:6944: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 reason[80]; data/gnucobol-4.0~early~20200606/libcob/common.c:7294: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 cob_build_stamp[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/libcob/common.c:7295: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 month[64]; data/gnucobol-4.0~early~20200606/libcob/common.c:7332: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 buff[16]; data/gnucobol-4.0~early~20200606/libcob/common.c:7333: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 versbuff[56] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/common.c:7346: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 versbuff2[115]; data/gnucobol-4.0~early~20200606/libcob/common.c:7633: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 value[COB_MEDIUM_BUFF], orgvalue[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/libcob/common.c:7675:2: [2] (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). Risk is low because the source is a constant string. strcpy (value, "todo"); data/gnucobol-4.0~early~20200606/libcob/common.c:7998: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 (runtime_err_str, "COB_SWITCH_%d", i); data/gnucobol-4.0~early~20200606/libcob/common.c:8180:30: [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). cobsetptr->cob_dump_file = fopen (cobsetptr->cob_dump_filename, "a"); data/gnucobol-4.0~early~20200606/libcob/common.c:8198:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(cobsetptr->cob_dump_filename, "a"); data/gnucobol-4.0~early~20200606/libcob/common.c:8337: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 module_name[4]; data/gnucobol-4.0~early~20200606/libcob/common.c:8339: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 logfile[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/libcob/common.c:8423: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 (logfile, "cob_debug_log.%d", cob_sys_getpid()); data/gnucobol-4.0~early~20200606/libcob/common.c:8540: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 lastWord[4]; data/gnucobol-4.0~early~20200606/libcob/common.c:8541: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 hex[dMaxHex+4],chr[dMaxPerLine+4]; data/gnucobol-4.0~early~20200606/libcob/common.c:8549:9: [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. k += sprintf(&hex[k],"%02X",mem[i+j]&0xFF); data/gnucobol-4.0~early~20200606/libcob/common.c:8566:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( (char *)lastWord, (char *)&mem[i+dMaxPerLine-4], j<4?j:4); data/gnucobol-4.0~early~20200606/libcob/common.h:464:29: [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 optim_memcpy(x,y,z) memcpy (x, y, z) data/gnucobol-4.0~early~20200606/libcob/common.h:1274: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. unsigned char data[8]; data/gnucobol-4.0~early~20200606/libcob/common.h:1369: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. unsigned char unused[1]; /* Use these flags up later, added for alignment */ data/gnucobol-4.0~early~20200606/libcob/common.h:1478: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. unsigned char file_status[4]; /* FILE STATUS */ data/gnucobol-4.0~early~20200606/libcob/common.h:1888: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 name[25]; data/gnucobol-4.0~early~20200606/libcob/common.h:1890: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 return_value_pointer[sizeof(char*)]; data/gnucobol-4.0~early~20200606/libcob/common.h:1891: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 return_value[4]; data/gnucobol-4.0~early~20200606/libcob/common.h:2236: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. unsigned char count[2]; /* Component count */ data/gnucobol-4.0~early~20200606/libcob/common.h:2237: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. unsigned char offset[2]; /* Offset to components */ data/gnucobol-4.0~early~20200606/libcob/common.h:2247: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. unsigned char reserved[9]; data/gnucobol-4.0~early~20200606/libcob/common.h:2251: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. unsigned char kdbLen[2]; data/gnucobol-4.0~early~20200606/libcob/common.h:2252: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 filler[4]; data/gnucobol-4.0~early~20200606/libcob/common.h:2253: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. unsigned char nkeys[2]; data/gnucobol-4.0~early~20200606/libcob/common.h:2254: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 filler2[6]; data/gnucobol-4.0~early~20200606/libcob/common.h:2261: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. unsigned char pos[4]; /* Position in record */ data/gnucobol-4.0~early~20200606/libcob/common.h:2262: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. unsigned char len[4]; /* length of key component */ data/gnucobol-4.0~early~20200606/libcob/common.h:2275: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 filler[8]; \ data/gnucobol-4.0~early~20200606/libcob/common.h:2302: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. unsigned char fileStatus[2]; /* I/O completion status */ data/gnucobol-4.0~early~20200606/libcob/common.h:2303: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. unsigned char fcdLen[2]; /* contains length of FCD */ data/gnucobol-4.0~early~20200606/libcob/common.h:2390: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 res3[14]; data/gnucobol-4.0~early~20200606/libcob/common.h:2396: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. unsigned char nlsId[2]; data/gnucobol-4.0~early~20200606/libcob/common.h:2397: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 fsv2FileId[2]; /* Fileshare V2 file id */ data/gnucobol-4.0~early~20200606/libcob/common.h:2398: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 retryOpenCount[2]; data/gnucobol-4.0~early~20200606/libcob/common.h:2399: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. unsigned char fnameLen[2]; /* file name length */ data/gnucobol-4.0~early~20200606/libcob/common.h:2400: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. unsigned char idxNameLen[2]; /* index name length */ data/gnucobol-4.0~early~20200606/libcob/common.h:2401: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 retryCount[2]; data/gnucobol-4.0~early~20200606/libcob/common.h:2402: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. unsigned char refKey[2]; /* key of reference */ data/gnucobol-4.0~early~20200606/libcob/common.h:2403: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. unsigned char lineCount[2]; data/gnucobol-4.0~early~20200606/libcob/common.h:2406: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. unsigned char effKeyLen[2]; /* effective key length */ data/gnucobol-4.0~early~20200606/libcob/common.h:2407: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 res5[14]; data/gnucobol-4.0~early~20200606/libcob/common.h:2408: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. unsigned char eop[2]; /* was "res5"; Use for cob_write eop value */ data/gnucobol-4.0~early~20200606/libcob/common.h:2409: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 opt[4]; /* was "res5"; Use for cob_write opts value */ data/gnucobol-4.0~early~20200606/libcob/common.h:2410: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. unsigned char curRecLen[4]; /* current record length in bytes */ data/gnucobol-4.0~early~20200606/libcob/common.h:2411: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. unsigned char minRecLen[4]; /* min. record length in bytes */ data/gnucobol-4.0~early~20200606/libcob/common.h:2412: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. unsigned char maxRecLen[4]; /* max. record length in bytes */ data/gnucobol-4.0~early~20200606/libcob/common.h:2413: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 fsv2SessionId[4]; /* Fileshare V2 session id */ data/gnucobol-4.0~early~20200606/libcob/common.h:2414: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 res6[24]; data/gnucobol-4.0~early~20200606/libcob/common.h:2415: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. unsigned char relByteAdrs[8]; /* 64-bit, relative byte address */ data/gnucobol-4.0~early~20200606/libcob/common.h:2416: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. unsigned char maxRelKey[8]; /* 64-bit, max relative key/Record num */ data/gnucobol-4.0~early~20200606/libcob/common.h:2417: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. unsigned char relKey[8]; /* 64-bit, (cur) relative key/Record num */ data/gnucobol-4.0~early~20200606/libcob/fbdb.c:341:17: [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). ret = bdb_env->open (bdb_env, file_setptr->bdb_home, flags, 0); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:455:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *)record_lock_object, p->filename, (size_t)(p->filenamelen + 1)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:456:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *)record_lock_object + p->filenamelen + 1, key, (size_t)keylen); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:497:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&p->bdb_locks[j], &p->bdb_locks[j+1], sizeof(DB_LOCK)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:499: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 (&p->bdb_locks[p->bdb_lock_num-1], &p->bdb_record_lock, sizeof(DB_LOCK)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:552:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *)record_lock_object, p->filename, (size_t)(p->filenamelen + 1)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:553:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *)record_lock_object + p->filenamelen + 1, key, (size_t)keylen); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:584: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 (&p->bdb_locks[j], &p->bdb_locks[j+1], sizeof(DB_LOCK)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:586:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&p->bdb_locks[p->bdb_lock_num-1], &test_lock, sizeof(DB_LOCK)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:704: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 (p->temp_key, p->key.data, (size_t)p->maxkeylen); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:708: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 (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:791:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (((char*)(p->data.data)) + p->data.size, &dupno, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:912:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->temp_key, p->key.data, len); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:914:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:949:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[0], p->key.data, p->primekeylen); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:957:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index], data/gnucobol-4.0~early~20200606/libcob/fbdb.c:959:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index + f->nkeys], p->key.data, p->primekeylen); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1012: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(p->saverec, p->data.data, p->data.size); /* Save old record image */ data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1013: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(p->temp_key,prim_key.data,prim_key.size); /* Save primary key value */ data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1065: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 file_open_buff[COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1158: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 runtime_buffer[COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1295:20: [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). ret = p->db[i]->open (p->db[i], NULL, runtime_buffer, NULL, data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1375:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[0], p->key.data, (size_t)p->key.size); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1523: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 (f->record->data, p->data.data, f->record->size); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1612: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 (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1618:6: [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 (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1683: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 (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1689:8: [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 (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1740:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->temp_key, p->key.data, (size_t)p->key.size); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1742: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 (&dupno, (cob_u8_ptr)p->data.data + p->primekeylen, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1776:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[0], p->key.data, (size_t)p->key.size); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1778:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index], p->temp_key, data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1780:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index + f->nkeys], p->key.data, p->primekeylen); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1799: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 (f->record->data, p->data.data, f->record->size); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1832: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 (p->last_key, p->key.data, (size_t)p->key.size); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:64: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 (fcd->fileStatus,f->file_status,2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:66: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 (fcd->fileStatus, fnstatus, 2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:68: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 (fcd->fileStatus,"00",2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:122: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 assignto[512]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:277:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(f->file_status, fcd->fileStatus, 2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:280:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fnstatus->data, fcd->fileStatus, 2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:471: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 fdname[49]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:583: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:622: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:666: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:712: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:760: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:789: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:826: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:861: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. unsigned char opcode[2]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:972: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 (pfcd, &f->fcd, sizeof(void *)); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:989: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 (pkey, &f->fcd->kdbPtr, sizeof(void *)); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1001: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. unsigned char fnstatus[2],keywrk[80]; data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1023: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 (fnstatus, "00", 2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1024: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 (fcd->fileStatus, "00", 2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1069: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(&key, f->keys[0].field, sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1121:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fcd->fileStatus,"9A",2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1135:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fcd->fileStatus,"9A",2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1150:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fcd->fileStatus,"9A",2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1163:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fcd->fileStatus,"9A",2); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:1327: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(fcd->fileStatus, fnstatus, 2); data/gnucobol-4.0~early~20200606/libcob/fileio.c:76: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. unsigned char unique[sizeof (size_t)]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:77: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. unsigned char item[1]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:240: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 const char *io_rtn_name[COB_IO_MAX+1] = { data/gnucobol-4.0~early~20200606/libcob/fileio.c:294: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 const char *file_format[12] = {"0","1","2","3","B32","B64","L32","L64","?","?","gc","mf"}; data/gnucobol-4.0~early~20200606/libcob/fileio.c:327: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[COB_FILE_MAX]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:328: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. unsigned char hbuf[1024]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:343: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). fdin = fopen(temp,"r"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:345:10: [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). fdin = fopen(filename,"r"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:430:8: [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. k += sprintf(&out[k],"type=RL"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:434:8: [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. k += sprintf(&out[k],"type=SQ"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:439:9: [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. k += sprintf(&out[k],"type=LA"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:441:9: [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. k += sprintf(&out[k],"type=LS"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:443:9: [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. k += sprintf(&out[k],",mf"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:445:9: [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. k += sprintf(&out[k],",gc"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:447:9: [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. k += sprintf(&out[k],",lf"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:449:9: [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. k += sprintf(&out[k],",crlf"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:451:9: [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. k += sprintf(&out[k],",ls_nulls"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:453:9: [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. k += sprintf(&out[k],",ls_fixed"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:455:9: [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. k += sprintf(&out[k],",ls_validate"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:457:9: [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. k += sprintf(&out[k],",ls_split"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:460:8: [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. k += sprintf(&out[k],",big-endian"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:462:8: [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. k += sprintf(&out[k],",little-endian"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:465:8: [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. k += sprintf(&out[k]," recsz=%d ",(int)(f->record_max)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:467:8: [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. k += sprintf(&out[k]," maxsz=%d ",(int)(f->record_max)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:468:8: [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. k += sprintf(&out[k],"minsz=%d ",(int)(f->record_min)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:470:8: [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. k += sprintf(&out[k]," recsz=%d ",(int)(f->record_max)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:476:8: [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. k += sprintf(&out[k],"nkeys=%d ",(int)(f->nkeys)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:478:9: [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. k += sprintf(&out[k],"key%d=(",idx+1); data/gnucobol-4.0~early~20200606/libcob/fileio.c:480:10: [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. k += sprintf(&out[k],"%d:%d",f->keys[idx].offset,(int)(f->keys[idx].field->size)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:483:11: [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. k += sprintf(&out[k],"%d:%d",(int)(f->keys[idx].component[j]->data - f->record->data), data/gnucobol-4.0~early~20200606/libcob/fileio.c:489:9: [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. k += sprintf(&out[k],") "); data/gnucobol-4.0~early~20200606/libcob/fileio.c:491:10: [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. k += sprintf(&out[k],"dup%d=Y ",idx+1); data/gnucobol-4.0~early~20200606/libcob/fileio.c:495:10: [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. k += sprintf(&out[k],"skip%d='%.*s' ",idx+1, data/gnucobol-4.0~early~20200606/libcob/fileio.c:504:11: [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. k += sprintf(&out[k],"sup%d='%c' ",idx+1,f->keys[idx].char_suppress); data/gnucobol-4.0~early~20200606/libcob/fileio.c:506:11: [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. k += sprintf(&out[k],"sup%d=x'%02X' ",idx+1,f->keys[idx].char_suppress); data/gnucobol-4.0~early~20200606/libcob/fileio.c:553: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(&kx, &f->keys[k], sizeof(cob_file_key)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:554: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(&f->keys[k], &f->keys[k+1], sizeof(cob_file_key)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:555: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(&f->keys[k+1], &kx, sizeof(cob_file_key)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:568: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 p1[32], p2[32]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:577:17: [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). cloc[parts] = atoi (p1); data/gnucobol-4.0~early~20200606/libcob/fileio.c:578:17: [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). clen[parts] = atoi (p2); data/gnucobol-4.0~early~20200606/libcob/fileio.c:677: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 outdd[COB_FILE_MAX], outbuf[4096]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:687:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fo = fopen(outdd,"w"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:703: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 inpdd[COB_FILE_MAX], ddbuf[2048]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:714:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fi = fopen(inpdd,"r"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1180: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 qt,option[64],value[COB_FILE_BUFF]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:1292: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). f->dflt_times = atoi(value); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1297: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). f->dflt_seconds = atoi(value); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1623:13: [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). keyn = atoi (&option[3]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1637:13: [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). keyn = atoi (&option[3]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1653:13: [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). keyn = atoi (&option[3]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1671:13: [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). keyn = atoi (&option[4]); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2114: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 prcoma[6]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2115: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. const char *iotype[11]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2139:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (fnstatus->data, f->file_status, (size_t)2); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2149:34: [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_setptr->cob_trace_file = fopen (file_setptr->cob_trace_filename, "w"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2289:10: [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). fo = fopen(file_setptr->cob_stats_filename, "w"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2310:10: [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). fo = fopen(file_setptr->cob_stats_filename, "a"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2555:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char mfhdrmark2[4] = {0x30,0x7E,0x00,0x00}; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2556:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char mfhdrmark4[4] = {0x30,0x00,0x00,0x7C}; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2562: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. unsigned char mfhdr[128]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2564:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = fopen(filename,"r"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2629: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 wrk[16]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2630: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. unsigned char mfhdr[128]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:2634:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = fopen(filename,"w"); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2640: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(mfhdr,mfhdrmark2,4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2643: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(mfhdr,mfhdrmark4,4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2649: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(&mfhdr[8],wrk,14); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2650: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(&mfhdr[22],wrk,14); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2764:7: [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 (filename, fdmode, fperms); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2861: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 *args[dMaxArgs]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:3042:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (filename, fmode); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3213: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 sbuff[4]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:3302: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 sbuff[4]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:3395: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 sbuff[4]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:3812: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. unsigned char rechdr[8]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:3993: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. unsigned char recmark[2]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:4207: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. unsigned char rechdr[8]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:4238:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rechdr, &relsize, sizeof(relsize)); /* Local native 'size_t' */ data/gnucobol-4.0~early~20200606/libcob/fileio.c:4251: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. unsigned char wrk[32]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:4438: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. unsigned char rechdr[8]; data/gnucobol-4.0~early~20200606/libcob/fileio.c:4501:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rechdr, &relsize, sizeof(relsize)); /* Local native 'size_t' */ data/gnucobol-4.0~early~20200606/libcob/fileio.c:5048:38: [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). fileio_funcs[get_io_ptr (f)]->open (&file_api, f, file_open_name, data/gnucobol-4.0~early~20200606/libcob/fileio.c:5249: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 (savrec, f->record->data, f->record->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5253:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (f->record->data, savrec, f->record->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5270: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 (f->record->data, savrec, f->record->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5650: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 (data, f->keys[idx].field->data, f->keys[idx].field->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5654: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 (&data[len], f->keys[idx].component[part]->data, data/gnucobol-4.0~early~20200606/libcob/fileio.c:5711:7: [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 (fn, flag, COB_FILE_MODE); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5718: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 (file_handle, &fd, (size_t)4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5783: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 (&fd, file_handle, (size_t)4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5825: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 (&fd, file_handle, (size_t)4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5845: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 (&fd, file_handle, (size_t)4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5906:8: [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). fd1 = open (fn1, flag, 0); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5914:8: [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). fd2 = open (fn2, flag, COB_FILE_MODE); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5982: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 (file_info, &sz, (size_t)8); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5985: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 (file_info+10, &y, (size_t)2); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6061: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 (&dir[1], dirname, (size_t)dir_size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6064: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 (dir, dirname, (size_t)dir_size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6241: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 (file_info, &sz, (size_t)8); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6246: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 (file_info + 8, &dt, (size_t)4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6251: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 (file_info + 12, &dt, (size_t)4); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6415:7: [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 (filename, data/gnucobol-4.0~early~20200606/libcob/fileio.c:6571: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 (toptr, fromptr, fromsize); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6574: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 (toptr, fromptr, tosize); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6741: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 (q->item, p, hp->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6788:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p, hp->queue[source + move].first->item, hp->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6799:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p, z->first->item, hp->size); data/gnucobol-4.0~early~20200606/libcob/fileio.h:87:9: [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 open _open data/gnucobol-4.0~early~20200606/libcob/fileio.h:149:8: [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). int (*open) (cob_file_api *, cob_file *, char *, const int, const int); data/gnucobol-4.0~early~20200606/libcob/fileio.h:252: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 odbcState[6]; /* Long ODBC status code */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:254: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 dbType[32]; /* Actual DB type */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:255: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 dbSchema[32]; /* Schema name */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:256: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 dbSid[32]; /* DB 'session id' (OCI) */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:257: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 dbName[32]; /* DB Name 'session id' (OCI) */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:258: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 dbUser[32]; /* DB UserId to connect with */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:259: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 dbPwd[32]; /* DB Password to connect with */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:260: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 dbDsn[32]; /* DB DSN to connect with */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:261: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 dbCon[128]; /* Full connect string */ data/gnucobol-4.0~early~20200606/libcob/fileio.h:286: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 lastErrMsg[80]; /* Recent DB Error msg */ data/gnucobol-4.0~early~20200606/libcob/fisam.c:163: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. unsigned char idxmap[MAXNUMKEYS]; data/gnucobol-4.0~early~20200606/libcob/fisam.c:233: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 (fh->savekey + totlen, data/gnucobol-4.0~early~20200606/libcob/fisam.c:252: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 (data + fh->key[idx].k_part[part].kp_start, data/gnucobol-4.0~early~20200606/libcob/fisam.c:544:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (fh->recwrk, f->record->data, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:654: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 file_name_buf [COB_FILE_MAX]; data/gnucobol-4.0~early~20200606/libcob/fisam.c:860: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 (fh2, fh, sizeof(struct indexfile) + data/gnucobol-4.0~early~20200606/libcob/fisam.c:1271:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (f->record->data, fh->recwrk, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:1353:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (f->record->data, fh->recwrk, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:1533: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 (fh->recwrk, f->record->data, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:1536: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 (fh->recwrk, f->record->data, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:1550:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (fh->recwrk, f->record->data, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:1560:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (fh->recwrk, f->record->data, f->record_max); data/gnucobol-4.0~early~20200606/libcob/fisam.c:1580: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 (fh->recwrk, f->record->data, f->record_max); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:351:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char line[128]; data/gnucobol-4.0~early~20200606/libcob/flmdb.c:352:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char devname[128]; data/gnucobol-4.0~early~20200606/libcob/flmdb.c:366: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). if( (file = fopen(filename, "r")) == NULL ) { data/gnucobol-4.0~early~20200606/libcob/flmdb.c:406: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 (p->temp_key, p->key.mv_data, (size_t)p->maxkeylen); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:411: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(&dupno,(cob_u8_ptr)p->data.mv_data + p->primekeylen, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:561:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (((char *)(p->data.mv_data)) + p->data.mv_size, &dupno, sizeof (unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:684:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->temp_key, p->key.mv_data, len); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:686:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dupno, (cob_u8_ptr)p->data.mv_data + p->primekeylen, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:701:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[0], p->key.mv_data, p->primekeylen); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:703:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index], data/gnucobol-4.0~early~20200606/libcob/flmdb.c:705:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index + f->nkeys], p->key.mv_data, p->primekeylen); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:771: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(p->saverec, p->data.mv_data, p->data.mv_size); /* Save old record image */ data/gnucobol-4.0~early~20200606/libcob/flmdb.c:772: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(p->temp_key, prim_key.mv_data, prim_key.mv_size); /* Save primary key value */ data/gnucobol-4.0~early~20200606/libcob/flmdb.c:865: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 runtime_buffer [COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/flmdb.c:876: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 dir[ COB_FILE_MAX ]; data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1078:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[0], p->key.mv_data, p->key.mv_size); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1167: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 (f->record->data, p->data.mv_data, f->record->size); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1247: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 (&dupno, (cob_u8_ptr)p->data.mv_data + p->primekeylen, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1252:6: [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 (&dupno, (cob_u8_ptr)p->data.mv_data + p->primekeylen, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1321: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 (&dupno, (cob_u8_ptr)p->data.mv_data + p->primekeylen, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1326:8: [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 (&dupno, (cob_u8_ptr)p->data.mv_data + f->keys[0].field->size, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1379:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->temp_key, p->key.mv_data, (size_t)p->key.mv_size); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1381: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 (&dupno, (cob_u8_ptr)p->data.mv_data + p->primekeylen, sizeof(unsigned int)); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1423:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[0], p->key.mv_data, (size_t)p->key.mv_size); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1425:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index], p->temp_key, data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1427:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p->last_readkey[p->key_index + f->nkeys], p->key.mv_data, p->primekeylen); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1447: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 (f->record->data, p->data.mv_data, f->record->size); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1475: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 (p->last_key, p->key.mv_data, (size_t)p->key.mv_size); data/gnucobol-4.0~early~20200606/libcob/focextfh.c:30: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 const char *io_rtn_name[COB_IO_MAX+1] = { data/gnucobol-4.0~early~20200606/libcob/foci.c:74: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 varFetch[80]; data/gnucobol-4.0~early~20200606/libcob/foci.c:113: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 *env, errMsg[szErrMsg+16]; data/gnucobol-4.0~early~20200606/libcob/foci.c:178:7: [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). i = atoi(&env[4]); /* Primary error code */ data/gnucobol-4.0~early~20200606/libcob/foci.c:234: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[256]; data/gnucobol-4.0~early~20200606/libcob/foci.c:299: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 msg[24]; data/gnucobol-4.0~early~20200606/libcob/foci.c:321: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(msg,"%d ",db->updatesDone); data/gnucobol-4.0~early~20200606/libcob/foci.c:332: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 msg[24]; data/gnucobol-4.0~early~20200606/libcob/foci.c:353: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(msg,"%d ",db->updatesDone); data/gnucobol-4.0~early~20200606/libcob/foci.c:371: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 msg[64]; data/gnucobol-4.0~early~20200606/libcob/foci.c:419: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 msg[64]; data/gnucobol-4.0~early~20200606/libcob/foci.c:668: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 msg[80]; data/gnucobol-4.0~early~20200606/libcob/foci.c:749: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 *env, *p, tmp[256]; data/gnucobol-4.0~early~20200606/libcob/foci.c:763:2: [2] (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). Risk is low because the source is a constant string. strcpy(db->dbType,"Oracle OCI"); data/gnucobol-4.0~early~20200606/libcob/foci.c:824:24: [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). db->commitInterval = atoi(env); data/gnucobol-4.0~early~20200606/libcob/foci.c:913: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). db->dbVer = atoi(env); data/gnucobol-4.0~early~20200606/libcob/foci.c:944:3: [2] (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). Risk is low because the source is a constant string. strcpy(tmp,"ALTER SESSION SET OPTIMIZER_MODE = FIRST_ROWS"); data/gnucobol-4.0~early~20200606/libcob/foci.c:960: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 buff[COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/foci.c:1006: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 buff[COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/foci.c:1080:20: [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). f->max_rec_num = atol (varFetch); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:84: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 varFetch[256]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:85: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 varFetch2[256]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:214: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 lState[5+3]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:215: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 *cp,msgtxt[szErrMsg + 10]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:226: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(szState,"%.5s",lState); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:284: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(errMsg,"%.*s",*errLen,cp); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:307: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 errMsg[szErrMsg+16]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:334: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(db->odbcState, szState, 5); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:477: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 msg[64]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:521: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 msg[64]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:826: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 msg[80]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:904: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 *env, tmp[256]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:917:2: [2] (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). Risk is low because the source is a constant string. strcpy(db->dbType,"ODBC"); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:922:2: [2] (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). Risk is low because the source is a constant string. strcpy(db->dbType,"DB2"); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:958:24: [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). db->commitInterval = atoi(env); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1086: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 amsg[40]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1088: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(amsg,"; Array fetch %d",db->arrayFetch); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1134:4: [2] (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). Risk is low because the source is a constant string. strcpy(db->dbType,"ODBC MariaDB"); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1140:4: [2] (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). Risk is low because the source is a constant string. strcpy(db->dbType,"ODBC MySQL"); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1151:18: [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). db->dbVer = atoi(env); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1166:4: [2] (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). Risk is low because the source is a constant string. strcpy(db->dbType,"DB2"); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1190: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 buff[COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1237: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 buff[COB_FILE_MAX+1]; data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1313:20: [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). f->max_rec_num = atol (varFetch); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:95:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (keyarea + totlen, data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:102: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 (keyarea, record + f->keys[idx].offset, f->keys[idx].field->size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:154:3: [2] (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). Risk is low because the source is a constant string. strcpy(out,"e-m-p-t-y"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:163: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(out,"'%.*s'",len,in); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:165: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(out,"'%.40s'...",in); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:170:2: [2] (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). Risk is low because the source is a constant string. strcpy(out,"0x"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:173: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(out,"%02X",*in); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:185:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char msg[1024]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.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 (xlbl, fx->xlbl, sizeof(int) * fx->nlbl); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:290: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 (mx, fx->map, sizeof(struct map_xfd) * fx->nmap); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:347: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(&mx->recfld, fl->keys[0].field, sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:501: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 const char vop[10][5] = {".",">=",">","<=","<","=","!=","&&","||","!"}; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:507:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:534: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). rslt = atoi(fx->map[pos].value) - atoi(buf); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:534:39: [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). rslt = atoi(fx->map[pos].value) - atoi(buf); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:637: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 wrk[20]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:640: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(wrk,"%0*d",len,val); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:641: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(data+pos,wrk,len); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:805:8: [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. k = sprintf(dataout,"%02d%02d%02d", data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:809:8: [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. k = sprintf(dataout,"%02d%02d%02d",date.year%100,date.month,date.day); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:811:8: [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. k = sprintf(dataout,"%04d%02d%02d%02d%02d%02d", data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:815:8: [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. k = sprintf(dataout,"%04d%02d%02d",date.year,date.month,date.day); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:819:8: [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. k = sprintf(dataout,"%02d:%02d:%02d.%03d", data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:823:8: [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. k = sprintf(dataout,"%04d-%02d-%02d %02d:%02d:%02d.%03d", data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:827:8: [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. k = sprintf(dataout,"%04d-%02d-%02d",date.year,date.month,date.day); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:856: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 *pd,pdata[40]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:959: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 xfdbuf[COB_NORMAL_BUFF],*sdir,*fname,*p,*mp; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:960: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 colname[80], tblname[80], asgname[256]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:961: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 dups[4], sup[4], supchar[80]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:962: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 opcode[16],tstval[48], commachr[8], decchr[8]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1002:2: [2] (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). Risk is low because the source is a constant string. strcpy(&xfdbuf[k],".xd"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1003:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fi = fopen (xfdbuf,"r"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1016:3: [2] (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). Risk is low because the source is a constant string. strcpy(&xfdbuf[k],".xd"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1017:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fi = fopen (xfdbuf,"r"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1283: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 xfdbuf[COB_NORMAL_BUFF],*sdir,*p; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1293:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fi = fopen (xfdbuf,"r"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1296:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fi = fopen (xfdbuf,"w"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1299:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fi = fopen (xfdbuf,"r"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1345:11: [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). idx = atoi(&p[1]); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1349:11: [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). idx = atoi(&p[1]); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1358:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p," INT ",8); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1361:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p," RAW(",8); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1364:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p," RAW ",8); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1476: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 hexwrk[80]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1506: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 hexwrk[80]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1653: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 sch[48]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1728: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 envname[64]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1739: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 const char *condstr[9] = {"?","=","<","<=",">",">=","<>",">","<"}; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1745: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 andstr[12], orstr[12]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1759:2: [2] (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). Risk is low because the source is a constant string. strcpy(orstr," OR ("); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1765:3: [2] (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). Risk is low because the source is a constant string. strcpy(andstr," AND ("); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1788: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 *sbuf,comma[8],rowcol[48], *op; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1872:12: [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. pos += sprintf(&sbuf[pos]," WITH (XLOCK, ROWLOCK)"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1874:12: [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. pos += sprintf(&sbuf[pos]," WITH (READPAST)"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1877:12: [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. pos += sprintf(&sbuf[pos]," WITH (NOWAIT)"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1882:11: [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. pos += sprintf(&sbuf[pos]," WHERE "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1905:5: [2] (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). Risk is low because the source is a constant string. strcpy(comma," AND "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1911:5: [2] (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). Risk is low because the source is a constant string. strcpy(comma," OR "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1924:10: [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. pos += sprintf(&sbuf[pos]," ORDER BY "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1937:12: [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. pos += sprintf(&sbuf[pos]," FOR UPDATE"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1942:13: [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. pos += sprintf(&sbuf[pos]," SKIP LOCKED"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1945:13: [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. pos += sprintf(&sbuf[pos]," WAIT %d",waitsecs); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1948:13: [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. pos += sprintf(&sbuf[pos]," NOWAIT"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1952:12: [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. pos += sprintf(&sbuf[pos]," SKIP LOCKED"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1954:12: [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. pos += sprintf(&sbuf[pos]," WAIT %d",waitsecs); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1956:12: [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. pos += sprintf(&sbuf[pos]," NOWAIT"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1979:10: [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. pos += sprintf(&sbuf[pos],") VALUES ("); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2004:10: [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. pos += sprintf(&sbuf[pos]," WHERE "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2012:5: [2] (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). Risk is low because the source is a constant string. strcpy(comma," AND "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2021:10: [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. pos += sprintf(&sbuf[pos],"WHERE "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2033:5: [2] (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). Risk is low because the source is a constant string. strcpy(comma," AND "); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2105: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 sqlbuf[48]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2116: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(&sqlwrk,&fx->map[k].sqlfld,sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2129: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 (fx->map[k].sdata,fx->map[k].recfld.data,fx->map[k].size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2131: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 (fx->map[k].sdata,fx->map[k].recfld.data,fx->map[k].size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2171: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 sqlbuf[48]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2174: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 hexwrk[80]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2183: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(&sqlwrk,&fx->map[k].sqlfld,sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2198:6: [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(hexwrk,"'%.*s'",(int)fx->map[k].recfld.size,fx->map[k].recfld.data); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2212: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 (fx->map[k].sdata,fx->map[k].recfld.data,fx->map[k].size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2214: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 (fx->map[k].sdata,fx->map[k].recfld.data,fx->map[k].size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2270: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 sqlbuf[48]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2273: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 hexwrk[80]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2284: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(&sqlwrk,&fx->map[k].sqlfld,sizeof(cob_field)); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2302: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 (fx->map[k].recfld.data,fx->map[k].sdata,fx->map[k].size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2304: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 (fx->map[k].recfld.data,fx->map[k].sdata,fx->map[k].size); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2315:6: [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(hexwrk,"'%.*s'",(int)fx->map[k].recfld.size,fx->map[k].recfld.data); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2375: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 comma[8],idxname[48]; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2383:4: [2] (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). Risk is low because the source is a constant string. strcpy(comma,",\n"); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:548: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 (curr_field->data, &val, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:561: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 (curr_field->data, &val, sizeof(cob_u32_t)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:570: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 buff[32]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:572:7: [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. sz = sprintf(buff,"%d",val); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:576: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 (curr_field->data, buff, sz); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:1372: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 (replaced_begin, reps[i]->data, reps[i]->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:1677: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 buff2[LOCTIME_BUFSIZE] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:1678: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 locale_buff[COB_SMALL_BUFF] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:1718: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 locale_buff[COB_SMALL_BUFF] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:1775: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 (curr_field->data, str, str_len); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2296: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 local_buff[13]; /* 13: make the compiler happy as "(un)signed short" *could* data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2307: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 (buff + buff_pos, local_buff, (size_t)6); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2461:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (second, str + i + 1U, second_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2994: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 formatted_time[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2995: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 formatted_date[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3154: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 (curr_field->data, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3470: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 date_format_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3471: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 time_format_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3689: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 buff[16]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3695: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 (curr_field->data, buff, (size_t)8); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3704: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 buff[8]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3710: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 (curr_field->data, buff, (size_t)6); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3723: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 (curr_field->data, COB_MODULE_PTR->module_name, calcsize); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3743: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 (curr_field->data, COB_MODULE_PTR->next->module_name, data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3757: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 (curr_field->data, COB_MODULE_PTR->module_formatted_date, data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3771: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 (curr_field->data, COB_MODULE_PTR->module_source, calcsize); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3792: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 (curr_field->data, *(COB_MODULE_PTR->module_path), data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3825:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (p, f[i]->data, f[i]->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3920: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 (curr_field->data, "00", (size_t)2); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3925: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 (curr_field->data, data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3927: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 (&(curr_field->data[2]), data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3973: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 (curr_field->data, buff, field.size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3994: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 (curr_field->data, except_name, strlen (except_name)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4015: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 (curr_field->data, cobglobptr->last_exception_statement, flen); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4025: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 (curr_field->data, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4037: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 buff[22] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4044: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 (buff, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d%2.2d", data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4050: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 (curr_field->data, buff, (size_t)21); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4155: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 buff[16]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4173: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 (curr_field->data, buff, (size_t)8); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4184: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 buff[13]; /* 13: make the compiler happy as "unsigned short" *could* data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4205: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 (curr_field->data, buff, (size_t)7); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4938: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 (curr_field->data, basef->data, basef->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4962: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 (curr_field->data, basef->data, basef->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5004: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 (curr_field->data, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5023: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 (curr_field->data, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5051: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 (curr_field->data, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5142: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 (curr_field->data, &val, sizeof(val)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5412: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 format_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5415: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 time_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5421: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 (format_str, format_field->data, str_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5437: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 (time_str, time_field->data, str_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5473: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 buff2[128]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5479: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 buff[128]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5480: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 locale_buff[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5591: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 buff[LOCTIME_BUFSIZE] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5650: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 buff[LOCTIME_BUFSIZE] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5704: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 (curr_field->data, p->mon_decimal_point, size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5739: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 (curr_field->data, p->decimal_point, size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5774: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 (curr_field->data, p->mon_thousands_sep, size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5809: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 (curr_field->data, p->thousands_sep, size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5844: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 (curr_field->data, p->currency_symbol, size); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6064: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 (p1, f1->data, size2); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6075: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 (p2, f2->data, size2); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6127: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 format_str[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6130: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 buff[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6149: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 (curr_field->data, buff, field_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6173: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 buff[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6174: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 format_str[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6241: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 (curr_field->data, buff, field_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6266: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 fmt_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6267: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 date_fmt_str[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6268: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 time_fmt_str[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6277: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 buff[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6344: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 (curr_field->data, buff, (size_t) field_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6363: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 datetime_format_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6364: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 date_format_str[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6365: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 time_format_str[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6368: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 formatted_datetime[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6369: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 formatted_date[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6370: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 formatted_time[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6402: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 (date_format_str, datetime_format_str, COB_DATESTR_MAX); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6405: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 (time_format_str, datetime_format_str, COB_TIMESTR_MAX); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6412: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 (formatted_date, formatted_datetime, COB_DATESTR_MAX); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6414: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 (formatted_time, formatted_datetime, COB_TIMESTR_MAX); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6464: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 original_format_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6465: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 original_date_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6466: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 format_str[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6467: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 date_str[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6516: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 format_str[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6518: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 date_format_str[COB_DATESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6519: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 time_format_str[COB_TIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6522: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 formatted_date[COB_DATETIMESTR_LEN] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6547: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 (curr_field->data, formatted_date, field_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6642: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 (curr_field->data, pointed, size); data/gnucobol-4.0~early~20200606/libcob/mlio.c:326: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 hex_num[3] = { '\0' }; data/gnucobol-4.0~early~20200606/libcob/mlio.c:571: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 (dup, str, size); data/gnucobol-4.0~early~20200606/libcob/mlio.c:798: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 (out->data, xmlBufferContent (buff), copy_len); data/gnucobol-4.0~early~20200606/libcob/mlio.c:882: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 (out->data, printed_json, copy_len); data/gnucobol-4.0~early~20200606/libcob/move.c:494: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. unsigned char buff[256]; data/gnucobol-4.0~early~20200606/libcob/move.c:630: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 buff[32]; data/gnucobol-4.0~early~20200606/libcob/move.c:801: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 (dst, "CR", (size_t)2); data/gnucobol-4.0~early~20200606/libcob/move.c:803: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 (dst, "DB", (size_t)2); data/gnucobol-4.0~early~20200606/libcob/move.c:1196: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. unsigned char data[4]; data/gnucobol-4.0~early~20200606/libcob/move.c:1566:8: [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 (&mod->param_buf[npos], f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/move.c:1866: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 (mem, ((cob_u8_t*)&uint), sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:1870: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 (mem, ((cob_u8_t*)&val), sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:1874: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 (mem, ((cob_u8_t*)&ushort), sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:1883: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 (mem, ((cob_u8_t*)&val) + (sizeof(cob_s64_t) - len), len); data/gnucobol-4.0~early~20200606/libcob/move.c:1889: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 (mem, ((cob_u8_t*)&uint), sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:1894: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 (mem, ((cob_u8_t*)&ulong), sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:1898: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 (mem, ((cob_u8_t*)&ushort), sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:1908: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 (mem, ((cob_u8_t*)&ulong) + (sizeof(cob_s64_t) - len), len); data/gnucobol-4.0~early~20200606/libcob/move.c:1921: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 (mem, ((cob_u8_t*)&uint), sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:1925: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 (mem, ((cob_u8_t*)&val), sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:1929: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 (mem, ((cob_u8_t*)&ushort), sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:1941: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 (mem, ((cob_u8_t*)&val) + (sizeof(cob_s64_t) - len), len); data/gnucobol-4.0~early~20200606/libcob/move.c:1943: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 (mem, ((cob_u8_t*)&val), len); data/gnucobol-4.0~early~20200606/libcob/move.c:1959: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(mem,((cob_u8_t*)&sint),sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:1963: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(mem,((cob_u8_t*)&val),sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:1967: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(mem,((cob_u8_t*)&sshort),sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:1976: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(mem,((cob_u8_t*)&val)+(sizeof(cob_s64_t)-len),len); data/gnucobol-4.0~early~20200606/libcob/move.c:1982: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(mem,((cob_u8_t*)&sint),sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:1987: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(mem,((cob_u8_t*)&slong),sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:1991: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(mem,((cob_u8_t*)&sshort),sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2001: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(mem,((cob_u8_t*)&slong)+(sizeof(cob_s64_t)-len),len); data/gnucobol-4.0~early~20200606/libcob/move.c:2015: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 (mem, ((cob_u8_t*)&sint), sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2019: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 (mem, ((cob_u8_t*)&val), sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2023: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 (mem, ((cob_u8_t*)&sshort), sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2035: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 (mem, ((cob_u8_t*)&val) + (sizeof(cob_s64_t) - len), len); data/gnucobol-4.0~early~20200606/libcob/move.c:2037: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 (mem, ((cob_u8_t*)&val), len); data/gnucobol-4.0~early~20200606/libcob/move.c:2050: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 (((cob_u8_t*)&uint), mem, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2054: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 (((cob_u8_t*)&ulong), mem, sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2057: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 (((cob_u8_t*)&ushort), mem, sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2068: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 (((cob_u8_t*)&ulong) + (sizeof(cob_s64_t) - len), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2073: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 (((cob_u8_t*)&uint), mem, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2077: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 (((cob_u8_t*)&ulong), mem, sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2080: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 (((cob_u8_t*)&ushort), mem, sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2091: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 (((cob_u8_t*)&ulong) + (sizeof(cob_s64_t) - len), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2104: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 (((cob_u8_t*)&uint), mem, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2108: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 (((cob_u8_t*)&ulong), mem, sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2111: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 (((cob_u8_t*)&ushort), mem, sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2123: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 (((cob_u8_t*)&ulong) + (sizeof(cob_s64_t) - len), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2125: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 (((cob_u8_t*)&ulong), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2138:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (((void *)&sint), mem, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2142:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (((void*)&slong), mem, sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2145:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (((void*)&sshort), mem, sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2160: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 (((cob_u8_t*)&slong) + (sizeof(cob_s64_t) - len), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2165:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (((void*)&slong), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2180: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 (((cob_u8_t*)&sint), mem, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2184: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 (((cob_u8_t*)&slong), mem, sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2187: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 (((cob_u8_t*)&sshort), mem, sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2201: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 (((cob_u8_t*)&slong) + (sizeof(cob_s64_t) - len), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2206: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 (((cob_u8_t*)&sint), mem, sizeof(int)); data/gnucobol-4.0~early~20200606/libcob/move.c:2211: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 (((cob_u8_t*)&slong), mem, sizeof(cob_s64_t)); data/gnucobol-4.0~early~20200606/libcob/move.c:2215: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 (((cob_u8_t*)&sshort), mem, sizeof(short)); data/gnucobol-4.0~early~20200606/libcob/move.c:2230: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 (((cob_u8_t*)&slong) + (sizeof(cob_s64_t) - len), mem, len); data/gnucobol-4.0~early~20200606/libcob/move.c:2353: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 ebcdic_pos[11] = "{ABCDEFGHI"; data/gnucobol-4.0~early~20200606/libcob/move.c:2354: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 ebcdic_neg[11] = "}JKLMNOPQR"; data/gnucobol-4.0~early~20200606/libcob/move.c:2477: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 (mem, &val, sizeof(float)); data/gnucobol-4.0~early~20200606/libcob/move.c:2482: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 (mem, &val, sizeof(double)); data/gnucobol-4.0~early~20200606/libcob/move.c:2488: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 (&val, mem, sizeof(float)); data/gnucobol-4.0~early~20200606/libcob/move.c:2495: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 (&val, mem, sizeof(double)); data/gnucobol-4.0~early~20200606/libcob/move.c:2502: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 (mem, &val, sizeof(void *)); data/gnucobol-4.0~early~20200606/libcob/move.c:2522:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (char_field, cbl_data, i); data/gnucobol-4.0~early~20200606/libcob/move.c:2536: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 (cbl_data, string, j); data/gnucobol-4.0~early~20200606/libcob/numeric.c:102:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char packed_value[20]; data/gnucobol-4.0~early~20200606/libcob/numeric.c:375: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 wrk[256]; data/gnucobol-4.0~early~20200606/libcob/numeric.c:527: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 (f->data, &data, (size_t)8); data/gnucobol-4.0~early~20200606/libcob/numeric.c:642: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 (f->data, data, (size_t)16); data/gnucobol-4.0~early~20200606/libcob/numeric.c:876: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. unsigned char savedata[256]; data/gnucobol-4.0~early~20200606/libcob/numeric.c:884: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 (savedata, f->data, f->size); data/gnucobol-4.0~early~20200606/libcob/numeric.c:965:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (f->data, savedata, f->size); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1063: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 buff[1024]; data/gnucobol-4.0~early~20200606/libcob/numeric.c:1309: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 (data, p - diff, COB_FIELD_SIZE (f)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1313: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 (data + diff, p, size); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1333: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. unsigned char buff[COB_MAX_BINARY + 1]; data/gnucobol-4.0~early~20200606/libcob/numeric.c:1544:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void *)&uval.fval, field->data, sizeof(float)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1548:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void *)&uval.dval, field->data, sizeof(double)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1579:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void *)&uval.fval, f->data, sizeof(float)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1583:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void *)&uval.dval, f->data, sizeof(double)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1777: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 (f->data, &uval.fval, sizeof (float)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1791: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 (f->data, &uval.val, sizeof (double)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2082: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. unsigned char tfield[256]; data/gnucobol-4.0~early~20200606/libcob/numeric.c:2088: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 (tfield, data, size); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2133: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 (data, tfield, osize); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2283: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(&flt,f1->data,sizeof(float)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2286: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(&d1,f1->data,sizeof(double)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2292: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(&flt,f2->data,sizeof(float)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2295: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(&d2,f2->data,sizeof(double)); data/gnucobol-4.0~early~20200606/libcob/numeric.c:2332: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. unsigned char val1[20]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:295: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 data1[30],data2[30]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:298: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 wrk[32]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:414: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 idnt[48], wrk[200]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:419: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(idnt,"%.*s",indent>30?30:indent,".................................."); data/gnucobol-4.0~early~20200606/libcob/reportio.c:541: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 wrk[80]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:695: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 fld[COB_MAX_WORDLEN + 1]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:867: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 wrk[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:898: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 (&rec[dest_pos], wrk, ln); data/gnucobol-4.0~early~20200606/libcob/reportio.c:909: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 *rec,wrk[COB_SMALL_BUFF]; data/gnucobol-4.0~early~20200606/libcob/reportio.c:1048: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(&rec[rf->column-1], rf->litval, rf->litlen); data/gnucobol-4.0~early~20200606/libcob/reportio.c:1530: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 wrk[256]; data/gnucobol-4.0~early~20200606/libcob/screenio.c:688: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 buff[23]; /* 10: make the compiler happy as "int" *could* data/gnucobol-4.0~early~20200606/libcob/screenio.c:690: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 (buff, "%4.4d", fret); data/gnucobol-4.0~early~20200606/libcob/screenio.c:691:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (status_field->data, buff, 4U); data/gnucobol-4.0~early~20200606/libcob/screenio.c:712: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 buff[23]; /* 10: make the compiler happy as "int" *could* data/gnucobol-4.0~early~20200606/libcob/screenio.c:717: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 (buff, "%4.4d", sline); data/gnucobol-4.0~early~20200606/libcob/screenio.c:718: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 (cursor_field->data, buff, 4U); data/gnucobol-4.0~early~20200606/libcob/screenio.c:722: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 (buff, "%6.6d", sline); data/gnucobol-4.0~early~20200606/libcob/screenio.c:723: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 (cursor_field->data, buff, 6U); data/gnucobol-4.0~early~20200606/libcob/screenio.c:739: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 buff[32]; data/gnucobol-4.0~early~20200606/libcob/screenio.c:746:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buff, cursor_field->data, maxsize); data/gnucobol-4.0~early~20200606/libcob/screenio.c:1203: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 (data, s->field->data, size); data/gnucobol-4.0~early~20200606/libcob/screenio.c:2328: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. unsigned char space_buff[4]; data/gnucobol-4.0~early~20200606/libcob/screenio.c:3184: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 buff [COB_NORMAL_BUFF]; data/gnucobol-4.0~early~20200606/libcob/screenio.c:3214: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 exit_msg[COB_MINI_BUFF]; data/gnucobol-4.0~early~20200606/libcob/strings.c:460: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 (string_dst->data + string_offset, src->data, src_size); data/gnucobol-4.0~early~20200606/libcob/strings.c:464: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 (string_dst->data + string_offset, src->data, (size_t)size); data/gnucobol-4.0~early~20200606/libcob/sysdefines.h:277: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 format[32]; /* Date format string; Used for date conversion */ data/gnucobol-4.0~early~20200606/libcob/termio.c:194:3: [2] (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). Risk is low because the source is a constant string. strcpy(wrk,"NaN"); data/gnucobol-4.0~early~20200606/libcob/termio.c:207: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 wrk[48]; data/gnucobol-4.0~early~20200606/libcob/termio.c:218: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 (&un.f1doub, f->data, sizeof (double)); data/gnucobol-4.0~early~20200606/libcob/termio.c:219: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 (wrk, "%-.16G", un.f1doub); data/gnucobol-4.0~early~20200606/libcob/termio.c: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 (&un.f1float, f->data, sizeof (float)); data/gnucobol-4.0~early~20200606/libcob/termio.c:225: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 (wrk, "%-.8G", (double)un.f1float); data/gnucobol-4.0~early~20200606/libcob/termio.c:300:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (cobsetptr->cob_display_print_filename, mode); data/gnucobol-4.0~early~20200606/libcob/termio.c:345:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (cobsetptr->cob_display_punch_filename, mode); data/gnucobol-4.0~early~20200606/libcob/termio.c:420: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 wrk[200]; data/gnucobol-4.0~early~20200606/libcob/termio.c:527: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 (&wrk[j],"%02X",f->data[i]); data/gnucobol-4.0~early~20200606/libcob/termio.c:530: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 (&wrk[j],"%02X",f->data[i]); data/gnucobol-4.0~early~20200606/libcob/termio.c:555: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 vname[COB_MAX_WORDLEN + 1 + COB_MAX_SUBSCRIPTS * 4 + 1]; data/gnucobol-4.0~early~20200606/libcob/termio.c:556: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 lvlwrk[16]; data/gnucobol-4.0~early~20200606/libcob/termio.c:582: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 (f, fa, sizeof (cob_field)); data/gnucobol-4.0~early~20200606/libcob/termio.c:586:4: [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 (vname," ("); data/gnucobol-4.0~early~20200606/libcob/termio.c:594: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(&vname[strlen(vname)],"%d",subscript+1); data/gnucobol-4.0~early~20200606/libcob/termio.c:605: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(lvlwrk,"%02d",level); data/gnucobol-4.0~early~20200606/libcob/termio.c:742: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((char *)(f->data),"%d",*(int *)i->data); data/gnucobol-4.0~early~20200606/bin/cobcrun.c:211:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && strlen (envptr) + strlen (pathname) + 1 < COB_MEDIUM_MAX) { data/gnucobol-4.0~early~20200606/bin/cobcrun.c:211: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). && strlen (envptr) + strlen (pathname) + 1 < COB_MEDIUM_MAX) { data/gnucobol-4.0~early~20200606/bin/cobcrun.c:227:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && strlen (envptr) + strlen (filename) + 1 < COB_MEDIUM_MAX) { data/gnucobol-4.0~early~20200606/bin/cobcrun.c:227: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). && strlen (envptr) + strlen (filename) + 1 < COB_MEDIUM_MAX) { data/gnucobol-4.0~early~20200606/bin/cobcrun.c:273:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > COB_SMALL_MAX) { data/gnucobol-4.0~early~20200606/bin/cobcrun.c:385:6: [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 (argv[arg_shift]) > COB_MAX_NAMELEN) { data/gnucobol-4.0~early~20200606/bin/gcdiff.c:170:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(string); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:335: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). for (k=strlen(buf); k > 0 data/gnucobol-4.0~early~20200606/bin/gcdiff.c:637: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). skip_lines[i].len = strlen(arg); data/gnucobol-4.0~early~20200606/bin/gcdiff.c:686: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). templates[i].len = strlen(templates[i].pat); data/gnucobol-4.0~early~20200606/cobc/cobc.c:938:6: [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). n = strlen (dupstr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:957:6: [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). m = strlen (str1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:958:6: [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). n = strlen (str2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1015:6: [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). n = strlen (dupstr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1033:6: [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). m = strlen (str1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1034:6: [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). n = strlen (str2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1151:6: [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). n = strlen (dupstr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1266:6: [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). n = strlen (dupstr); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1347: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). size = strlen (value) - 1U; data/gnucobol-4.0~early~20200606/cobc/cobc.c:1393: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). size = strlen (value); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1559:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (p); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1701: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). calcsize = strlen (*var); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1702: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). calcsize += strlen (s1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1704: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). calcsize += strlen (s2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1707: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). calcsize += strlen (s3); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1802: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). *(buffer + strlen(buffer) - 2) = 'l'; data/gnucobol-4.0~early~20200606/cobc/cobc.c:1803: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). *(buffer + strlen(buffer) - 1) = 0; data/gnucobol-4.0~early~20200606/cobc/cobc.c:1913:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (cb_listing_date, "DATE BUG, PLEASE REPORT", CB_LISTING_DATE_MAX); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1918:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (cb_listing_date, time_buff, CB_LISTING_DATE_MAX); data/gnucobol-4.0~early~20200606/cobc/cobc.c:1929:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (cb_listing_filename, str, FILENAME_MAX); data/gnucobol-4.0~early~20200606/cobc/cobc.c:2085:6: [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 (cmd) < 64) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2095: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). toklen = strlen (token) + 1; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2121: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). lablen = CB_IMSG_SIZE - 2 - (int)strlen (_("env")) - 2; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2124:6: [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 (val) <= CB_IVAL_SIZE) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2132: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). toklen = strlen (token) + 1; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2406: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). endp = buff + strlen (buff) - 1U; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2463:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (startp); data/gnucobol-4.0~early~20200606/cobc/cobc.c:2588:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cobc_buffer_size = strlen (cobc_cc) + 11; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2614:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cobc_buffer_size = strlen (cobc_cc) + 11; data/gnucobol-4.0~early~20200606/cobc/cobc.c:2713:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > COB_MINI_MAX) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2722:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > COB_SMALL_MAX) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:2869: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). osize = strlen (cob_optarg); data/gnucobol-4.0~early~20200606/cobc/cobc.c:2948:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf_entry, conf_label + 2, COB_MINI_MAX - 2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3044:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > 64U) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3060:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > COB_SMALL_MAX) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3082:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > COB_SMALL_MAX) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3101:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > COB_SMALL_MAX) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3119:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > 15U) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3128:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > 32U) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3139:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (cob_optarg) > 32U) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3231:40: [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). cob_schema_dir = cobc_main_malloc (strlen(temp_buff) + strlen(cb_sqldb_schema) + 8); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3231:60: [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). cob_schema_dir = cobc_main_malloc (strlen(temp_buff) + strlen(cb_sqldb_schema) + 8); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3234:40: [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). cob_schema_dir = cobc_main_malloc (strlen(COB_SCHEMA_DIR) + strlen(cb_sqldb_schema) + 8); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3234:65: [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). cob_schema_dir = cobc_main_malloc (strlen(COB_SCHEMA_DIR) + strlen(cb_sqldb_schema) + 8); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3579: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). fsize = strlen (filename); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3697: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 (full_path, "/"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3703:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fn->translate_len = strlen (fn->translate); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3712: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). *(buffer + strlen (buffer) - 1) = 'h'; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3730: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). fn->object_len = strlen (fn->object); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3741: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). fsize = strlen (cobc_list_dir) + strlen (fbasename) + 8U; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3741: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). fsize = strlen (cobc_list_dir) + strlen (fbasename) + 8U; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3775: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). full_length = (int)strlen (search_patterns) - 1; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3776:43: [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 (pattern_end = 0; pattern_end < (int)strlen (search_patterns); pattern_end++) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:3815: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). cobc_chk_buff_size (strlen (output_name) + 18); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3828: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). *(cobc_buffer + curr_size - strlen (buffer) - 1) = 0; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3862: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). cobc_chk_buff_size (curr_size + 1 + strlen (cobc_run_args)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3863:3: [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 (cobc_buffer, " ", cobc_buffer_size); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3864:3: [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 (cobc_buffer, cobc_run_args, cobc_buffer_size); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3932: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). len = strlen (token); data/gnucobol-4.0~early~20200606/cobc/cobc.c:3959: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). token[strlen (token) - 1] = 0; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3970: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). token[strlen (token) - 1] = 0; data/gnucobol-4.0~early~20200606/cobc/cobc.c:3989: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). token[strlen (token) - 1] = 0; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4031: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 (buffptr, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4033:5: [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 (buffptr, "'"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4043: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 (buffptr, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4045:5: [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 (buffptr, "'"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4053:4: [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 (buffptr, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4102:4: [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 (buffptr, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4106: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 (buffptr, ")"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4111:5: [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 (buffptr, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4115: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 (buffptr, ")"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4118: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 (buffptr, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4213:46: [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). search_pattern2 = (char*)cobc_malloc (2 * (strlen (output_name_temp) + 5) + 1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4224: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). line_end = line_start + strlen (line_start); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4266: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). clen = strlen (cmd) + 64U; data/gnucobol-4.0~early~20200606/cobc/cobc.c:4648:6: [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 (name) >= 6 && memcmp (name, "FILLER", 6) == 0) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:4697: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). usage_len = strlen (picture_usage); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4709:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (picture, field->pic->orig, picture_len - 1 - usage_len); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4711:4: [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 (picture, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4714:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (picture, "9 ANY NUMERIC", 14); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4717:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (picture, "X ANY LENGTH", 13); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4723:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (picture, field->pic->orig, picture_len - 1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4804: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). for (i = strlen (str) - 1; i && isspace ((unsigned char)str[i]); i--) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:4817:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lcl_name, (char *)f->name, LCL_NAME_MAX); data/gnucobol-4.0~early~20200606/cobc/cobc.c:4851:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lcl_name, check_filler_name ((char *)top->name), data/gnucobol-4.0~early~20200606/cobc/cobc.c:5133:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lcl_name, (char *)f->name, LCL_NAME_MAX); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5156:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lcl_name, check_filler_name ((char *)top->name), LCL_NAME_MAX); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5772: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). int len = strlen (line); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5802: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). int len = strlen (line); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5836: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). pd_off = strlen (print_data) - 1; data/gnucobol-4.0~early~20200606/cobc/cobc.c:5842: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). msg_off = strlen (err->prefix); data/gnucobol-4.0~early~20200606/cobc/cobc.c:5843: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). pd_off = strlen (print_data) - msg_off; data/gnucobol-4.0~early~20200606/cobc/cobc.c:5920: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). last_col = strlen (pline[line_idx]) - 1; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6036:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i = strlen (line) - 1; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6136: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). new_token = cobc_malloc (strlen(newline) + 2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6156: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). new_token_len = strlen (new_token); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6171: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). out_col += strlen (new_token); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6215: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). new_token = cobc_malloc (strlen(newline) + 2); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6239:4: [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 (pline[i], " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6316: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). fprintf (stdout, " fromlen: %d\n", strlen(rfp)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6318: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). fprintf (stdout, " tolen: %d\n", strlen(rep->to)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6363: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 (newline) + strlen (ttoken) + strlen (tterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6363: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). if ((strlen (newline) + strlen (ttoken) + strlen (tterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6363:48: [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 (newline) + strlen (ttoken) + strlen (tterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6364: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). newlinelen += strlen (ttoken) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6385:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((strlen (newline) + strlen (rep->to) + strlen (lterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6385: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). if ((strlen (newline) + strlen (rep->to) + strlen (lterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6385:47: [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 (newline) + strlen (rep->to) + strlen (lterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6386: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). newlinelen += strlen (rep->to) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6392: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 (newline) + strlen (ttoken) + strlen (to_ptr)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6392: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). if ((strlen (newline) + strlen (ttoken) + strlen (to_ptr)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6392:47: [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 (newline) + strlen (ttoken) + strlen (to_ptr)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6393: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). newlinelen += strlen (ttoken) + strlen (to_ptr) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6393: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). newlinelen += strlen (ttoken) + strlen (to_ptr) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6457:4: [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 (newline, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6466: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). from_token_len = strlen (ftoken); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6478: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). ttlen = strlen (ttoken); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6495: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 (newline) + strlen (ttoken) + strlen (rep->to)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6495: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). if ((strlen (newline) + strlen (ttoken) + strlen (rep->to)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6495:47: [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 (newline) + strlen (ttoken) + strlen (rep->to)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6496: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). newlinelen += strlen (ttoken) + strlen (rep->to) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6496: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). newlinelen += strlen (ttoken) + strlen (rep->to) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6504:7: [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 (newline, ttoken, ttlen); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6514: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 (newline) + strlen (ttoken) + strlen (tterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6514: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). if ((strlen (newline) + strlen (ttoken) + strlen (tterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6514:47: [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 (newline) + strlen (ttoken) + strlen (tterm)) >= newlinelen) { data/gnucobol-4.0~early~20200606/cobc/cobc.c:6515: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). newlinelen += strlen (ttoken) + CB_LINE_LENGTH; data/gnucobol-4.0~early~20200606/cobc/cobc.c:6651:60: [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). fprintf (stdout, " from[%d]:%d: '%80.80s'\n", i, strlen(rep->from), rep->from); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6652:60: [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). fprintf (stdout, " to [%d]:%d: '%80.80s'\n", i, strlen(rep->to), rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6757:57: [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). fprintf (stdout, " from[%d]:%d: '%80.80s'\n", i, strlen(rep->from), rep->from); data/gnucobol-4.0~early~20200606/cobc/cobc.c:6758:57: [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). fprintf (stdout, " to [%d]:%d: '%80.80s'\n", i, strlen(rep->to), rep->to); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7068:59: [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). memcpy ((void *) cb_storage_file_name, (void *) buffer, strlen (buffer) + 1); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7089: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). *(buffer + strlen(buffer) - 2) = 'l'; data/gnucobol-4.0~early~20200606/cobc/cobc.c:7090: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). *(buffer + strlen(buffer) - 1) = 0; data/gnucobol-4.0~early~20200606/cobc/cobc.c:7178: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). size = strlen (name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7324: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). size = strlen (name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7376: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 (p, "/"); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7379: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). fn->translate_len = strlen (p); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7396: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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7396:52: [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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7438: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). size = strlen (name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7491: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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7491:52: [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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7523: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 (cobc_objects_buffer, "\""); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7548: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). size = strlen (name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7640: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 (cobc_objects_buffer, " "); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7642: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 (cobc_objects_buffer, "\""); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7666: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). size = strlen (name); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7721: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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name) + strlen (COB_EXE_EXT)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7721:52: [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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name) + strlen (COB_EXE_EXT)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7721:68: [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). cobc_chk_buff_size (strlen (COB_STRIP_CMD) + 3 + strlen (name) + strlen (COB_EXE_EXT)); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7891:17: [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). manilink_len = strlen (manilink); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7907: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). cobc_cc_len = strlen (cobc_cc); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7908: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). cobc_cflags_len = strlen (cobc_cflags); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7909: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). cobc_include_len = strlen (cobc_include); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7910:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cobc_shared_opt_len = strlen (COB_SHARED_OPT); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7911: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). cobc_pic_flags_len = strlen (COB_PIC_FLAGS); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7912:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cobc_export_dyn_len = strlen (COB_EXPORT_DYN); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7913: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). cobc_ldflags_len = strlen (cobc_ldflags); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7914: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). cobc_lib_paths_len = strlen (cobc_lib_paths); data/gnucobol-4.0~early~20200606/cobc/cobc.c:7915:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cobc_libs_len = strlen (cobc_libs); data/gnucobol-4.0~early~20200606/cobc/cobc.c:8048:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (cb_listing_filename, fn->source, FILENAME_MAX - 1); data/gnucobol-4.0~early~20200606/cobc/codegen.c:538: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). int ln = strlen(fmt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:2241: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(cmt && strlen(cmt) > 0) data/gnucobol-4.0~early~20200606/cobc/codegen.c:2271: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(cmt && strlen(cmt) > 0) data/gnucobol-4.0~early~20200606/cobc/codegen.c:6455: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). (int)strlen (s), 0); data/gnucobol-4.0~early~20200606/cobc/codegen.c:6714: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). (int)strlen (s), 0); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8649:2: [1] (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). Risk is low because the source is a constant character. strcpy (features,""); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8650:2: [1] (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). Risk is low because the source is a constant character. strcpy (nxt,""); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8652: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). sprintf(&features[strlen(features)],"%sCOB_SELECT_FILE_STATUS",nxt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8653:3: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8656: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). sprintf(&features[strlen(features)],"%sCOB_SELECT_LINAGE",nxt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8657:3: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8660: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). sprintf(&features[strlen(features)],"%sCOB_SELECT_EXTERNAL",nxt); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8661:3: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8664: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). sprintf(&features[strlen(features)],"%s%d",nxt,f->special); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8665:3: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8668:3: [1] (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). Risk is low because the source is a constant character. strcpy(features,"0"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8764:3: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,""); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8769:4: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8773:4: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8777:4: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8781:4: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8785:4: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:8789:4: [1] (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). Risk is low because the source is a constant character. strcpy(nxt,"|"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9548:4: [1] (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). Risk is low because the source is a constant character. strcpy(fname,""); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9551: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). sprintf(&fname[strlen(fname)]," %s",cb_code_field(f->report_control)->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9553:6: [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(fname) > 1) data/gnucobol-4.0~early~20200606/cobc/codegen.c:9689:4: [1] (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). Risk is low because the source is a constant character. strcpy(fname,""); data/gnucobol-4.0~early~20200606/cobc/codegen.c:9692: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). sprintf(&fname[strlen(fname)]," %s",cb_code_field(f->report_control)->name); data/gnucobol-4.0~early~20200606/cobc/codegen.c:10536:4: [1] (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). Risk is low because the source is a constant character. strcpy(wrk,"0"); data/gnucobol-4.0~early~20200606/cobc/codegen.c:10642:4: [1] (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). Risk is low because the source is a constant character. strcpy(wrk,"0"); data/gnucobol-4.0~early~20200606/cobc/config.c:282:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buff, conf_includes->name, (size_t)COB_SMALL_MAX); data/gnucobol-4.0~early~20200606/cobc/config.c:284: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 (i = (int)strlen (buff); i != 0 && buff[i] != SLASH_CHAR; i--); data/gnucobol-4.0~early~20200606/cobc/config.c:508: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). for (j = strlen(buff); buff[j - 1] == '\r' || buff[j - 1] == '\n';) { data/gnucobol-4.0~early~20200606/cobc/config.c:583:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buff, s, COB_SMALL_MAX); data/gnucobol-4.0~early~20200606/cobc/field.c:876:4: [1] (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). Risk is low because the source is a constant character. strcpy (pic, "X"); data/gnucobol-4.0~early~20200606/cobc/help.c:202:6: [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 (name) <= 19) { data/gnucobol-4.0~early~20200606/cobc/parser.c:860:3: [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 (demangle_name)); data/gnucobol-4.0~early~20200606/cobc/parser.c:11766: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). # define yystrlen strlen data/gnucobol-4.0~early~20200606/cobc/pplex.c:3074:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/gnucobol-4.0~early~20200606/cobc/pplex.c:3787:2: [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 (display_msg, yytext + 1, (size_t)(PPLEX_BUFF_LEN - 1)); data/gnucobol-4.0~early~20200606/cobc/pplex.c:3796:2: [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 (display_msg, yytext, (size_t)(PPLEX_BUFF_LEN - 1)); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5803: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). length += strlen (l->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5811: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). length += strlen (l->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:5926:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ipchar = getc (ppin); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6198: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). && !is_cobol_word_char (bp[strlen (paragraph_name)])) { data/gnucobol-4.0~early~20200606/cobc/pplex.c:6392: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). gotcr = strlen (bp); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6397: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). gotcr = strlen (buff); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6515: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). size = strlen (lno->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6523: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). size = strlen (lno->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6524: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). size2 = strlen (queue->text); data/gnucobol-4.0~early~20200606/cobc/pplex.c:6601: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). msg_len = strlen (display_msg) - 1; data/gnucobol-4.0~early~20200606/cobc/pplex.c:6656:6: [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 (text) > 6) { data/gnucobol-4.0~early~20200606/cobc/ppparse.c:118:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name[strlen (name) - 1] = 0; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:193: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). size = strlen (p->value) - 1; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:1602: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). # define yystrlen strlen data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2193: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). size = strlen (p) - 1; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2214: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). size = strlen (p) - 1; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2234:4: [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). p[strlen (p) - 1] = '\0'; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2248: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). size = strlen (p) - 1; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2270: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). size = strlen (p) - 1; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2332: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). size = strlen (p) - 1; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2473:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = strlen (s) - 1U; data/gnucobol-4.0~early~20200606/cobc/ppparse.c:2481: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). q = cobc_plex_malloc (strlen (s) + 4U); data/gnucobol-4.0~early~20200606/cobc/reserved.c:3916: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). size_t size = strlen (alias_for); data/gnucobol-4.0~early~20200606/cobc/reserved.c:3940: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). word_len = strlen (word); data/gnucobol-4.0~early~20200606/cobc/reserved.c:3971:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cobc_reserved.name = cobc_main_malloc (strlen (user_reserved.word) + 1); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4243:40: [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). amendment->word = cobc_main_malloc (strlen (default_reserved_words[i].name) + 1); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4353: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). aliases_str_len += strlen (reserved_word_map[i]->name); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4368:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (aliases[j], reserved_word_map[i]->name, data/gnucobol-4.0~early~20200606/cobc/reserved.c:4376: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). aliases_str = cobc_malloc (strlen ("(aliased with ") data/gnucobol-4.0~early~20200606/cobc/reserved.c:4378: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). + (num_aliases - 1) * strlen (", ") data/gnucobol-4.0~early~20200606/cobc/reserved.c:4379: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). + strlen (")") data/gnucobol-4.0~early~20200606/cobc/reserved.c:4388: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 (aliases_str, ")"); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4440:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(system_name, CB_NAME (word), COB_MAX_WORDLEN); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4492: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). size = strlen (word); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4645:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t name_len = strlen (name); data/gnucobol-4.0~early~20200606/cobc/reserved.c:4746:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t name_len = strlen (name); data/gnucobol-4.0~early~20200606/cobc/scanner.c:1455: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). result = strlen (buf); \ data/gnucobol-4.0~early~20200606/cobc/scanner.c:1656:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/gnucobol-4.0~early~20200606/cobc/scanner.c:3029:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, yytext, 6); data/gnucobol-4.0~early~20200606/cobc/scanner.c:3030: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(name, "_"); data/gnucobol-4.0~early~20200606/cobc/scanner.c:3240: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). if (last_token_is_dot || strlen (yytext) > 1) { data/gnucobol-4.0~early~20200606/cobc/scanner.c:4295:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lit_out, literal, 38); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4296:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (literal) > 38) { data/gnucobol-4.0~early~20200606/cobc/scanner.c:4423: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). curr_len = strlen (text); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4581: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). currlen = strlen (text); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4632: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). currlen = strlen (text); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4713: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). currlen = strlen (text); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4807: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). currlen = strlen (text); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4897: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). scale = (int)strlen (s) - 1; data/gnucobol-4.0~early~20200606/cobc/scanner.c:4907: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). if (unlikely (strlen (p) > COB_MAX_DIGITS)) { data/gnucobol-4.0~early~20200606/cobc/scanner.c:4911: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). (int) strlen (p), COB_MAX_DIGITS); data/gnucobol-4.0~early~20200606/cobc/scanner.c:4914: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). } else if (unlikely (strlen (p) > cb_numlit_length)) { data/gnucobol-4.0~early~20200606/cobc/scanner.c:4917: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). (int) strlen (p), cb_numlit_length); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5012:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (significand_dec, significand_pos + 1, COB_FLOAT_DIGITS_STR_MAX); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5021: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). sig_int_len = strlen (significand_int); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5022: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). sig_dec_len = strlen (significand_dec); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5036:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (exponent_pos) > 4) { data/gnucobol-4.0~early~20200606/cobc/scanner.c:5175: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). p78->name_len = (cob_u32_t)strlen (f->name); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5232: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). q = &p[strlen(p)-1]; data/gnucobol-4.0~early~20200606/cobc/scanner.c:5240:3: [1] (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). Risk is low because the source is a constant character. strcpy(q,"\n"); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5277: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). size = strlen (s); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5299:17: [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). scale = (int)strlen (q) - 1; data/gnucobol-4.0~early~20200606/cobc/scanner.c:5313:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (s) > COB_MAX_DIGITS) { data/gnucobol-4.0~early~20200606/cobc/scanner.c:5345: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). *word = cobc_malloc (strlen (word_str) - 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5346:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (*word, word_str + 1, strlen (word_str) - 2); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5346: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). strncpy (*word, word_str + 1, strlen (word_str) - 2); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5369:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *word1 = cobc_malloc (strlen (word1_str) - 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5370:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (*word1, word1_str + 1, strlen (word1_str) - 2); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5370: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). strncpy (*word1, word1_str + 1, strlen (word1_str) - 2); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5373:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *word2 = cobc_malloc (strlen (word2_str) - 1); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5374:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (*word2, word2_str + 1, strlen (word2_str) - 2); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5374: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). strncpy (*word2, word2_str + 1, strlen (word2_str) - 2); data/gnucobol-4.0~early~20200606/cobc/scanner.c:5492: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). p78->name_len = (cob_u32_t)strlen (f->name); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:128:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(sdf->format); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:334:4: [1] (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). Risk is low because the source is a constant character. strcpy(p4,""); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:394: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). len = strlen(p2); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:535:6: [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). j = strlen(name); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:971: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). k = strlen(s->sql_when); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1041:9: [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(expr," "); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1048: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). k = strlen(expr); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1072: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). k = strlen(expr); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1275:6: [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). k = strlen(tblname); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1283:2: [1] (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). Risk is low because the source is a constant character. strcpy(prefix,""); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1371:2: [1] (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). Risk is low because the source is a constant character. strcpy(eol,""); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1388:4: [1] (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). Risk is low because the source is a constant character. strcpy(eol,""); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1393:5: [1] (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). Risk is low because the source is a constant character. strcpy(eol,","); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1419:5: [1] (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). Risk is low because the source is a constant character. strcpy(eol,""); data/gnucobol-4.0~early~20200606/cobc/sqlxfdgen.c:1424:6: [1] (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). Risk is low because the source is a constant character. strcpy(eol,","); data/gnucobol-4.0~early~20200606/cobc/tree.c:453:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "(void pointer)", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:454: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). return strlen (orig); data/gnucobol-4.0~early~20200606/cobc/tree.c:459:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "ANY", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:461:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "TRUE", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:463:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "FALSE", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:465:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "NULL", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:467:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "ZERO", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:469:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "SPACE", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:471:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "LOW-VALUE", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:473:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "HIGH-VALUE", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:475:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "QUOTE", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:477:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, _("internal error node"), size); data/gnucobol-4.0~early~20200606/cobc/tree.c:479:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, _("unknown constant"), size); data/gnucobol-4.0~early~20200606/cobc/tree.c:485:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (s, (char *)CB_LITERAL (x)->data, size); data/gnucobol-4.0~early~20200606/cobc/tree.c:494:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (s, "FILLER", size); data/gnucobol-4.0~early~20200606/cobc/tree.c:496:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (s, f->name, size); data/gnucobol-4.0~early~20200606/cobc/tree.c:523:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy (s, ")", size - (s - orig)); data/gnucobol-4.0~early~20200606/cobc/tree.c:561:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy (s, ")", size - (s - orig)); data/gnucobol-4.0~early~20200606/cobc/tree.c:616: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). return strlen (orig); data/gnucobol-4.0~early~20200606/cobc/tree.c:943: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). strlen (cb_name (record))); data/gnucobol-4.0~early~20200606/cobc/tree.c:1189:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (s, tmp, tlen); data/gnucobol-4.0~early~20200606/cobc/tree.c:1203:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (s, tmp, tlen); data/gnucobol-4.0~early~20200606/cobc/tree.c:1607:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lit_out, literal, 38); data/gnucobol-4.0~early~20200606/cobc/tree.c:1608:6: [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 (literal) > 38) { data/gnucobol-4.0~early~20200606/cobc/tree.c:2312: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). p->size = strlen (str); data/gnucobol-4.0~early~20200606/cobc/tree.c:2448:48: [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). p = build_literal (CB_CATEGORY_NUMERIC, data, strlen (data)); data/gnucobol-4.0~early~20200606/cobc/tree.c:2529:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (lit_out, (char *)p->data, 38); data/gnucobol-4.0~early~20200606/cobc/tree.c:3066:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (name_buff, (char *) open_paren + 1, name_length); data/gnucobol-4.0~early~20200606/cobc/tree.c:3148:6: [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 (str) == 0) { data/gnucobol-4.0~early~20200606/cobc/tree.c:4281: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). strlen (f->name)); data/gnucobol-4.0~early~20200606/cobc/tree.c:5378:7: [1] (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). Risk is low because the source is a constant character. strcpy(result,"1"); data/gnucobol-4.0~early~20200606/cobc/tree.c:6482: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). for (k=strlen(result); k > 0 && result[k-1] == '0'; k--) data/gnucobol-4.0~early~20200606/cobc/tree.h:2407: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). #define CB_BUILD_STRING0(str) cb_build_string (str, strlen ((char *)(str))) data/gnucobol-4.0~early~20200606/cobc/typeck.c:1026:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (psyst->syst_name) != 1) { data/gnucobol-4.0~early~20200606/cobc/typeck.c:1127:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buff, CB_FIELD(x)->name, COB_MAX_WORDLEN); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1131: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). size = strlen (buff); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1135: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). size += strlen (CB_FIELD (z)->name); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1347:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (definition, external_definition, COB_MINI_MAX); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1377:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (temp, p, r - p); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1402:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (temp, p, r - p); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1634: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). len = (cob_u32_t) strlen (s); data/gnucobol-4.0~early~20200606/cobc/typeck.c:1669: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). for (t = s + strlen (name); t > s; t--) { data/gnucobol-4.0~early~20200606/cobc/typeck.c:1815: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). return cb_build_alphanumeric_literal (name_ptr, strlen (name_ptr)); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2316:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return cb_build_numsize_literal (buff, strlen(buff), 0); data/gnucobol-4.0~early~20200606/cobc/typeck.c:2382:59: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return cb_build_alphanumeric_literal (p->value, (size_t)strlen(p->value)); data/gnucobol-4.0~early~20200606/cobc/typeck.c:3425:65: [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). assign = CB_TREE (build_literal (CB_CATEGORY_ALPHANUMERIC, c, strlen ((char *)c))); data/gnucobol-4.0~early~20200606/cobc/typeck.c:6210:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ext_form_id = cb_build_alphanumeric_literal (f->name, strlen (f->name)); data/gnucobol-4.0~early~20200606/cobc/typeck.c:6278: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). strlen (f_ref_field->name)); data/gnucobol-4.0~early~20200606/cobc/typeck.c:7918: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). m = cb_build_alphanumeric_literal (f->name, strlen(f->name)); data/gnucobol-4.0~early~20200606/lib/gettext.h:214:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgctxt_len = strlen (msgctxt) + 1; data/gnucobol-4.0~early~20200606/lib/gettext.h:215:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/gnucobol-4.0~early~20200606/lib/gettext.h:262:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgctxt_len = strlen (msgctxt) + 1; data/gnucobol-4.0~early~20200606/lib/gettext.h:263:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/gnucobol-4.0~early~20200606/libcob/call.c:1070:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (buff); data/gnucobol-4.0~early~20200606/libcob/call.c:1618: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). for (k=strlen(prog); k > 0 && prog[k-1] == ' '; k--) data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:466: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). if (namelen == (unsigned int) strlen (p->name)) { data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:515: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). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:551:17: [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). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:569:17: [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). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:574: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). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:692: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). if ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:718:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:741: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). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:758: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). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/cobgetopt.c:763:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen (nextchar); data/gnucobol-4.0~early~20200606/libcob/common.c:671:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (msg, strerror (errno), COB_ERRBUF_SIZE - 1); data/gnucobol-4.0~early~20200606/libcob/common.c:1460:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (s) == 1 && (*s == 'Y' || *s == 'y' || *s == '1')) return 1; data/gnucobol-4.0~early~20200606/libcob/common.c:1472: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). return s && ((strlen (s) == 1 && (*s == 'N' || *s == 'n' || *s == '0')) data/gnucobol-4.0~early~20200606/libcob/common.c:1616:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (cobsetptr->cob_user_name)); data/gnucobol-4.0~early~20200606/libcob/common.c:1699:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (p); data/gnucobol-4.0~early~20200606/libcob/common.c:1823: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 last_pos = (int)(strlen (cobsetptr->cob_trace_format) - 1); data/gnucobol-4.0~early~20200606/libcob/common.c:2049:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (str, _ ("NULL field"), maxsize); data/gnucobol-4.0~early~20200606/libcob/common.c:2059:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (str, _ ("field with NULL address"), maxsize); data/gnucobol-4.0~early~20200606/libcob/common.c:3191: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). eptr->ename = cob_malloc (strlen (exname) + 1U); data/gnucobol-4.0~early~20200606/libcob/common.c:3652:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (iso_timezone_ptr, cobsetptr->cob_date + j, 6); data/gnucobol-4.0~early~20200606/libcob/common.c:3654:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (iso_timezone_ptr) == 3) { data/gnucobol-4.0~early~20200606/libcob/common.c:3657:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (iso_timezone_ptr + 3, cobsetptr->cob_date + j + 4, 3); data/gnucobol-4.0~early~20200606/libcob/common.c:3887: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). size += (strlen (cob_argv[i]) + 1); data/gnucobol-4.0~early~20200606/libcob/common.c:3896:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (cob_argv[i]); data/gnucobol-4.0~early~20200606/libcob/common.c:3954:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (cob_argv[current_arg])); data/gnucobol-4.0~early~20200606/libcob/common.c:3987:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (name) + strlen (value) + 2U; data/gnucobol-4.0~early~20200606/libcob/common.c:3987:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (name) + strlen (value) + 2U; data/gnucobol-4.0~early~20200606/libcob/common.c:4002: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). env = cob_fast_malloc (strlen (name) + 2U); data/gnucobol-4.0~early~20200606/libcob/common.c:4022: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 (i = 0; i < strlen (cob_local_env); ++i) { data/gnucobol-4.0~early~20200606/libcob/common.c:4078: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). for (size = 0; size < strlen (buff); ++size) { data/gnucobol-4.0~early~20200606/libcob/common.c:4089: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). cob_memcpy (envval, p, strlen (p)); data/gnucobol-4.0~early~20200606/libcob/common.c:4105: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). cob_memcpy (f, p, strlen (p)); data/gnucobol-4.0~early~20200606/libcob/common.c:4117:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (cob_argv[parm]); data/gnucobol-4.0~early~20200606/libcob/common.c:4321:6: [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 (dir) > COB_NORMAL_MAX) return 1; data/gnucobol-4.0~early~20200606/libcob/common.c:5109:4: [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 (micsecs); data/gnucobol-4.0~early~20200606/libcob/common.c:5338: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). msize = strlen (COB_MODULE_PTR->next->module_name); data/gnucobol-4.0~early~20200606/libcob/common.c:5510: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). optlen = strlen (cob_optarg); data/gnucobol-4.0~early~20200606/libcob/common.c:5754:6: [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). l = strlen (str1) + strlen (str2) + 1; data/gnucobol-4.0~early~20200606/libcob/common.c:5754:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen (str1) + strlen (str2) + 1; data/gnucobol-4.0~early~20200606/libcob/common.c:5816: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). lablen = CB_IMSG_SIZE - 2 - (int)strlen (_("env")) - 2; data/gnucobol-4.0~early~20200606/libcob/common.c:5848: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). lablen = CB_IMSG_SIZE - 2 - (int)strlen (_("env")) - 2; data/gnucobol-4.0~early~20200606/libcob/common.c:5877: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). if (val && strlen (val) <= CB_IVAL_SIZE) { data/gnucobol-4.0~early~20200606/libcob/common.c:5895:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int toklen = (int)strlen (token) + 1; data/gnucobol-4.0~early~20200606/libcob/common.c:5973: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 (penv) + j) > (envlen - 128)) { data/gnucobol-4.0~early~20200606/libcob/common.c:5974: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). env = cob_realloc (env, envlen, strlen (penv) + 256); data/gnucobol-4.0~early~20200606/libcob/common.c:5975: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). envlen = strlen (penv) + 256; data/gnucobol-4.0~early~20200606/libcob/common.c:6268: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). slen = (int)strlen (value); data/gnucobol-4.0~early~20200606/libcob/common.c:6317: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). min_conf_length = (char) strlen (not_set) + 1; data/gnucobol-4.0~early~20200606/libcob/common.c:6480: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). for (j= (int)strlen (buf); buf[j-1] == '\r' || buf[j-1] == '\n'; ) /* Remove CR LF */ data/gnucobol-4.0~early~20200606/libcob/common.c:6526:3: [1] (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). Risk is low because the source is a constant character. strcpy (value2, ""); data/gnucobol-4.0~early~20200606/libcob/common.c:6530:17: [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). i = i - (int)strlen (value + k); data/gnucobol-4.0~early~20200606/libcob/common.c:6664:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buff, data/gnucobol-4.0~early~20200606/libcob/common.c:6667: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). size = strlen (buff); data/gnucobol-4.0~early~20200606/libcob/common.c:6782:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (conf_file, env, (size_t)COB_MEDIUM_MAX); data/gnucobol-4.0~early~20200606/libcob/common.c:6966: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). p = runtime_err_str + strlen (runtime_err_str); data/gnucobol-4.0~early~20200606/libcob/common.c:7592:2: [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 string. strncat (versbuff2, " - ", 3); data/gnucobol-4.0~early~20200606/libcob/common.c:7593:2: [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 (versbuff2, versbuff, 55); data/gnucobol-4.0~early~20200606/libcob/common.c:7646:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (value, _("via"), (size_t)COB_MEDIUM_MAX); data/gnucobol-4.0~early~20200606/libcob/common.c:7648: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). hdlen = (unsigned int)strlen (value) + 3; data/gnucobol-4.0~early~20200606/libcob/common.c:7653:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (value, cobsetptr->cob_config_file[0], (size_t)COB_MEDIUM_MAX); data/gnucobol-4.0~early~20200606/libcob/common.c:7655:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vl = (unsigned int)strlen (value); data/gnucobol-4.0~early~20200606/libcob/common.c:7664:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (value, cobsetptr->cob_config_file[i], (size_t)COB_MEDIUM_MAX); data/gnucobol-4.0~early~20200606/libcob/common.c:7666: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). vl = (unsigned int)strlen (value); data/gnucobol-4.0~early~20200606/libcob/common.c:7678: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). j = (unsigned int)strlen (gc_conf[i].env_name); data/gnucobol-4.0~early~20200606/libcob/common.c:7681: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). j = (unsigned int)strlen (gc_conf[i].conf_name); data/gnucobol-4.0~early~20200606/libcob/common.c:7753:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vl = (unsigned int)strlen (value); data/gnucobol-4.0~early~20200606/libcob/common.c:8511:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ln = strlen(fmt); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:392: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). dbt.size = (cob_dbtsize_t) strlen (filename); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1225: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). p->filenamelen = (int) strlen (filename); data/gnucobol-4.0~early~20200606/libcob/fbdb.c:1363: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). p->filename = cob_malloc (strlen (filename) + 1); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:143:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (assignto, f->select_name, sizeof(assignto)-1); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:162: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). fnlen = strlen(assignto); data/gnucobol-4.0~early~20200606/libcob/fextfh.c:929:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_open_name, f->fcd->fnamePtr, LDCOMPX2(f->fcd->fnameLen)); data/gnucobol-4.0~early~20200606/libcob/fileio.c:486:12: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. k += sprintf(&out[k],","); data/gnucobol-4.0~early~20200606/libcob/fileio.c:882:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (file_open_name, p, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.c:909:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (file_open_name, file_open_buff, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.c:944:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (file_open_buff, src, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.c:947:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (file_open_buff, p, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.c:968:4: [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_open_buff, src, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.c:970:4: [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_open_buff, p, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1414: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). f->xfdschema = cob_cache_malloc (strlen(value) + strlen(COB_SCHEMA_DIR) + 8); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1414:55: [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). f->xfdschema = cob_cache_malloc (strlen(value) + strlen(COB_SCHEMA_DIR) + 8); data/gnucobol-4.0~early~20200606/libcob/fileio.c:1680:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). f->keys[idx].len_suppress = (short)strlen (value); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2293:6: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,""); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2296:7: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,","); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2298:6: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,""); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2302:7: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,","); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2323:5: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,""); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2326:6: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,","); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2329:5: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,""); data/gnucobol-4.0~early~20200606/libcob/fileio.c:2332:6: [1] (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). Risk is low because the source is a constant character. strcpy(prcoma,","); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3233:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytesread = read (f->fd, recsize.sbuff, f->record_prefix); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3276:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytesread = read (f->fd, f->record->data, f->record->size); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3281:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(f->fd, recsize.sbuff, padlen) != padlen) /* Read past padding chars */ data/gnucobol-4.0~early~20200606/libcob/fileio.c:3416:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytesread = read (f->fd, recsize.sbuff, f->record_prefix); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3489:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = getc ((FILE *)f->file); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3499:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = getc ((FILE *)f->file); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3524:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = getc ((FILE *)f->file); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3527:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = getc ((FILE *)f->file); data/gnucobol-4.0~early~20200606/libcob/fileio.c:3820:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (f->fd, rechdr, f->record_prefix) != f->record_prefix) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:3861:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (f->fd, rechdr, 1) != 1) data/gnucobol-4.0~early~20200606/libcob/fileio.c:4012:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (f->fd, f->record->data, (size_t)relsize) != relsize) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:4030:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (f->fd, recmark, 1) != 1) /* Active Record marker */ data/gnucobol-4.0~early~20200606/libcob/fileio.c:5215:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fileio_funcs[get_io_ptr (f)]->read (&file_api, f, key, read_opts); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5260:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fileio_funcs[get_io_ptr (f)]->read (&file_api, f, f->keys[k].field, 0); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5791:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read (fd, buf, len); data/gnucobol-4.0~early~20200606/libcob/fileio.c:5923:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((i = read (fd1, file_open_buff, COB_FILE_BUFF)) > 0) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:6050: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). dir_size = (int) strlen (dirname); data/gnucobol-4.0~early~20200606/libcob/fileio.c:6512:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (getc (fp) != 0) { data/gnucobol-4.0~early~20200606/libcob/fileio.c:7020:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (file_open_name, file_open_env, (size_t)COB_FILE_MAX); data/gnucobol-4.0~early~20200606/libcob/fileio.h:152:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*read) (cob_file_api *, cob_file *, cob_field *, const int); data/gnucobol-4.0~early~20200606/libcob/flmdb.c:1065: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). p->filenamelen = strlen(filename); data/gnucobol-4.0~early~20200606/libcob/focextfh.c:436:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return fileio_funcs[get_io_ptr (f)]->read (a, f, k, read_opts); data/gnucobol-4.0~early~20200606/libcob/foci.c:145:2: [1] (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). Risk is low because the source is a constant character. strcpy(errMsg,""); data/gnucobol-4.0~early~20200606/libcob/foci.c:152:6: [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). i = strlen(errMsg); data/gnucobol-4.0~early~20200606/libcob/foci.c:172:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i = strlen(env); data/gnucobol-4.0~early~20200606/libcob/foci.c:279: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). env = (void*)malloc(strlen(db->dbUser)+20); data/gnucobol-4.0~early~20200606/libcob/foci.c:284: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). env = (void*)malloc(strlen(db->dbPwd)+20); data/gnucobol-4.0~early~20200606/libcob/foci.c:289: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). env = (void*)malloc(strlen(db->dbName)+20); data/gnucobol-4.0~early~20200606/libcob/foci.c:319:3: [1] (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). Risk is low because the source is a constant character. strcpy(msg,""); data/gnucobol-4.0~early~20200606/libcob/foci.c:351:3: [1] (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). Risk is low because the source is a constant character. strcpy(msg,""); data/gnucobol-4.0~early~20200606/libcob/foci.c:507: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). ln = (int)strlen((char*)fx->map[k].sdata); data/gnucobol-4.0~early~20200606/libcob/foci.c:549:56: [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). OCIStmtPrepare(s->handle,db->dbErrH,(text*)s->text,strlen(s->text), data/gnucobol-4.0~early~20200606/libcob/foci.c:678:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(stmt); data/gnucobol-4.0~early~20200606/libcob/foci.c:833: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). (text*)db->dbName, strlen(db->dbName), OCI_DEFAULT) ) ) { data/gnucobol-4.0~early~20200606/libcob/foci.c:863: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). (text *)db->dbUser, strlen(db->dbUser), data/gnucobol-4.0~early~20200606/libcob/foci.c:871: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). (text *)db->dbPwd, strlen(db->dbPwd), data/gnucobol-4.0~early~20200606/libcob/foci.c:930:6: [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(db->dateFormat) > 0) { data/gnucobol-4.0~early~20200606/libcob/foci.c:1077:2: [1] (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). Risk is low because the source is a constant character. strcpy(varFetch,"0"); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:395:6: [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). i = strlen(errMsg); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:607:44: [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). SQLPrepare(s->handle,(SQLCHAR*)s->text,strlen(s->text)))){ data/gnucobol-4.0~early~20200606/libcob/fodbc.c:834:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(stmt); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1012: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). (SQLCHAR*)db->dbDsn,strlen(db->dbDsn), data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1053: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). (SQLCHAR*)db->dbDsn,strlen(db->dbDsn), data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1054: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). (SQLCHAR*)db->dbUser,strlen(db->dbUser), data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1055: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). (SQLCHAR*)db->dbPwd, strlen(db->dbPwd)))) { data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1090:4: [1] (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). Risk is low because the source is a constant character. strcpy(amsg,""); data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1107:6: [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(db->dateFormat) > 0) { data/gnucobol-4.0~early~20200606/libcob/fodbc.c:1310:2: [1] (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). Risk is low because the source is a constant character. strcpy(varFetch,"0"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:187:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (msg, strerror (errno), sizeof(msg) - 1); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:949: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). return strlen(dataout); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1029: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). for(k=strlen (xfdbuf); k > 0 data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1064: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). mx->lncolname = strlen(colname); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1100:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = strlen(p); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1117: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). mx->lncolname = strlen(colname); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1121: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). mx->lnvalue = strlen(tstval); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1321: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). for(k=strlen (xfdbuf); k > 0 data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1375: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). fx->lncreate = strlen(fx->create_table); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1400:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(stmt); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1483: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). len = strlen((char*)fx->map[k].sdata); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1513: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). len = strlen((char*)fx->map[k].sdata); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1758:2: [1] (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). Risk is low because the source is a constant character. strcpy(andstr,"("); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1770:10: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. pos += sprintf(&sbuf[pos],")"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1839:4: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1845:6: [1] (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). Risk is low because the source is a constant character. strcpy(comma,","); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1853:17: [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). bufsz = 16 + strlen(stmt) + fx->lnselect; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1854: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). bufsz += strlen(rowcol) + 64; data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1856:17: [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). bufsz = 16 + strlen(stmt) + fx->lnselect + (fx->key[idx]->lncols * 3); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1867:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1883:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1925:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1932:5: [1] (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). Risk is low because the source is a constant character. strcpy(comma,","); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1963:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufsz = 32 + fx->lncols + fx->ncols * 4 + strlen(fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1966:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1976:5: [1] (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). Risk is low because the source is a constant character. strcpy(comma,","); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1980:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1983:4: [1] (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). Risk is low because the source is a constant character. strcpy(comma,","); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1985:10: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. pos += sprintf(&sbuf[pos],")"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1988:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufsz = 48 + fx->lncols + fx->ncols * 8 + strlen(fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:1990:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2001:5: [1] (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). Risk is low because the source is a constant character. strcpy(comma,","); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2005:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2017:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufsz = 32 + fx->lncols + fx->ncols * 4 + strlen(fx->tablename); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2019:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2026:3: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2377:2: [1] (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). Risk is low because the source is a constant character. strcpy(comma,"\n"); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2438:4: [1] (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). Risk is low because the source is a constant character. strcpy(comma,""); data/gnucobol-4.0~early~20200606/libcob/fsqlxfd.c:2442:5: [1] (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). Risk is low because the source is a constant character. strcpy(comma,","); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:849: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). len = (cob_sli_t)strlen (p); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:1770: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). const size_t str_len = strlen (str); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2334:6: [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 (str) > (size_t) offset) { data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2427:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (out_str, (char *)f->data, length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2448:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (first, str, first_length); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2454:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (str) - i == 0) { data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:2457: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). second_length = strlen (str) - i - 1U; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3458:6: [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 (format) > (size_t) format_offset data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3720: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). calcsize = strlen (COB_MODULE_PTR->module_name); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3740: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). calcsize = strlen (COB_MODULE_PTR->next->module_name); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3754: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). calcsize = strlen (COB_MODULE_PTR->module_formatted_date); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3768: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). calcsize = strlen (COB_MODULE_PTR->module_source); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3789: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). calcsize = strlen (*(COB_MODULE_PTR->module_path)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3922: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). flen = strlen (cobglobptr->cob_error_file->select_name); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3971: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). field.size = strlen (buff); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:3994:42: [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). memcpy (curr_field->data, except_name, strlen (except_name)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:4011: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). flen = strlen (cobglobptr->last_exception_statement); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5696: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). size = strlen (p->mon_decimal_point); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5731: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). size = strlen (p->decimal_point); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5766: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). size = strlen (p->mon_thousands_sep); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5801: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). size = strlen (p->thousands_sep); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:5836: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). size = strlen (p->currency_symbol); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6134:17: [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). field_length = strlen (format_str); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6154: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). memset (curr_field->data, ' ', strlen (format_str)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6205:17: [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). field_length = strlen (format_str); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6246: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). memset (curr_field->data, ' ', strlen (format_str)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6302:17: [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). field_length = strlen (fmt_str); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6349: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). memset (curr_field->data, ' ', strlen (fmt_str)); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6421: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). time_part_offset = (int)strlen (formatted_date) + 1; data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6436: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). && formatted_datetime[strlen (formatted_date)] != 'T') { data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6437:43: [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). cob_alloc_set_field_uint ((unsigned int)strlen (formatted_date) + 1U); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6526:17: [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). field_length = strlen (format_str); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6576: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). val = (cob_u32_t)strlen ((char *)pointed); data/gnucobol-4.0~early~20200606/libcob/intrinsic.c:6626:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = strlen ((char *)pointed); data/gnucobol-4.0~early~20200606/libcob/mlio.c:880: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). print_len = strlen (printed_json); data/gnucobol-4.0~early~20200606/libcob/move.c:2532:6: [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). j = strlen ((char*)string); data/gnucobol-4.0~early~20200606/libcob/numeric.c:200:17: [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). freefunc (ptr, strlen((char*) ptr) + 1); data/gnucobol-4.0~early~20200606/libcob/numeric.c:759: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). len = (cob_sli_t)strlen (p); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1087: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). size = strlen (mza); data/gnucobol-4.0~early~20200606/libcob/numeric.c:1293: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). size = strlen (p); data/gnucobol-4.0~early~20200606/libcob/reportio.c:497:5: [1] (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). Risk is low because the source is a constant character. strcpy(wrk,""); data/gnucobol-4.0~early~20200606/libcob/reportio.c:704:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (fld, rc->name, COB_MAX_WORDLEN); data/gnucobol-4.0~early~20200606/libcob/reportio.c:873:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ln = strlen(wrk); data/gnucobol-4.0~early~20200606/libcob/screenio.c:3119:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). COB_FIELD_INIT (strlen (text), (unsigned char *)text, &attr); data/gnucobol-4.0~early~20200606/libcob/termio.c:184: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). memmove (pos, pos + 1, strlen (pos)); data/gnucobol-4.0~early~20200606/libcob/termio.c:580:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (vname, name, (size_t)COB_MAX_WORDLEN); data/gnucobol-4.0~early~20200606/libcob/termio.c:592: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 (vname,","); data/gnucobol-4.0~early~20200606/libcob/termio.c:594: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). sprintf(&vname[strlen(vname)],"%d",subscript+1); data/gnucobol-4.0~early~20200606/libcob/termio.c:596:4: [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 (vname,")"); data/gnucobol-4.0~early~20200606/libcob/termio.c:613:4: [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(vname,"."); data/gnucobol-4.0~early~20200606/libcob/termio.c:625:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(vname) > 30) data/gnucobol-4.0~early~20200606/libcob/termio.c:694:12: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ipchr = getchar (); data/gnucobol-4.0~early~20200606/libcob/termio.c:709:11: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ipchr = getchar (); ANALYSIS SUMMARY: Hits = 2239 Lines analyzed = 163060 in approximately 4.26 seconds (38237 lines/second) Physical Source Lines of Code (SLOC) = 139706 Hits@level = [0] 833 [1] 587 [2] 1196 [3] 66 [4] 388 [5] 2 Hits@level+ = [0+] 3072 [1+] 2239 [2+] 1652 [3+] 456 [4+] 390 [5+] 2 Hits/KSLOC@level+ = [0+] 21.989 [1+] 16.0265 [2+] 11.8248 [3+] 3.264 [4+] 2.79158 [5+] 0.0143158 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.