From 742e8979ace01c95b562357600f71e077c535718 Mon Sep 17 00:00:00 2001 From: Robert Paprocki Date: Mon, 6 Feb 2017 10:09:16 -0800 Subject: [PATCH] Catch an error in translating ctl actions --- tools/Modsec2LRW.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/Modsec2LRW.pm b/tools/Modsec2LRW.pm index 35a59a2b..c613d9aa 100644 --- a/tools/Modsec2LRW.pm +++ b/tools/Modsec2LRW.pm @@ -810,7 +810,11 @@ sub translate_actions { } elsif ($key eq 'ctl') { my ($opt, $data) = split /=/, $value; - $ctl_lookup->{$opt}($data, $translation); + if (defined $ctl_lookup->{$opt}) { + $ctl_lookup->{$opt}($data, $translation); + } else { + warn "Cannot translate ctl option $opt"; + } } elsif ($key eq 'expirevar') { my ($var, $time) = split /=/, $value; my ($collection, $element) = split /\./, $var;