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)
This commit is contained in:
Developer
2026-03-20 01:30:15 -04:00
parent 496dbf4f17
commit fd52a4aa15
+1 -1
View File
@@ -1599,7 +1599,7 @@ STANDALONE_EOF
# Escape special characters for sed (handle /, \, &, |, $) # Escape special characters for sed (handle /, \, &, |, $)
# CRITICAL FIX: Must escape the delimiter (|) as well since we use it in the sed command # 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 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}" echo -e "${RED}ERROR: Failed to generate standalone scanner script${NC}"