From 26ed86a95f8ed47afeea679ba1cebe3b7f1bb843 Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Wed, 29 May 2013 21:20:45 +0200 Subject: [PATCH] Iconv converts the terminating NUL in the LDAP string The LDAP string was not completely converted and was lacking the terminating zero. --- usertab.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usertab.c b/usertab.c index 780c200..f943685 100644 --- a/usertab.c +++ b/usertab.c @@ -216,11 +216,11 @@ const char * charset_convert( const char * str_in, const char * charset_to ) size_t str_in_len; size_t str_out_len; - str_in_len = strlen( str_in ); + str_in_len = strlen( str_in ) + 1;//process the terminating NUL too str_out_len = ( 2 * str_in_len ); if (ldapconvbuffer==NULL || ldapconvbuffersize