Bug #62716 [Opn->Csd]: munmap() is called with the incorrect length
| From: | laruence@php.net | Date: | Thu, 02 Aug 2012 04:28:23 +0000 |
| Subject: | Bug #62716 [Opn->Csd]: munmap() is called with the incorrect length | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-172379@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62716&edit=1
ID: 62716
Updated by: laruence@php.net
Reported by: slangley at google dot com
Summary: munmap() is called with the incorrect length
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: All
PHP Version: 5.3.15
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2012-08-01 11:55:48] slangley at google dot com
Description:
------------
In zend_stream.cc the size passed to mmap is the size of the file +
ZEND_MMAP_AHEAD.
*buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE,
fileno(file_handle->handle.fp), 0);
However, when munmap() is called the incorrect size is passed.
static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */
#if HAVE_MMAP
if (stream->mmap.map) {
munmap(stream->mmap.map, stream->mmap.len);
} else
#endif
The call to munmap should be
munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD);
Test script:
---------------
N/A
Expected result:
----------------
N/A
Actual result:
--------------
N/A
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62716&edit=1