From a6627ef7afbee6ab015d9f8b75e96cd59809bb59 Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 9 Oct 2006 15:01:40 +0000 Subject: [PATCH] fix problems with empty/corrupt filters --- Changes | 2 ++ perl/Filter.pm | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 9e9106dc..00e5fb9c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +09Oct06======================================================================= +1. fix problems with bad filters pointed by Thomas DL3SBB. 27Jul06======================================================================= 1. merge in official issue version of wpxloc.raw (with one change: 4U1V). 26Jul06======================================================================= diff --git a/perl/Filter.pm b/perl/Filter.pm index a2f5ce46..3009883b 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -116,17 +116,25 @@ sub read_in $in = undef; my $s = readfilestr($fn); my $newin = eval $s; - dbg($@) if $@; + if ($@) { + dbg($@); + unlink($fn); + return undef; + } if ($in) { $newin = new('Filter::Old', $sort, $call, $flag); $newin->{filter} = $in; - } else { + } elsif (ref $newin && $newin->can('getfilkeys')) { my $filter; my $key; foreach $key ($newin->getfilkeys) { $newin->compile($key, 'reject'); $newin->compile($key, 'accept'); } + } else { + # error on reading file, delete and exit + unlink($fn); + return undef; } return $newin; } -- 2.43.0