From: Kurt Zeilenga Date: Thu, 18 May 2000 16:44:32 +0000 (+0000) Subject: Fix nul ('\0') string termination bug introduced by use of X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2920 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=53338dc4e2a62537370c4431573a6caea1df8a1a;p=openldap Fix nul ('\0') string termination bug introduced by use of memalloc/memcpy instead of strdup --- diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index 4af9649a9f..7ee83d8e6a 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -223,7 +223,7 @@ done: } if( !url && value != NULL ) { - p = ber_memalloc( vlen ); + p = ber_memalloc( vlen + 1 ); if( p == NULL ) { ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug, "ldif_parse_line: value malloc failed\n"); @@ -232,6 +232,7 @@ done: return( -1 ); } memcpy( p, value, vlen ); + p[vlen] = '\0'; value = p; }