diff options
Diffstat (limited to 'main/streams/streams.c')
| -rwxr-xr-x | main/streams/streams.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index e473dad154..d74cccf1ea 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -803,6 +803,10 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re } } + if (toread > maxlen && maxlen > 0) { + toread = maxlen; + } + buf = emalloc(toread + 1); *returned_len = php_stream_read(stream, buf, toread); |
