[Date Prev][Date Next] [Chronological] [Thread] [Top]

slapd core dumps when slapi_internal_bind is called with base null base DN (ITS#2464)



Full_Name: Julius Enarusai
Version: HEAD
OS: RedHat Linux 9.0
URL: ftp://ftp.openldap.org/incoming/slapi_internal_bind.diff
Submission from: (NULL) (129.42.208.186)


slapd core dumps when slapi_internal_bind is called with a null base DN.
slapi_internal_bind is attempting to slapi_ch_strdup with '\0'. The following
patch will fix the problem:

@@ -1066,8 +1066,13 @@
    ptr = (Slapi_PBlock *)op->o_pb;
    op->o_ctrls = controls;

-   dn.bv_val = slapi_ch_strdup(ldn);
-   dn.bv_len = strlen(ldn);
+   if(ldn == NULL) {
+       dn.bv_val = NULL;
+       dn.bv_len = 0;
+   } else {
+       dn.bv_val = slapi_ch_strdup(ldn);
+       dn.bv_len = strlen(ldn);
+   }