summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-09-01 15:08:35 -0600
committerRich Megginson <rmeggins@redhat.com>2010-09-01 15:08:35 -0600
commit19c62472381cf72bc7bd20694bbd672edde7f94f (patch)
tree940da1ec42a500f4a4a36dd7a91e0e6ac9d4adb0
parent28a607a6bfed369b9f0c82e8b5ef4b50c158a928 (diff)
downloadds-19c62472381cf72bc7bd20694bbd672edde7f94f.tar.gz
ds-19c62472381cf72bc7bd20694bbd672edde7f94f.tar.xz
ds-19c62472381cf72bc7bd20694bbd672edde7f94f.zip
bug 614511 - fix coverity null reference - revert macro aci $dn logic
instead of changing the logic to catch matched_val == NULL, make the code work like it does in earlier releases, but add an explicit check for matched_val == NULL to avoid using it.
-rw-r--r--ldap/servers/plugins/acl/acllas.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
index c510eb1e..a41487e3 100644
--- a/ldap/servers/plugins/acl/acllas.c
+++ b/ldap/servers/plugins/acl/acllas.c
@@ -4178,8 +4178,8 @@ acllas_replace_dn_macro( char *rule, char *matched_val, lasInfo *lasinfo) {
has_macro_levels = 1;
}
- if ( !has_macro_dn ) { /* No $(dn) */
-
+ if ( (!has_macro_dn && !has_macro_levels) || !matched_val ) { /* No ($dn) and no [$dn] ... */
+ /* ... or no value to replace */
/*
* No $dn thing, just return a list with two elements, rule and NULL.
* charray_add will create the list and null terminate it.
@@ -4194,9 +4194,11 @@ acllas_replace_dn_macro( char *rule, char *matched_val, lasInfo *lasinfo) {
*
* First, replace all occurrencers of ($dn) with the matched_val
*/
- patched_rule =
+ if ( has_macro_dn) {
+ patched_rule =
acl_replace_str(rule, ACL_RULE_MACRO_DN_KEY, matched_val);
-
+ }
+
/* If there are no [$dn] we're done */
if ( !has_macro_levels ) {