diff options
author | Arnaud Le Blanc <lbarnaud@php.net> | 2008-09-10 10:28:39 +0000 |
---|---|---|
committer | Arnaud Le Blanc <lbarnaud@php.net> | 2008-09-10 10:28:39 +0000 |
commit | ffb76017d50930c1238f60c15216c3ccac31253d (patch) | |
tree | c7a57429c2c5bf23eca6036e1f0ee6fcc8816a62 | |
parent | b3bbaf7d06011618a981c8377d7c374144e507cc (diff) | |
download | php-git-ffb76017d50930c1238f60c15216c3ccac31253d.tar.gz |
MFH: Fixed #45928 (large scripts from stdin are stripped at 16K border)
-rw-r--r-- | Zend/zend_stream.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 068b30ed87..a67fcdab1f 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -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; } |