mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-20 22:03:45 -05:00
Fix nul ('\0') string termination bug introduced by use of
memalloc/memcpy instead of strdup
This commit is contained in:
parent
c48155a139
commit
53338dc4e2
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue