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/gnucap-0.36~20171003/apps/bm_complex.cc Examining data/gnucap-0.36~20171003/apps/bm_exp.cc Examining data/gnucap-0.36~20171003/apps/bm_fit.cc Examining data/gnucap-0.36~20171003/apps/bm_generator.cc Examining data/gnucap-0.36~20171003/apps/bm_model.cc Examining data/gnucap-0.36~20171003/apps/bm_poly.cc Examining data/gnucap-0.36~20171003/apps/bm_posy.cc Examining data/gnucap-0.36~20171003/apps/bm_pulse.cc Examining data/gnucap-0.36~20171003/apps/bm_pwl.cc Examining data/gnucap-0.36~20171003/apps/bm_sffm.cc Examining data/gnucap-0.36~20171003/apps/bm_sin.cc Examining data/gnucap-0.36~20171003/apps/bm_tanh.cc Examining data/gnucap-0.36~20171003/apps/bmm_semi.cc Examining data/gnucap-0.36~20171003/apps/bmm_table.cc Examining data/gnucap-0.36~20171003/apps/c_clear.cc Examining data/gnucap-0.36~20171003/apps/c_comand.cc Examining data/gnucap-0.36~20171003/apps/c_delete.cc Examining data/gnucap-0.36~20171003/apps/c_exp.cc Examining data/gnucap-0.36~20171003/apps/c_genrat.cc Examining data/gnucap-0.36~20171003/apps/c_help.cc Examining data/gnucap-0.36~20171003/apps/c_list.cc Examining data/gnucap-0.36~20171003/apps/c_measure.cc Examining data/gnucap-0.36~20171003/apps/c_modify.cc Examining data/gnucap-0.36~20171003/apps/c_param.cc Examining data/gnucap-0.36~20171003/apps/c_prbcmd.cc Examining data/gnucap-0.36~20171003/apps/c_sim.cc Examining data/gnucap-0.36~20171003/apps/c_status.cc Examining data/gnucap-0.36~20171003/apps/c_sweep.cc Examining data/gnucap-0.36~20171003/apps/c_system.cc Examining data/gnucap-0.36~20171003/apps/d_admit.cc Examining data/gnucap-0.36~20171003/apps/d_cap.cc Examining data/gnucap-0.36~20171003/apps/d_cccs.cc Examining data/gnucap-0.36~20171003/apps/d_ccvs.cc Examining data/gnucap-0.36~20171003/apps/d_coil.cc Examining data/gnucap-0.36~20171003/apps/d_cs.cc Examining data/gnucap-0.36~20171003/apps/d_meter.cc Examining data/gnucap-0.36~20171003/apps/d_poly_cap.cc Examining data/gnucap-0.36~20171003/apps/d_poly_g.cc Examining data/gnucap-0.36~20171003/apps/d_res.cc Examining data/gnucap-0.36~20171003/apps/d_switch.cc Examining data/gnucap-0.36~20171003/apps/d_trln.cc Examining data/gnucap-0.36~20171003/apps/d_vcg.cc Examining data/gnucap-0.36~20171003/apps/d_vcr.cc Examining data/gnucap-0.36~20171003/apps/d_vcvs.cc Examining data/gnucap-0.36~20171003/apps/d_vs.cc Examining data/gnucap-0.36~20171003/apps/func_core.cc Examining data/gnucap-0.36~20171003/apps/lang_spectre.cc Examining data/gnucap-0.36~20171003/apps/lang_spice.cc Examining data/gnucap-0.36~20171003/apps/lang_verilog.cc Examining data/gnucap-0.36~20171003/apps/measure_at.cc Examining data/gnucap-0.36~20171003/apps/measure_average.cc Examining data/gnucap-0.36~20171003/apps/measure_cross.cc Examining data/gnucap-0.36~20171003/apps/measure_eval.cc Examining data/gnucap-0.36~20171003/apps/measure_integral.cc Examining data/gnucap-0.36~20171003/apps/measure_max.cc Examining data/gnucap-0.36~20171003/apps/measure_min.cc Examining data/gnucap-0.36~20171003/apps/measure_rms.cc Examining data/gnucap-0.36~20171003/apps/measure_slewrate.cc Examining data/gnucap-0.36~20171003/apps/s__init.cc Examining data/gnucap-0.36~20171003/apps/s__out.cc Examining data/gnucap-0.36~20171003/apps/s__solve.cc Examining data/gnucap-0.36~20171003/apps/s_ac.cc Examining data/gnucap-0.36~20171003/apps/s_dc.cc Examining data/gnucap-0.36~20171003/apps/s_fo.cc Examining data/gnucap-0.36~20171003/apps/s_tr.cc Examining data/gnucap-0.36~20171003/apps/s_tr_set.cc Examining data/gnucap-0.36~20171003/apps/s_tr_swp.cc Examining data/gnucap-0.36~20171003/apps/signon.cc Examining data/gnucap-0.36~20171003/apps/test_readline.cc Examining data/gnucap-0.36~20171003/include/ap.h Examining data/gnucap-0.36~20171003/include/bm.h Examining data/gnucap-0.36~20171003/include/c_comand.h Examining data/gnucap-0.36~20171003/include/constant.h Examining data/gnucap-0.36~20171003/include/d_coment.h Examining data/gnucap-0.36~20171003/include/d_dot.h Examining data/gnucap-0.36~20171003/include/d_logic.h Examining data/gnucap-0.36~20171003/include/declare.h Examining data/gnucap-0.36~20171003/include/e_aux.h Examining data/gnucap-0.36~20171003/include/e_base.h Examining data/gnucap-0.36~20171003/include/e_card.h Examining data/gnucap-0.36~20171003/include/e_cardlist.h Examining data/gnucap-0.36~20171003/include/e_ccsrc.h Examining data/gnucap-0.36~20171003/include/e_compon.h Examining data/gnucap-0.36~20171003/include/e_elemnt.h Examining data/gnucap-0.36~20171003/include/e_model.h Examining data/gnucap-0.36~20171003/include/e_node.h Examining data/gnucap-0.36~20171003/include/e_paramlist.h Examining data/gnucap-0.36~20171003/include/e_storag.h Examining data/gnucap-0.36~20171003/include/e_subckt.h Examining data/gnucap-0.36~20171003/include/globals.h Examining data/gnucap-0.36~20171003/include/io_.h Examining data/gnucap-0.36~20171003/include/io_error.h Examining data/gnucap-0.36~20171003/include/io_trace.h Examining data/gnucap-0.36~20171003/include/l_compar.h Examining data/gnucap-0.36~20171003/include/l_denoise.h Examining data/gnucap-0.36~20171003/include/l_dispatcher.h Examining data/gnucap-0.36~20171003/include/l_lib.h Examining data/gnucap-0.36~20171003/include/l_stlextra.h Examining data/gnucap-0.36~20171003/include/l_timer.h Examining data/gnucap-0.36~20171003/include/m_base.h Examining data/gnucap-0.36~20171003/include/m_cpoly.h Examining data/gnucap-0.36~20171003/include/m_divdiff.h Examining data/gnucap-0.36~20171003/include/m_expression.h Examining data/gnucap-0.36~20171003/include/m_interp.h Examining data/gnucap-0.36~20171003/include/m_matrix.h Examining data/gnucap-0.36~20171003/include/m_phase.h Examining data/gnucap-0.36~20171003/include/m_spline.h Examining data/gnucap-0.36~20171003/include/m_wave.h Examining data/gnucap-0.36~20171003/include/md.h Examining data/gnucap-0.36~20171003/include/mode.h Examining data/gnucap-0.36~20171003/include/patchlev.h Examining data/gnucap-0.36~20171003/include/s__.h Examining data/gnucap-0.36~20171003/include/s_tr.h Examining data/gnucap-0.36~20171003/include/spice-wrapper.cc Examining data/gnucap-0.36~20171003/include/trace_off.h Examining data/gnucap-0.36~20171003/include/trace_on.h Examining data/gnucap-0.36~20171003/include/u_cardst.h Examining data/gnucap-0.36~20171003/include/u_function.h Examining data/gnucap-0.36~20171003/include/u_lang.h Examining data/gnucap-0.36~20171003/include/u_limit.h Examining data/gnucap-0.36~20171003/include/u_nodemap.h Examining data/gnucap-0.36~20171003/include/u_opt.h Examining data/gnucap-0.36~20171003/include/u_parameter.h Examining data/gnucap-0.36~20171003/include/u_prblst.h Examining data/gnucap-0.36~20171003/include/u_probe.h Examining data/gnucap-0.36~20171003/include/u_sdp.h Examining data/gnucap-0.36~20171003/include/u_sim_data.h Examining data/gnucap-0.36~20171003/include/u_status.h Examining data/gnucap-0.36~20171003/include/u_time_pair.h Examining data/gnucap-0.36~20171003/include/u_xprobe.h Examining data/gnucap-0.36~20171003/lib/ap_construct.cc Examining data/gnucap-0.36~20171003/lib/ap_convert.cc Examining data/gnucap-0.36~20171003/lib/ap_error.cc Examining data/gnucap-0.36~20171003/lib/ap_get.cc Examining data/gnucap-0.36~20171003/lib/ap_match.cc Examining data/gnucap-0.36~20171003/lib/ap_skip.cc Examining data/gnucap-0.36~20171003/lib/bm.cc Examining data/gnucap-0.36~20171003/lib/bm_cond.cc Examining data/gnucap-0.36~20171003/lib/bm_value.cc Examining data/gnucap-0.36~20171003/lib/c__cmd.cc Examining data/gnucap-0.36~20171003/lib/c_attach.cc Examining data/gnucap-0.36~20171003/lib/c_file.cc Examining data/gnucap-0.36~20171003/lib/d_logic.cc Examining data/gnucap-0.36~20171003/lib/d_logicmod.cc Examining data/gnucap-0.36~20171003/lib/d_subckt.cc Examining data/gnucap-0.36~20171003/lib/e_base.cc Examining data/gnucap-0.36~20171003/lib/e_card.cc Examining data/gnucap-0.36~20171003/lib/e_cardlist.cc Examining data/gnucap-0.36~20171003/lib/e_ccsrc.cc Examining data/gnucap-0.36~20171003/lib/e_compon.cc Examining data/gnucap-0.36~20171003/lib/e_elemnt.cc Examining data/gnucap-0.36~20171003/lib/e_model.cc Examining data/gnucap-0.36~20171003/lib/e_node.cc Examining data/gnucap-0.36~20171003/lib/e_paramlist.cc Examining data/gnucap-0.36~20171003/lib/e_storag.cc Examining data/gnucap-0.36~20171003/lib/findbr.cc Examining data/gnucap-0.36~20171003/lib/globals.cc Examining data/gnucap-0.36~20171003/lib/io.cc Examining data/gnucap-0.36~20171003/lib/io_contr.cc Examining data/gnucap-0.36~20171003/lib/io_error.cc Examining data/gnucap-0.36~20171003/lib/io_findf.cc Examining data/gnucap-0.36~20171003/lib/io_out.cc Examining data/gnucap-0.36~20171003/lib/io_xopen.cc Examining data/gnucap-0.36~20171003/lib/l_ftos.cc Examining data/gnucap-0.36~20171003/lib/l_pmatch.cc Examining data/gnucap-0.36~20171003/lib/l_timer.cc Examining data/gnucap-0.36~20171003/lib/l_trim.cc Examining data/gnucap-0.36~20171003/lib/l_wmatch.cc Examining data/gnucap-0.36~20171003/lib/m_base_in.cc Examining data/gnucap-0.36~20171003/lib/m_base_math.cc Examining data/gnucap-0.36~20171003/lib/m_expression_dump.cc Examining data/gnucap-0.36~20171003/lib/m_expression_in.cc Examining data/gnucap-0.36~20171003/lib/m_expression_reduce.cc Examining data/gnucap-0.36~20171003/lib/m_fft.cc Examining data/gnucap-0.36~20171003/lib/m_spline.cc Examining data/gnucap-0.36~20171003/lib/plot.cc Examining data/gnucap-0.36~20171003/lib/test_readline.cc Examining data/gnucap-0.36~20171003/lib/u_function.cc Examining data/gnucap-0.36~20171003/lib/u_lang.cc Examining data/gnucap-0.36~20171003/lib/u_nodemap.cc Examining data/gnucap-0.36~20171003/lib/u_opt1.cc Examining data/gnucap-0.36~20171003/lib/u_opt2.cc Examining data/gnucap-0.36~20171003/lib/u_parameter.cc Examining data/gnucap-0.36~20171003/lib/u_prblst.cc Examining data/gnucap-0.36~20171003/lib/u_probe.cc Examining data/gnucap-0.36~20171003/lib/u_sim_data.cc Examining data/gnucap-0.36~20171003/lib/u_xprobe.cc Examining data/gnucap-0.36~20171003/main/main.cc Examining data/gnucap-0.36~20171003/modelgen/mg_.h Examining data/gnucap-0.36~20171003/modelgen/mg_error.cc Examining data/gnucap-0.36~20171003/modelgen/mg_in.cc Examining data/gnucap-0.36~20171003/modelgen/mg_main.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out.h Examining data/gnucap-0.36~20171003/modelgen/mg_out_common.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out_dev.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out_dump.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out_h.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out_lib.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out_model.cc Examining data/gnucap-0.36~20171003/modelgen/mg_out_root.cc FINAL RESULTS: data/gnucap-0.36~20171003/apps/c_system.cc:44:6: [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. OS::system(editor + ' ' + cmd.tail()); data/gnucap-0.36~20171003/apps/c_system.cc:48:6: [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. OS::system(editor + ' ' + temp_file); data/gnucap-0.36~20171003/apps/c_system.cc:62: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. OS::system(cmd.tail()); data/gnucap-0.36~20171003/apps/c_system.cc:64: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. OS::system(SHELL); data/gnucap-0.36~20171003/include/l_lib.h:45:15: [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. inline void system(const std::string& s) {itested(); data/gnucap-0.36~20171003/include/l_lib.h:46:7: [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. ::system(s.c_str()); data/gnucap-0.36~20171003/include/l_lib.h:58: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. return (::access(file.c_str(), mode) == 0/*file_ok*/); data/gnucap-0.36~20171003/include/spice-wrapper.cc:532: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(_v->sValue, s.c_str()); data/gnucap-0.36~20171003/include/spice-wrapper.cc:1666: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(bptr, reinterpret_cast<char*>(names[nindex])); data/gnucap-0.36~20171003/lib/c_file.cc:82:36: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. FILE* newfile = xopen(cmd,"",access); data/gnucap-0.36~20171003/lib/c_file.cc:122:36: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. FILE* newfile = xopen(cmd,"",access); data/gnucap-0.36~20171003/lib/e_base.cc:107: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(parameter, what.c_str()); data/gnucap-0.36~20171003/lib/io_contr.cc:127:17: [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. to_pipe = popen(command.c_str(), "w"); data/gnucap-0.36~20171003/lib/io_error.cc:72:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer,fmt,arg_ptr); data/gnucap-0.36~20171003/lib/io_out.cc:85:3: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer,fmt,arg_ptr); data/gnucap-0.36~20171003/lib/io_xopen.cc:82: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(&fname[i],ext); data/gnucap-0.36~20171003/lib/io_xopen.cc:96:42: [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 (!OPT::clobber && (*how == 'w') && (access(fname,F_OK) == FILE_OK)) {untested(); data/gnucap-0.36~20171003/lib/l_ftos.cc:247:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(&str[nnn], ((expo < 100) ? "E%+-3d" : "E%3u"), expo); data/gnucap-0.36~20171003/lib/plot.cc:136: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(highs, ftos(hi, 0, 5, IO::formaat)); data/gnucap-0.36~20171003/lib/plot.cc:149: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(nums, ftos(number, 0, 5, IO::formaat)); data/gnucap-0.36~20171003/apps/c_system.cc:38: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. std::string editor(OS::getenv("EDITOR")); data/gnucap-0.36~20171003/include/l_lib.h:71: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. inline std::string getenv(const std::string& s) { data/gnucap-0.36~20171003/include/l_lib.h:72:18: [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* ev = ::getenv(s.c_str()); data/gnucap-0.36~20171003/include/l_lib.h:85:29: [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 (!Overwrite && getenv(Name) != "") {untested(); data/gnucap-0.36~20171003/include/md.h:80:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. #define SHELL OS::getenv("COMSPEC") data/gnucap-0.36~20171003/include/md.h:85:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. #define SHELL OS::getenv("SHELL") data/gnucap-0.36~20171003/include/md.h:130:10: [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(const_cast<char*>(f)); data/gnucap-0.36~20171003/lib/c_attach.cc:34: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. return OS::getenv("GNUCAP_PLUGPATH"); data/gnucap-0.36~20171003/main/main.cc:61:29: [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. std::string ldlpath = OS::getenv("LD_LIBRARY_PATH"); data/gnucap-0.36~20171003/apps/c_sweep.cc:61: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). fptr = fopen(tempfile.c_str(), "w"); data/gnucap-0.36~20171003/apps/c_sweep.cc:69: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 buffer[BUFLEN]; data/gnucap-0.36~20171003/apps/c_sweep.cc:91: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). fptr = fopen(tempfile.c_str(), "r"); data/gnucap-0.36~20171003/apps/c_sweep.cc:96: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 buffer[BUFLEN]; data/gnucap-0.36~20171003/apps/lang_spice.cc:836:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[20]; data/gnucap-0.36~20171003/apps/lang_spice.cc:837: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(buf, "%u", level); data/gnucap-0.36~20171003/apps/s__out.cc:95: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 format[20]; data/gnucap-0.36~20171003/apps/s__out.cc:97: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(format, "%%c%%-%us", width); data/gnucap-0.36~20171003/include/l_lib.h:62: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 buf[BUFLEN+1]; data/gnucap-0.36~20171003/include/spice-wrapper.cc:1653: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 buf[10000], *s, *bptr; data/gnucap-0.36~20171003/include/spice-wrapper.cc:1668: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(bptr, "(null)"); data/gnucap-0.36~20171003/lib/ap_construct.cc:51: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). :_file(fopen(name.c_str(), "r")), data/gnucap-0.36~20171003/lib/ap_construct.cc:78:11: [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 f = open(name.c_str(), O_RDONLY); data/gnucap-0.36~20171003/lib/ap_construct.cc:157: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 cmdbuf[BUFLEN]; data/gnucap-0.36~20171003/lib/ap_construct.cc:235: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 buffer[buffer_size+1]; data/gnucap-0.36~20171003/lib/e_base.cc:106: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 parameter[BUFLEN+1]; data/gnucap-0.36~20171003/lib/findbr.cc:43: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 labelwanted[BUFLEN+1]; data/gnucap-0.36~20171003/lib/io_contr.cc:51: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 buf[BUFLEN]; data/gnucap-0.36~20171003/lib/io_error.cc:69: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 buffer[BIGBUFLEN] = ""; data/gnucap-0.36~20171003/lib/io_out.cc:49: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[sizeof(int)*3+1]; data/gnucap-0.36~20171003/lib/io_out.cc:50: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(s, "%o", x); data/gnucap-0.36~20171003/lib/io_out.cc:81:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[BIGBUFLEN]; data/gnucap-0.36~20171003/lib/io_xopen.cc:50: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 fname[BIGBUFLEN]; data/gnucap-0.36~20171003/lib/io_xopen.cc:67:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&(fname[i]), "%ld", static_cast<long>(time(0))); data/gnucap-0.36~20171003/lib/io_xopen.cc:97: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 buffer[BUFLEN]; data/gnucap-0.36~20171003/lib/io_xopen.cc:101: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). code = fopen(fname,how); /* file already exists, ask */ data/gnucap-0.36~20171003/lib/io_xopen.cc:106: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). code = fopen(fname,how); data/gnucap-0.36~20171003/lib/l_ftos.cc:51: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 s[100]; data/gnucap-0.36~20171003/lib/l_ftos.cc:52: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(s, "%u", n); data/gnucap-0.36~20171003/lib/l_ftos.cc:58: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 s[100]; data/gnucap-0.36~20171003/lib/l_ftos.cc:59: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(s, "%d", n); data/gnucap-0.36~20171003/lib/l_ftos.cc:92: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 strpool[POOLSIZE][MAXLENGTH]; data/gnucap-0.36~20171003/lib/l_ftos.cc:144:7: [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(str, " 0."); data/gnucap-0.36~20171003/lib/m_base_math.cc:29: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 s[30]; data/gnucap-0.36~20171003/lib/m_base_math.cc:30: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(s, "EX%04u", ++c); data/gnucap-0.36~20171003/lib/plot.cc:28: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 border[MAXWIDTH+1]; /* border string (keep, repeat at end) */ data/gnucap-0.36~20171003/lib/plot.cc:29: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 emptydata[MAXWIDTH+1]; /* empty data, to copy then insert data */ data/gnucap-0.36~20171003/lib/plot.cc:117: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 nums[20]; /* this label string */ data/gnucap-0.36~20171003/lib/plot.cc:118: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 highs[20]; /* the last label string */ data/gnucap-0.36~20171003/lib/plot.cc:240: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 adata[MAXWIDTH+1]; /* actual data. copy emptydata, insert */ data/gnucap-0.36~20171003/lib/plot.cc:242: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(adata, emptydata, MAXWIDTH); /* copy prototype */ data/gnucap-0.36~20171003/apps/c_comand.cc:67:14: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ch = getchar(); data/gnucap-0.36~20171003/apps/c_sweep.cc:106:7: [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(buffer, "fault ", ind); data/gnucap-0.36~20171003/include/m_base.h:66:17: [1] (buffer) equal: 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. virtual Base* equal(const Base*)const {untested(); return NULL;} data/gnucap-0.36~20171003/include/m_base.h:67:17: [1] (buffer) equal: 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. virtual Base* equal(const Float*)const {untested(); return NULL;} data/gnucap-0.36~20171003/include/m_base.h:68:17: [1] (buffer) equal: 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. virtual Base* equal(const String*)const {untested(); return NULL;} data/gnucap-0.36~20171003/include/m_base.h:175:9: [1] (buffer) equal: 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. Base* equal(const Float* X)const {assert(X); return new Float((_data == X->_data)?1.:0.);} data/gnucap-0.36~20171003/include/m_base.h:188:9: [1] (buffer) equal: 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. Base* equal(const Base* X)const {return ((X) ? (X->equal(this)) : (NULL));} data/gnucap-0.36~20171003/include/m_base.h:188:54: [1] (buffer) equal: 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. Base* equal(const Base* X)const {return ((X) ? (X->equal(this)) : (NULL));} data/gnucap-0.36~20171003/include/m_base.h:201:9: [1] (buffer) equal: 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. Base* equal(const String*)const {untested();return NULL;} data/gnucap-0.36~20171003/include/m_base.h:237:9: [1] (buffer) equal: 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. Base* equal(const String* X)const {untested();assert(X); return new Float((_data == X->_data)?1.:0.);} data/gnucap-0.36~20171003/include/m_base.h:250:9: [1] (buffer) equal: 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. Base* equal(const Base* X)const {untested();return ((X) ? (X->equal(this)) : (NULL));} data/gnucap-0.36~20171003/include/m_base.h:250:65: [1] (buffer) equal: 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. Base* equal(const Base* X)const {untested();return ((X) ? (X->equal(this)) : (NULL));} data/gnucap-0.36~20171003/include/m_base.h:263:9: [1] (buffer) equal: 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. Base* equal(const Float*)const {untested();return NULL;} data/gnucap-0.36~20171003/include/spice-wrapper.cc:1670: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). bptr += strlen(bptr); data/gnucap-0.36~20171003/lib/ap_construct.cc:87:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(f, cmd, _length); data/gnucap-0.36~20171003/lib/ap_construct.cc:245: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 count = strlen(buffer); data/gnucap-0.36~20171003/lib/ap_construct.cc:252:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (isspace(c = fgetc(fileptr))) { data/gnucap-0.36~20171003/lib/io_out.cc:112: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). size_t sl = strlen(str); data/gnucap-0.36~20171003/lib/io_xopen.cc:68: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(fname); data/gnucap-0.36~20171003/lib/io_xopen.cc:80: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 (defalt && ext && *ext && i+strlen(ext)+2 < BIGBUFLEN) {untested(); data/gnucap-0.36~20171003/lib/io_xopen.cc:89: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(fname)==0) { data/gnucap-0.36~20171003/lib/l_ftos.cc:114:5: [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," Over", 5); data/gnucap-0.36~20171003/lib/l_ftos.cc:117:5: [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,"-Over", 5); data/gnucap-0.36~20171003/lib/l_ftos.cc:120:5: [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," NaN", 4); data/gnucap-0.36~20171003/lib/l_ftos.cc:123:5: [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," NaN", 4); data/gnucap-0.36~20171003/lib/l_ftos.cc:127:5: [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," ??", 3); data/gnucap-0.36~20171003/lib/l_ftos.cc:129:5: [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," NA", 3); data/gnucap-0.36~20171003/lib/l_ftos.cc:131:5: [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," Inf", 4); data/gnucap-0.36~20171003/lib/l_ftos.cc:133:5: [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,"-Inf", 4); data/gnucap-0.36~20171003/lib/l_ftos.cc:135:5: [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," NaN", 4); data/gnucap-0.36~20171003/lib/l_ftos.cc:145: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). nnn = static_cast<int>(strlen(str)); /* num==0 .. build string 0.000... */ data/gnucap-0.36~20171003/lib/l_trim.cc:32: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 idx = strlen(string); data/gnucap-0.36~20171003/lib/m_expression_reduce.cc:52:23: [1] (buffer) equal: 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. b = (T1->data())->equal(T2->data()); data/gnucap-0.36~20171003/lib/plot.cc:139: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). stop = OUTWIDTH - static_cast<int>(strlen(highs)) - 1; /* space for it. */ data/gnucap-0.36~20171003/lib/plot.cc:151: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). numsize = static_cast<int>(strlen(nums)); /* center it over the mark */ data/gnucap-0.36~20171003/main/main.cc:66: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). assert(strlen("PLUGPATH=") == 9); ANALYSIS SUMMARY: Hits = 106 Lines analyzed = 39755 in approximately 2.95 seconds (13480 lines/second) Physical Source Lines of Code (SLOC) = 29323 Hits@level = [0] 13 [1] 36 [2] 41 [3] 9 [4] 20 [5] 0 Hits@level+ = [0+] 119 [1+] 106 [2+] 70 [3+] 29 [4+] 20 [5+] 0 Hits/KSLOC@level+ = [0+] 4.05825 [1+] 3.61491 [2+] 2.3872 [3+] 0.988985 [4+] 0.682058 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.