From 53338dc4e2a62537370c4431573a6caea1df8a1a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 18 May 2000 16:44:32 +0000 Subject: [PATCH] Fix nul ('\0') string termination bug introduced by use of memalloc/memcpy instead of strdup --- libraries/libldif/line64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.5