From: claudio Date: Mon, 27 Aug 2018 12:15:20 +0000 (+0000) Subject: Undefined plans can never match. Check for that before trying to use the plan. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4103e180a419b8f3b3df2ab68d5eabd4a0fa9fcc;p=openbsd Undefined plans can never match. Check for that before trying to use the plan. OK millert@ gsoares@ --- diff --git a/usr.sbin/ldapd/filter.c b/usr.sbin/ldapd/filter.c index c5bccb5acc3..2aeae4b1d15 100644 --- a/usr.sbin/ldapd/filter.c +++ b/usr.sbin/ldapd/filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filter.c,v 1.7 2018/08/27 11:43:36 claudio Exp $ */ +/* $OpenBSD: filter.c,v 1.8 2018/08/27 12:15:20 claudio Exp $ */ /* * Copyright (c) 2009, 2010 Martin Hedenfalk @@ -37,7 +37,9 @@ ldap_filt_eq(struct ber_element *root, struct plan *plan) char *vs; struct ber_element *a, *vals, *v; - if (plan->adesc != NULL) + if (plan->undefined) + return -1; + else if (plan->adesc != NULL) a = ldap_get_attribute(root, plan->adesc); else a = ldap_find_attribute(root, plan->at); @@ -116,7 +118,9 @@ ldap_filt_subs(struct ber_element *root, struct plan *plan) const char *attr; struct ber_element *a, *v; - if (plan->adesc != NULL) + if (plan->undefined) + return -1; + else if (plan->adesc != NULL) a = ldap_get_attribute(root, plan->adesc); else a = ldap_find_attribute(root, plan->at); @@ -188,7 +192,9 @@ ldap_filt_presence(struct ber_element *root, struct plan *plan) { struct ber_element *a; - if (plan->adesc != NULL) + if (plan->undefined) + return -1; + else if (plan->adesc != NULL) a = ldap_get_attribute(root, plan->adesc); else a = ldap_find_attribute(root, plan->at);