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/meep-mpi-default-1.12.0/doc/docs/Developer_Codes/WriteChunkInfo.cpp Examining data/meep-mpi-default-1.12.0/libpympb/pympb.cpp Examining data/meep-mpi-default-1.12.0/libpympb/pympb.hpp Examining data/meep-mpi-default-1.12.0/python/typemap_utils.cpp Examining data/meep-mpi-default-1.12.0/scheme/meep-ctl-const.hpp Examining data/meep-mpi-default-1.12.0/scheme/meep-ctl-swig.hpp Examining data/meep-mpi-default-1.12.0/scheme/meep-ctl.hpp Examining data/meep-mpi-default-1.12.0/scheme/meep.cpp Examining data/meep-mpi-default-1.12.0/scheme/structure.cpp Examining data/meep-mpi-default-1.12.0/src/GDSIIgeom.cpp Examining data/meep-mpi-default-1.12.0/src/anisotropic_averaging.cpp Examining data/meep-mpi-default-1.12.0/src/array_slice.cpp Examining data/meep-mpi-default-1.12.0/src/bands.cpp Examining data/meep-mpi-default-1.12.0/src/bicgstab.cpp Examining data/meep-mpi-default-1.12.0/src/bicgstab.hpp Examining data/meep-mpi-default-1.12.0/src/boundaries.cpp Examining data/meep-mpi-default-1.12.0/src/casimir.cpp Examining data/meep-mpi-default-1.12.0/src/control_c.cpp Examining data/meep-mpi-default-1.12.0/src/cw_fields.cpp Examining data/meep-mpi-default-1.12.0/src/dft.cpp Examining data/meep-mpi-default-1.12.0/src/dft_ldos.cpp Examining data/meep-mpi-default-1.12.0/src/energy_and_flux.cpp Examining data/meep-mpi-default-1.12.0/src/fields.cpp Examining data/meep-mpi-default-1.12.0/src/h5fields.cpp Examining data/meep-mpi-default-1.12.0/src/h5file.cpp Examining data/meep-mpi-default-1.12.0/src/initialize.cpp Examining data/meep-mpi-default-1.12.0/src/integrate.cpp Examining data/meep-mpi-default-1.12.0/src/integrate2.cpp Examining data/meep-mpi-default-1.12.0/src/loop_in_chunks.cpp Examining data/meep-mpi-default-1.12.0/src/material_data.hpp Examining data/meep-mpi-default-1.12.0/src/meep.hpp Examining data/meep-mpi-default-1.12.0/src/meep/mympi.hpp Examining data/meep-mpi-default-1.12.0/src/meep/vec.hpp Examining data/meep-mpi-default-1.12.0/src/meep_internals.hpp Examining data/meep-mpi-default-1.12.0/src/meepgeom.cpp Examining data/meep-mpi-default-1.12.0/src/meepgeom.hpp Examining data/meep-mpi-default-1.12.0/src/monitor.cpp Examining data/meep-mpi-default-1.12.0/src/mpb.cpp Examining data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp Examining data/meep-mpi-default-1.12.0/src/mympi.cpp Examining data/meep-mpi-default-1.12.0/src/near2far.cpp Examining data/meep-mpi-default-1.12.0/src/output_directory.cpp Examining data/meep-mpi-default-1.12.0/src/random.cpp Examining data/meep-mpi-default-1.12.0/src/sources.cpp Examining data/meep-mpi-default-1.12.0/src/sphere-quad.cpp Examining data/meep-mpi-default-1.12.0/src/step.cpp Examining data/meep-mpi-default-1.12.0/src/step_db.cpp Examining data/meep-mpi-default-1.12.0/src/step_generic.cpp Examining data/meep-mpi-default-1.12.0/src/stress.cpp Examining data/meep-mpi-default-1.12.0/src/structure.cpp Examining data/meep-mpi-default-1.12.0/src/structure_dump.cpp Examining data/meep-mpi-default-1.12.0/src/support/meep_mt.h Examining data/meep-mpi-default-1.12.0/src/support/mt19937ar.c Examining data/meep-mpi-default-1.12.0/src/susceptibility.cpp Examining data/meep-mpi-default-1.12.0/src/time.cpp Examining data/meep-mpi-default-1.12.0/src/update_eh.cpp Examining data/meep-mpi-default-1.12.0/src/update_pols.cpp Examining data/meep-mpi-default-1.12.0/src/vec.cpp Examining data/meep-mpi-default-1.12.0/tests/2D_convergence.cpp Examining data/meep-mpi-default-1.12.0/tests/absorber-1d-ll.cpp Examining data/meep-mpi-default-1.12.0/tests/aniso_disp.cpp Examining data/meep-mpi-default-1.12.0/tests/array-metadata.cpp Examining data/meep-mpi-default-1.12.0/tests/array-slice-ll.cpp Examining data/meep-mpi-default-1.12.0/tests/bench.cpp Examining data/meep-mpi-default-1.12.0/tests/bend-flux-ll.cpp Examining data/meep-mpi-default-1.12.0/tests/bragg_transmission.cpp Examining data/meep-mpi-default-1.12.0/tests/convergence_cyl_waveguide.cpp Examining data/meep-mpi-default-1.12.0/tests/cyl-ellipsoid-ll.cpp Examining data/meep-mpi-default-1.12.0/tests/cylindrical.cpp Examining data/meep-mpi-default-1.12.0/tests/dft-fields.cpp Examining data/meep-mpi-default-1.12.0/tests/flux.cpp Examining data/meep-mpi-default-1.12.0/tests/gdsII-3d.cpp Examining data/meep-mpi-default-1.12.0/tests/h5test.cpp Examining data/meep-mpi-default-1.12.0/tests/harmonics.cpp Examining data/meep-mpi-default-1.12.0/tests/integrate.cpp Examining data/meep-mpi-default-1.12.0/tests/known_results.cpp Examining data/meep-mpi-default-1.12.0/tests/near2far.cpp Examining data/meep-mpi-default-1.12.0/tests/one_dimensional.cpp Examining data/meep-mpi-default-1.12.0/tests/physical.cpp Examining data/meep-mpi-default-1.12.0/tests/pml.cpp Examining data/meep-mpi-default-1.12.0/tests/pw-source-ll.cpp Examining data/meep-mpi-default-1.12.0/tests/ring-ll.cpp Examining data/meep-mpi-default-1.12.0/tests/stress_tensor.cpp Examining data/meep-mpi-default-1.12.0/tests/symmetry.cpp Examining data/meep-mpi-default-1.12.0/tests/three_d.cpp Examining data/meep-mpi-default-1.12.0/tests/two_dimensional.cpp Examining data/meep-mpi-default-1.12.0/tests/user-defined-material.cpp FINAL RESULTS: data/meep-mpi-default-1.12.0/src/output_directory.cpp:39:7: [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. if (readlink(symlink_name, buf, 300) > 0) { data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:115:36: [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). if (d->parity & EVEN_Z_PARITY) { strcat(s, (d->nz == 1) ? "te" : "zeven"); } data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:117: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(s, (d->nz == 1) ? "tm" : "zodd"); data/meep-mpi-default-1.12.0/scheme/structure.cpp:172: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(fname, eps_input_file); data/meep-mpi-default-1.12.0/src/fields.cpp:36: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(outdir, s->outdir); data/meep-mpi-default-1.12.0/src/fields.cpp:92: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(outdir, thef.outdir); data/meep-mpi-default-1.12.0/src/h5file.cpp:161: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(filename, filename_); data/meep-mpi-default-1.12.0/src/h5file.cpp:223: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(cur_dataname, dataname); data/meep-mpi-default-1.12.0/src/h5file.cpp:276: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(*dname, name); data/meep-mpi-default-1.12.0/src/h5file.cpp:524: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(cur->dataname, dataname); data/meep-mpi-default-1.12.0/src/meep/mympi.hpp:43:49: [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 PRINTF_ATTR(f, a) __attribute__((format(printf, f, a))) data/meep-mpi-default-1.12.0/src/meepgeom.cpp:1589: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(fname, eps_input_file); data/meep-mpi-default-1.12.0/src/mympi.cpp:588:7: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/meep-mpi-default-1.12.0/src/mympi.cpp:606: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(debf, fmt, ap); data/meep-mpi-default-1.12.0/src/mympi.cpp:615:5: [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(f, fmt, ap); data/meep-mpi-default-1.12.0/src/output_directory.cpp:50: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(outdir, name); data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:740:5: [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(time(NULL)); data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:748:5: [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(314159); // * (rank + 1)); data/meep-mpi-default-1.12.0/tests/array-metadata.cpp:150: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. char *LogFileName = getenv("MEEP_ARRAY_METADATA_LOGFILE"); data/meep-mpi-default-1.12.0/tests/h5test.cpp:386: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(314159); /* deterministic "rand" */ data/meep-mpi-default-1.12.0/tests/integrate.cpp:336: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(0); // use fixed random sequence data/meep-mpi-default-1.12.0/doc/docs/Developer_Codes/WriteChunkInfo.cpp:72: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 FileName[100]; data/meep-mpi-default-1.12.0/doc/docs/Developer_Codes/WriteChunkInfo.cpp:74:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(FileName, "w"); data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:39: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((rb), (sb), (n) * sizeof(ctype)); \ data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:113:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char s[128]; data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:119:36: [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. if (d->parity & EVEN_Y_PARITY) { strcat(s, "yeven"); } data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:121: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(s, "yodd"); data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:176: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(d->S, d->S2, sizeof(mpb_real) * d->p * X.p * SCALAR_NUMVALS); data/meep-mpi-default-1.12.0/python/typemap_utils.cpp:448: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(md->epsilon_data, (realnum *)PyArray_DATA(pao), PyArray_SIZE(pao) * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/GDSIIgeom.cpp:83: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 Description[100]; data/meep-mpi-default-1.12.0/src/array_slice.cpp:387: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(array + offset, buffer, xfer_size * sizeof(double)); data/meep-mpi-default-1.12.0/src/bands.cpp:92:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen("harminv.dat", "w"); data/meep-mpi-default-1.12.0/src/dft.cpp:292: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 dataname[1024]; data/meep-mpi-default-1.12.0/src/dft.cpp:315: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 dataname[1024]; data/meep-mpi-default-1.12.0/src/dft.cpp:941: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 dataname[100]; data/meep-mpi-default-1.12.0/src/dft.cpp:970:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(field_array + offset, buf, size * sizeof(cdouble)); data/meep-mpi-default-1.12.0/src/dft.cpp:1059: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 filename[100]; data/meep-mpi-default-1.12.0/src/dft.cpp:1088: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. char dataname[100], filename[100]; data/meep-mpi-default-1.12.0/src/energy_and_flux.cpp:106: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##_backup[c][cmp], f[c][cmp], gv.ntot() * sizeof(realnum)); \ data/meep-mpi-default-1.12.0/src/energy_and_flux.cpp:123: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[c][cmp], f##_backup[c][cmp], gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/fields.cpp:318: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(f[c][cmp], thef.f[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/fields.cpp:322: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(f_u[c][cmp], thef.f_u[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/fields.cpp:326: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(f_w[c][cmp], thef.f_w[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/fields.cpp:330: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(f_cond[c][cmp], thef.f_cond[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/fields.cpp:338: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(f[c][cmp], thef.f[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/fields.cpp:354: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(f_minus_p[c][cmp], thef.f_minus_p[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/fields.cpp:358: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(f_w_prev[c][cmp], thef.f_w_prev[c][cmp], sizeof(realnum) * gv.ntot()); data/meep-mpi-default-1.12.0/src/h5fields.cpp:390: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 dataname[256]; data/meep-mpi-default-1.12.0/src/h5fields.cpp:431:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char filename[buflen]; data/meep-mpi-default-1.12.0/src/h5fields.cpp:432: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 time_step_string[32] = ""; data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:36: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(Gamma, theGamma, sizeof(realnum) * L * L); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:38: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(N0, theN0, sizeof(realnum) * L); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:40: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(alpha, thealpha, sizeof(realnum) * L * T); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:42: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(omega, theomega, sizeof(realnum) * T); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:44: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(gamma, thegamma, sizeof(realnum) * T); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:46: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(sigmat, thesigmat, sizeof(realnum) * T * 5); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:54: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(Gamma, from.Gamma, sizeof(realnum) * L * L); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:56: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(N0, from.N0, sizeof(realnum) * L); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:58: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(alpha, from.alpha, sizeof(realnum) * L * T); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:60: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(omega, from.omega, sizeof(realnum) * T); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:62: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(gamma, from.gamma, sizeof(realnum) * T); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp: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(sigmat, from.sigmat, sizeof(realnum) * T * 5); data/meep-mpi-default-1.12.0/src/multilevel-atom.cpp:202: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(dnew, d, d->sz_data); data/meep-mpi-default-1.12.0/src/mympi.cpp:318:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(double) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:326:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(float) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp: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(out, in, sizeof(double) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:403:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(size_t) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:412:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(size_t) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:461:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(int) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:470:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(size_t) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:488:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, sizeof(int) * size); data/meep-mpi-default-1.12.0/src/mympi.cpp:601: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[50]; data/meep-mpi-default-1.12.0/src/mympi.cpp:603: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). debf = fopen(temp, "w"); data/meep-mpi-default-1.12.0/src/mympi.cpp:621:27: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = am_master() ? fopen(name, mode) : 0; data/meep-mpi-default-1.12.0/src/near2far.cpp:389: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. static char filename[buflen]; data/meep-mpi-default-1.12.0/src/near2far.cpp:394: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 dataname[128]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:36: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[300]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:58: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). FILE *fa = fopen(a, "r"); data/meep-mpi-default-1.12.0/src/output_directory.cpp:59: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). FILE *fb = fopen(b, "w"); data/meep-mpi-default-1.12.0/src/output_directory.cpp:87: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 n[buflen]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:96: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 basename[buflen]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:98: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 stripped_name[buflen]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:116: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 sourcename[buflen]; // Holds the "example.cpp" filename. data/meep-mpi-default-1.12.0/src/output_directory.cpp:124:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char outdirname[buflen]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:133: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 outsrcname[buflen]; data/meep-mpi-default-1.12.0/src/step_db.cpp:67:9: [2] (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_u[cc][cmp], the_f, gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/structure.cpp:804:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(chi1inv[c][d], o->chi1inv[c][d], gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/structure.cpp:810:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(conductivity[c][d], o->conductivity[c][d], gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/structure.cpp:812:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(condinv[c][d], o->condinv[c][d], gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/structure_dump.cpp:272: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 dname[20]; data/meep-mpi-default-1.12.0/src/structure_dump.cpp:643: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 dname[20]; data/meep-mpi-default-1.12.0/src/susceptibility.cpp:48: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(sus->sigma[c][d], sigma[c][d], sizeof(realnum) * ntot); data/meep-mpi-default-1.12.0/src/susceptibility.cpp:144: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(dnew, d, d->sz_data); data/meep-mpi-default-1.12.0/src/susceptibility.cpp:417: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(dnew, d, d->sz_data); data/meep-mpi-default-1.12.0/src/update_eh.cpp:92: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(fmp, f[dc][cmp], sizeof(realnum) * ntot); data/meep-mpi-default-1.12.0/src/update_eh.cpp:142:9: [2] (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[ec][cmp], f[dc][cmp], gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/update_eh.cpp:149:9: [2] (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_w[ec][cmp], f[ec][cmp], gv.ntot() * sizeof(realnum)); data/meep-mpi-default-1.12.0/src/update_eh.cpp:159:9: [2] (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_w_prev[ec][cmp], f_w[ec][cmp] ? f_w[ec][cmp] : f[ec][cmp], data/meep-mpi-default-1.12.0/src/vec.cpp:1631:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char bufring[NUMBUFS][BUFLEN]; data/meep-mpi-default-1.12.0/src/vec.cpp:1646:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char bufring[NUMBUFS][BUFLEN]; data/meep-mpi-default-1.12.0/tests/array-metadata.cpp:151: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 *LogFile = (LogFileName ? fopen(LogFileName, "w") : 0); data/meep-mpi-default-1.12.0/tests/cylindrical.cpp:72: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 m_str[10]; data/meep-mpi-default-1.12.0/tests/cylindrical.cpp:120: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 m_str[10]; data/meep-mpi-default-1.12.0/tests/cylindrical.cpp:165: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 m_str[10]; data/meep-mpi-default-1.12.0/tests/cylindrical.cpp:214: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 m_str[10]; data/meep-mpi-default-1.12.0/tests/cylindrical.cpp:272: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 m_str[10]; data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:112: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 dataname[100]; data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:146: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 dataname[100]; data/meep-mpi-default-1.12.0/tests/h5test.cpp:111: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 dataname[256]; data/meep-mpi-default-1.12.0/tests/h5test.cpp:218: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 dataname[256]; data/meep-mpi-default-1.12.0/tests/h5test.cpp:323: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 dataname[256]; data/meep-mpi-default-1.12.0/tests/h5test.cpp:367: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 gv_2d_name[4][20] = {"plane", "plane-supercell", "line", "point"}; data/meep-mpi-default-1.12.0/tests/h5test.cpp:371: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 Sf2_name[5][32] = {"identity", "mirrorx", "mirrory", "mirrorxy", "rotate4z"}; data/meep-mpi-default-1.12.0/tests/h5test.cpp:387: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). chances = argc > 1 ? atoi(argv[1]) : 5; data/meep-mpi-default-1.12.0/tests/h5test.cpp:395:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[1024]; data/meep-mpi-default-1.12.0/tests/h5test.cpp:409: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. char name[1024]; data/meep-mpi-default-1.12.0/tests/h5test.cpp:424: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 gv_3d_name[4][10] = {"volume", "plane", "line", "point"}; data/meep-mpi-default-1.12.0/tests/h5test.cpp:428: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 Sf3_name[3][32] = {"identity", "mirrorxy", "rotate4z"}; data/meep-mpi-default-1.12.0/tests/h5test.cpp:436: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. char name[1024]; data/meep-mpi-default-1.12.0/libpympb/pympb.cpp:114: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(s, ""); data/meep-mpi-default-1.12.0/scheme/structure.cpp:171: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). char *fname = new char[strlen(eps_input_file) + 1]; data/meep-mpi-default-1.12.0/scheme/structure.cpp:178:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). epsilon_data = eps_file.read(dataname, &rank, epsilon_dims, 3); data/meep-mpi-default-1.12.0/src/fields.cpp:35: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). outdir = new char[strlen(s->outdir) + 1]; data/meep-mpi-default-1.12.0/src/fields.cpp:91: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). outdir = new char[strlen(thef.outdir) + 1]; data/meep-mpi-default-1.12.0/src/h5fields.cpp:332: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). int len = strlen(dataname) + 5; data/meep-mpi-default-1.12.0/src/h5file.cpp:160: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). filename = new char[strlen(filename_) + 1]; data/meep-mpi-default-1.12.0/src/h5file.cpp:221:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!cur_dataname || strlen(dataname) > strlen(cur_dataname)) data/meep-mpi-default-1.12.0/src/h5file.cpp:221: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). if (!cur_dataname || strlen(dataname) > strlen(cur_dataname)) data/meep-mpi-default-1.12.0/src/h5file.cpp:222: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). cur_dataname = (char *)realloc(cur_dataname, strlen(dataname) + 1); data/meep-mpi-default-1.12.0/src/h5file.cpp:275: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). *dname = new char[strlen(name) + 1]; data/meep-mpi-default-1.12.0/src/h5file.cpp:292:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). realnum *h5file::read(const char *dataname, int *rank, size_t *dims, int maxrank) { data/meep-mpi-default-1.12.0/src/h5file.cpp:363:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *h5file::read(const char *dataname) { data/meep-mpi-default-1.12.0/src/h5file.cpp:523: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). cur->dataname = new char[strlen(dataname) + 1]; data/meep-mpi-default-1.12.0/src/h5file.cpp:722:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). H5Tset_size(type_id, strlen(data) + 1); data/meep-mpi-default-1.12.0/src/meep.hpp:387:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). realnum *read(const char *dataname, int *rank, size_t *dims, int maxrank); data/meep-mpi-default-1.12.0/src/meep.hpp:391:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read(const char *dataname); data/meep-mpi-default-1.12.0/src/meepgeom.cpp:1588: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). char *fname = new char[strlen(eps_input_file) + 1]; data/meep-mpi-default-1.12.0/src/meepgeom.cpp:1595:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). md->epsilon_data = eps_file.read(dataname, &rank, md->epsilon_dims, 3); data/meep-mpi-default-1.12.0/src/mympi.cpp:133: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 (fmt[strlen(fmt) - 1] != '\n') fputc('\n', stderr); // force newline data/meep-mpi-default-1.12.0/src/output_directory.cpp:49: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). outdir = new char[strlen(name) + 1]; data/meep-mpi-default-1.12.0/src/output_directory.cpp:63:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ca = getc(fa); data/meep-mpi-default-1.12.0/src/output_directory.cpp:108: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). int sufflen = strlen(evil_suffs[i]); data/meep-mpi-default-1.12.0/src/output_directory.cpp:109: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). if (strcmp(stripped_name + strlen(stripped_name) - sufflen, evil_suffs[i]) == 0 && data/meep-mpi-default-1.12.0/src/output_directory.cpp:110: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). strlen(stripped_name) > size_t(sufflen)) { data/meep-mpi-default-1.12.0/src/output_directory.cpp:111: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). stripped_name[strlen(stripped_name) - sufflen] = (char)0; data/meep-mpi-default-1.12.0/src/sources.cpp:380:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *real_data = eps_file.read(dataset_re.c_str(), &rank, re_dims, 3); data/meep-mpi-default-1.12.0/src/sources.cpp:386:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *imag_data = eps_file.read(dataset_im.c_str(), &rank, im_dims, 3); data/meep-mpi-default-1.12.0/tests/array-metadata.cpp:186:9: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (mismatch) num_mismatches++; data/meep-mpi-default-1.12.0/tests/array-metadata.cpp:188:48: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. fprintf(LogFile, "%i %i ", num_points++, mismatch ? 0 : 1); data/meep-mpi-default-1.12.0/tests/array-slice-ll.cpp:204:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *rdata = file->read("hz.r", &rank, dims1D, 1); data/meep-mpi-default-1.12.0/tests/array-slice-ll.cpp:207:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *idata = file->read("hz.i", &rank, dims1D, 1); data/meep-mpi-default-1.12.0/tests/array-slice-ll.cpp:216:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). file_slice2d = file->read("sy", &rank, dims2D, 2); data/meep-mpi-default-1.12.0/tests/cyl-ellipsoid-ll.cpp:33:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *data1 = f1.read(name1, &rank1, dims1, expected_rank); data/meep-mpi-default-1.12.0/tests/cyl-ellipsoid-ll.cpp:39:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *data2 = f2.read(name2, &rank2, dims2, expected_rank); data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:114:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *rdata = f.read(dataname, &file_rank, file_dims, 2); data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:116:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *idata = f.read(dataname, &file_rank, file_dims, 2); data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:153:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *rdata1 = f1.read(dataname, &rank1, dims1, expected_rank); data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:155:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *idata1 = f1.read(dataname, &rank1, dims1, expected_rank); data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:163:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *rdata2 = f2.read(dataname, &rank2, dims2, expected_rank); data/meep-mpi-default-1.12.0/tests/dft-fields.cpp:165:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *idata2 = f2.read(dataname, &rank2, dims2, expected_rank); data/meep-mpi-default-1.12.0/tests/h5test.cpp:90:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *str = file->read("stringtest"); data/meep-mpi-default-1.12.0/tests/h5test.cpp:115:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). realnum *h5data = file->read(dataname, &rank, dims, 2); data/meep-mpi-default-1.12.0/tests/h5test.cpp:197:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *str = file->read("stringtest"); data/meep-mpi-default-1.12.0/tests/h5test.cpp:222:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). realnum *h5data = file->read(dataname, &rank, dims, 3); data/meep-mpi-default-1.12.0/tests/h5test.cpp:327:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). realnum *h5data = file->read(dataname, &rank, dims, 2); data/meep-mpi-default-1.12.0/tests/user-defined-material.cpp:57:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *data1 = f1.read(name1, &rank1, dims1, expected_rank); data/meep-mpi-default-1.12.0/tests/user-defined-material.cpp:63:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). double *data2 = f2.read(name2, &rank2, dims2, expected_rank); ANALYSIS SUMMARY: Hits = 167 Lines analyzed = 37073 in approximately 1.22 seconds (30362 lines/second) Physical Source Lines of Code (SLOC) = 28448 Hits@level = [0] 133 [1] 48 [2] 98 [3] 5 [4] 15 [5] 1 Hits@level+ = [0+] 300 [1+] 167 [2+] 119 [3+] 21 [4+] 16 [5+] 1 Hits/KSLOC@level+ = [0+] 10.5456 [1+] 5.87036 [2+] 4.18307 [3+] 0.738189 [4+] 0.56243 [5+] 0.0351519 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.