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

(ITS#6014) rev. 1.121 of clients/tools/common.c makes ldapmodify coredump



Full_Name: Yuri Pankov
Version: 2.4.15
OS: FreeBSD
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (85.175.25.104)


Running ldap{add,modify} with -W switch leads to following coredump (introduced
in rev.1.121 of clients/tools/common.c):
> ldapadd -x -D "cn=root,dc=darklight,dc=homeunix,dc=org" -W -f root.ldif
Enter LDAP Password: 
adding new entry "dc=darklight,dc=homeunix,dc=org"

Assertion failed: (arena != NULL), function arena_dalloc, file
/usr/src/lib/libc/stdlib/malloc.c, line 3843.
Abort (core dumped)

We shouldn't try to free() result returned by getpass():

--- ./clients/tools/common.c.orig       2009-03-11 19:24:18.523596600 +0300
+++ ./clients/tools/common.c    2009-03-11 19:24:52.443459786 +0300
@@ -255,9 +255,11 @@
                ber_memfree( binddn );
        }
 
+#ifndef HAVE_GETPASS
        if ( passwd.bv_val != NULL ) {
                ber_memfree( passwd.bv_val );
        }
+#endif
 }
 
 void