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

(ITS#5056) ldap_add_result_entry crashes when starting a new list



Full_Name: Paul Turgyan
Version: 2.3.35
OS: linux 2..6.18 from source 
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (141.213.231.171)


When calling ldap_add_result_entry with an empty list or when starting a new
list,  ldap_add_result_entry crashes
with a SEGFAULT at line 67.

Here is a patch:


*** addentry.c  Tue Jan  2 16:43:48 2007
--- addentry.c+ Fri Jul 20 13:48:41 2007
***************
*** 64,69 ****
--- 64,72 ----
        assert( e != NULL );
  
        e->lm_chain = *list;
+       if (*list) 
            e->lm_chain_tail = (*list)->lm_chain_tail;
+       else
+           e->lm_chain_tail = NULL;
        *list = e;
  }