diff options
Diffstat (limited to 'main/streams.c')
-rwxr-xr-x | main/streams.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/streams.c b/main/streams.c index b65f39feef..3381791c89 100755 --- a/main/streams.c +++ b/main/streams.c @@ -441,7 +441,8 @@ PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen } } if (len) { - *buf = perealloc_rel_orig(*buf, len, persistent); + *buf = perealloc_rel_orig(*buf, len + 1, persistent); + (*buf)[len] = '\0'; } else { pefree(*buf, persistent); *buf = NULL; |