fix: harden rule and forwarding edge cases

This commit is contained in:
zxr
2026-07-18 09:00:09 +08:00
parent d381360dfb
commit b07661383a
3 changed files with 16 additions and 6 deletions

View File

@@ -665,7 +665,7 @@ func trapRuleMatches(rule *models.TrapRule, trapOID, varbindFP string) bool {
if hasOID && !strings.HasPrefix(normOID(trapOID), normOID(rule.OIDPrefix)) {
return false
}
if rule.VarbindMatchRegex != "" {
if hasRE {
re, err := regexp.Compile(rule.VarbindMatchRegex)
if err != nil {
return false