Skip to content
Snippets Groups Projects
Commit 3121074a authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

Output from ldif_fetch_url() is expected to be \0-terminated.

parent 2dcf00b8
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment