1
0
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:
Sara Golemon
2003-04-04 01:34:00 +00:00
parent 5ec34bcd82
commit c985b780a5

View File

@@ -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);