Fix integer comparison safety issues (6 HIGH priority)
Added parameter expansion with defaults to prevent comparison errors
on potentially empty variables:
- live-attack-monitor-v2.sh: IPSET_CREATE_EXIT, IPTABLES_EXIT
- live-attack-monitor.sh: IPSET_CREATE_EXIT, IPTABLES_EXIT
- malware-scanner.sh: START_EXIT
- email-diagnostics.sh: check_type, account_found
Pattern: Changed "$VAR" to "${VAR:-default}" in integer comparisons
to ensure safe comparisons even if variable is unexpectedly empty.
This commit is contained in:
@@ -853,7 +853,7 @@ for scanner in "${AVAILABLE_SCANNERS[@]}"; do
|
||||
imunify-antivirus malware on-demand start --path="$path" &>> "$LOG_DIR/imunify.log"
|
||||
START_EXIT=$?
|
||||
|
||||
if [ $START_EXIT -ne 0 ]; then
|
||||
if [ "${START_EXIT:-1}" -ne 0 ]; then
|
||||
log_message "ERROR: ImunifyAV scan failed to start for $path (exit code: $START_EXIT)"
|
||||
echo " ✗ Scan failed to start for $path (check logs)"
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user