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

Re: ldap_modify (ITS#238)



Hi,

hby@umich.edu wrote:

> Full_Name: Howard B Young
> Version: 1.2.4
> OS: solaris 2.6
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (141.211.164.66)
>
> Hello;
>
>   Starting with 1.2.4, a call to ldap_modify that contains a LDAPMod with a
> LDAP_MOD_DELETE request that tries to delete an attribute by passing a NULL
> mod_values or mod_bvalues causes the server to die with a segmentation error.

[snipped]

>    for (i = 0; vals[i] != NULL; i++) {
>
> without checking for the possibilty that vals itself is NULL. Changing the line
> to
>
>    for (i = 0; (vals != NULL) && (vals[i] !=NULL); i++) {
>
> corrects the problem.

    This requires short-circuit boolean.  It is quite dangerous and behaves
slightly differently on different platform.  You may get back to the same problem.

Regards,
  Chee Hong.