mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
Prevent php_stream_get_record from grabbing more than maxlen characters
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user