--- embedaddon/php/Zend/zend_stream.c 2012/02/21 23:47:52 1.1.1.1 +++ embedaddon/php/Zend/zend_stream.c 2014/06/15 20:04:04 1.1.1.4 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_stream.c,v 1.1.1.1 2012/02/21 23:47:52 misho Exp $ */ +/* $Id: zend_stream.c,v 1.1.1.4 2014/06/15 20:04:04 misho Exp $ */ #include "zend.h" @@ -79,7 +79,7 @@ static size_t zend_stream_stdio_fsizer(void *handle TS static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */ #if HAVE_MMAP if (stream->mmap.map) { - munmap(stream->mmap.map, stream->mmap.len); + munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD); } else #endif if (stream->mmap.buf) { @@ -134,7 +134,7 @@ ZEND_API int zend_stream_open(const char *filename, ze handle->type = ZEND_HANDLE_FP; handle->opened_path = NULL; handle->handle.fp = zend_fopen(filename, &handle->opened_path TSRMLS_CC); - handle->filename = (char *)filename; + handle->filename = filename; handle->free_filename = 0; memset(&handle->handle.stream.mmap, 0, sizeof(zend_mmap)); @@ -284,7 +284,6 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_ if (ZEND_MMAP_AHEAD) { memset(file_handle->handle.stream.mmap.buf + file_handle->handle.stream.mmap.len, 0, ZEND_MMAP_AHEAD); } - #if HAVE_MMAP return_mapped: #endif @@ -328,7 +327,7 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle * fh->opened_path = NULL; } if (fh->free_filename && fh->filename) { - efree(fh->filename); + efree((char*)fh->filename); fh->filename = NULL; } }