mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-11 09:22:54 -05:00
Output from ldif_fetch_url() is expected to be \0-terminated.
This commit is contained in:
parent
2dcf00b82f
commit
3121074ad7
1 changed files with 2 additions and 1 deletions
|
|
@ -74,7 +74,7 @@ ldif_fetch_url(
|
|||
total = 0;
|
||||
|
||||
while( (bytes = fread( buffer, 1, sizeof(buffer), url )) != 0 ) {
|
||||
char *newp = ber_memrealloc( p, total + bytes );
|
||||
char *newp = ber_memrealloc( p, total + bytes + 1 );
|
||||
if( newp == NULL ) {
|
||||
ber_memfree( p );
|
||||
fclose( url );
|
||||
|
|
@ -96,6 +96,7 @@ ldif_fetch_url(
|
|||
p = newp;
|
||||
}
|
||||
|
||||
p[total] = '\0';
|
||||
*valuep = p;
|
||||
*vlenp = total;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue