d@delphij.net wrote:
Here is a patch that intends to fix #6014. getpassphrase() (which in turn would be a getpass() call, or lutil_getpass() call), returns a pointer from a static char * pointer, which should never be free()'ed. Therefore, a strdup() should be called.
Note that, since both getpass() implementation could return NULL, we can not strdup() directly. Instead, we need to detect whether it's NULL and handle separately.
Probably, a better solution would be to implement a
lutil_get_terminal_password(char *prompt, struct berval *passwd)
routine that mallocs as appropriate.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------