summaryrefslogtreecommitdiff
path: root/ext/bz2
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-03-06 02:10:25 +0000
committerStanislav Malyshev <stas@php.net>2007-03-06 02:10:25 +0000
commit49a7bcd60b05fe225bb1513df9fcde11bbf649b3 (patch)
treec124a8f53182cab20466ba7e19643ceea8d09321 /ext/bz2
parentec71493b993b7a63f30bc0983603da19e9c0d22d (diff)
downloadphp-git-49a7bcd60b05fe225bb1513df9fcde11bbf649b3.tar.gz
use safe_realloc
Diffstat (limited to 'ext/bz2')
-rw-r--r--ext/bz2/bz2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index ce17adf6fe..ebe0eb5f37 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -562,13 +562,13 @@ static PHP_FUNCTION(bzdecompress)
/* compression is better then 2:1, need to allocate more memory */
bzs.avail_out = source_len;
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
- dest = erealloc(dest, size + bzs.avail_out + 1);
+ dest = safe_erealloc(dest, 1, bzs.avail_out+1, size );
bzs.next_out = dest + size;
}
if (error == BZ_STREAM_END || error == BZ_OK) {
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
- dest = erealloc(dest, size + 1);
+ dest = safe_erealloc(dest, 1, size, 1);
dest[size] = '\0';
RETVAL_STRINGL(dest, size, 0);
} else { /* real error */