From 661a54c292508743ba3308d3bcbec0e409bc93fa Mon Sep 17 00:00:00 2001 From: Thierry Bordaz Date: Wed, 25 Oct 2017 17:33:18 +0200 Subject: [PATCH] Ticket 49412 - SIGSEV when setting invalid changelog config value Bug Description: If admin configures attribute of "cn=changelog5,cn=config" with empty value, it can trigger a sigsev Fix Description: Testing empty value https://pagure.io/389-ds-base/issue/49412 Reviewed by: ? Platforms tested: F23 Flag Day: no Doc impact: no --- ldap/servers/plugins/replication/cl5_config.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c index ab2c53d..244f5cc 100644 --- a/ldap/servers/plugins/replication/cl5_config.c +++ b/ldap/servers/plugins/replication/cl5_config.c @@ -305,7 +305,15 @@ changelog5_config_modify(Slapi_PBlock *pb, for (i = 0; mods && mods[i] != NULL; i++) { if (mods[i]->mod_op & LDAP_MOD_DELETE) { /* We don't support deleting changelog attributes */ - } else { + } else if (mods[i]->mod_values == NULL) { + *returncode = LDAP_UNWILLING_TO_PERFORM; + if (returntext) { + PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, + "%s: no value provided", + mods[i]->mod_type ? mods[i]->mod_type : ""); + } + goto done; + }else { int j; for (j = 0; ((mods[i]->mod_values[j]) && (LDAP_SUCCESS == rc)); j++) { char *config_attr, *config_attr_value; -- 2.5.5