Hi Chris, hi list,

On Wednesday 28 January 2004 22:49, Chris Ridd wrote:
> Filters are mandatory in the protocol, so the search method should return
> an error. (Using some kind of default filter is an interesting idea but
> could be really expensive on some server configurations, so I think an
> error's safer.)
> Good catch, thanks for the bug report.

The patch attached should fix the problem.
It sets the error string and returns undef on undefined filters.

Peter

-- 
Peter Marschall
eMail: [EMAIL PROTECTED]
# patch to check that filter is defined in Net::LDAP::Filter->parse
# created by Peter Marschall <[EMAIL PROTECTED]>
--- lib/Net/LDAP/Filter.pm
+++ lib/Net/LDAP/Filter.pm	2004-01-31 21:17:09.000000000 +0100
@@ -159,6 +159,12 @@
 
   undef $ErrStr;
 
+  # a filter is required
+  if (!defined $filter) {
+    $ErrStr = "Undefined filter";
+    return undef;
+  }
+
   # Algorithm depends on /^\(/;
   $filter =~ s/^\s*//;
 

Reply via email to