theochem / iodata

Audit required: External control of file name or path PTC-W6004
Security
Minor
3 months ago4 months old
External variable 'fn_orig' used in file path
 86
 87    """
 88    fn_truncated = "%s/truncated_%i_%s" % (tmpdir, nline, os.path.basename(fn_orig))
 89    with open(fn_orig) as f_orig, open(fn_truncated, "w") as f_truncated: 90        for counter, line in enumerate(f_orig):
 91            if counter >= nline:
 92                break
External variable 'filename' used in file path
440
441    """
442    input_module = _select_input_module(filename, fmt)
443    with open(filename, "w") as fh:444        try:
445            input_module.write_input(fh, data, template, atom_line, **kwargs)
446        except Exception as exc: