CRITICAL FIX: Guard unprotected header_score comparison at line 1815

Line 1815: Changed from [ "$header_score" -ge 8 ] to [ "${header_score:-0}" -ge 8 ]
- This was another unprotected array variable access in the threat scoring loop
- Missed in previous fix - now ALL array accesses in scoring loop are guarded

This ensures script continues past 'Calculating threat scores...' phase.
This commit is contained in:
Developer
2026-04-23 20:27:22 -04:00
parent 62ee9674d8
commit dc6ce93eef
+1 -1
View File
@@ -1812,7 +1812,7 @@ calculate_threat_scores() {
header_score=${header_anomalies[$ip]:-0}
if [ "${header_score:-0}" -ge 12 ]; then
score=$((score + 8)) # Multiple header suspicions
elif [ "$header_score" -ge 8 ]; then
elif [ "${header_score:-0}" -ge 8 ]; then
score=$((score + 5)) # Moderate header anomalies
fi
fi