mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
MFH: Fixed #45928 (large scripts from stdin are stripped at 16K border)
This commit is contained in:
parent
b3bbaf7d06
commit
ffb76017d5
1 changed files with 10 additions and 0 deletions
|
@ -49,6 +49,11 @@ static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */
|
|||
{
|
||||
struct stat buf;
|
||||
if (handle && fstat(fileno((FILE*)handle), &buf) == 0) {
|
||||
#ifdef S_ISREG
|
||||
if (!S_ISREG(buf.st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return buf.st_size;
|
||||
}
|
||||
return 0;
|
||||
|
@ -93,6 +98,11 @@ static size_t zend_stream_fsize(zend_file_handle *file_handle TSRMLS_DC) /* {{{
|
|||
return file_handle->handle.stream.fsizer(file_handle->handle.stream.handle TSRMLS_CC);
|
||||
}
|
||||
if (file_handle->handle.fp && fstat(fileno(file_handle->handle.fp), &buf) == 0) {
|
||||
#ifdef S_ISREG
|
||||
if (!S_ISREG(buf.st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return buf.st_size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue