subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = [tesseract_bin, str(path), "stdout"] if lang_arg: cmd.extend(["-l", lang_arg]) proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False) if proc.returncode != 0 or not proc.stdout.strip(): raise PreprocessError(f"Image OCR failed: {proc.stderr.strip() or 'no text returned'}") return proc.stdout- Confidence
- 70% confidence
- Finding
- proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False)
