From 0d22b027f478a9a80ebe5009c33c14db46e92416 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 18:17:21 +0000 Subject: [PATCH] Fix undefined variable in parse_results Co-authored-by: GilbertKrantz <90319182+GilbertKrantz@users.noreply.github.com> --- sqlmapcli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlmapcli.py b/sqlmapcli.py index 54b447663..f9c079aac 100755 --- a/sqlmapcli.py +++ b/sqlmapcli.py @@ -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 })