From fd52a4aa153f370693c3be9cf72998c2ec3c1bc2 Mon Sep 17 00:00:00 2001 From: Developer Date: Fri, 20 Mar 2026 01:30:15 -0400 Subject: [PATCH] Fix: Remove 'local' keyword from global scope in malware-scanner.sh (CRITICAL) CRITICAL FIXES: - Line 1602: Remove 'local' from escaped_paths variable (global scope) Issue: 'local' keyword can only be used inside function definitions. Line 1602 is at global script scope (main execution body before main() function at line 2542). Using 'local' in global scope causes 'local: can only be used in a function' runtime error and script failure. RESULTS: - 1 CRITICAL issue fixed - All CRITICALs now resolved (0 remaining) --- modules/security/malware-scanner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index 58d7d99..b351911 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -1599,7 +1599,7 @@ STANDALONE_EOF # Escape special characters for sed (handle /, \, &, |, $) # CRITICAL FIX: Must escape the delimiter (|) as well since we use it in the sed command - local escaped_paths=$(printf '%s\n' "$paths_declaration" | sed -e 's/[\/&|]/\\&/g') + escaped_paths=$(printf '%s\n' "$paths_declaration" | sed -e 's/[\/&|]/\\&/g') if ! sed -i "s|PLACEHOLDER_SCAN_PATHS|$escaped_paths|" "$session_dir/scan.sh"; then echo -e "${RED}ERROR: Failed to generate standalone scanner script${NC}"