From 8af1ca881bd6c931017a172a8751467e5b22a3bf Mon Sep 17 00:00:00 2001 From: Developer Date: Thu, 23 Apr 2026 20:28:24 -0400 Subject: [PATCH] FIX: Add error handling to detect_false_positives pipe Line 1955: Added || true to sort command Line 1957: Added 2>/dev/null to wc command Prevents script exit if sort fails or false_positives.txt doesn't exist. --- modules/security/bot-analyzer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/security/bot-analyzer.sh b/modules/security/bot-analyzer.sh index f372b05..6257045 100755 --- a/modules/security/bot-analyzer.sh +++ b/modules/security/bot-analyzer.sh @@ -1952,9 +1952,9 @@ detect_false_positives() { else if (match(url, /checkout|payment|paypal|stripe|square/) && match(ua, /paypal|stripe|square/)) { print ip "|Payment Processor|" ua "|" domain } - }' | sort -u > "$TEMP_DIR/false_positives.txt" + }' | sort -u > "$TEMP_DIR/false_positives.txt" || true - print_success "False positive detection complete ($(wc -l < "$TEMP_DIR/false_positives.txt") legitimate services identified)" + print_success "False positive detection complete ($(wc -l < "$TEMP_DIR/false_positives.txt" 2>/dev/null || echo 0) legitimate services identified)" } #############################################################################