Hi Chris,
I know re-posts are bad, but since I did not see any reaction to the attached
post I'll do nonetheless (maybe it got lost due to MyDoom)
May I ask you please to check the attached patch and maybe include it into the
perl-ldap CVS.
Thanks in advance
Peter
---------- Forwarded Message ----------
Subject: Re: uninit bug in Net::LDAP
Date: Saturday 31 January 2004 21:33
From: Peter Marschall <[EMAIL PROTECTED]>
To: Chris Ridd <[EMAIL PROTECTED]>, Perl-LDAP Mailing List
<[EMAIL PROTECTED]>
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]
-------------------------------------------------------
--
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*//;