Fix undefined variable in parse_results

Co-authored-by: GilbertKrantz <90319182+GilbertKrantz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-05 18:17:21 +00:00
parent 41b4c3011f
commit 0d22b027f4

View File

@ -119,6 +119,7 @@ class SQLMapCLI:
if "sqlmap identified the following injection point" in output:
# Extract injection details
lines = output.split('\n')
param = None # Initialize to avoid undefined reference
for i, line in enumerate(lines):
if "Parameter:" in line:
param = line.split("Parameter:")[1].strip()
@ -127,7 +128,7 @@ class SQLMapCLI:
if i + 1 < len(lines) and "Title:" in lines[i + 1]:
title = lines[i + 1].split("Title:")[1].strip()
vulns.append({
'parameter': param if 'param' in locals() else 'Unknown',
'parameter': param if param is not None else 'Unknown',
'type': vuln_type,
'title': title
})