diff options
| author | Stanislav Malyshev <stas@php.net> | 2007-03-06 02:10:25 +0000 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2007-03-06 02:10:25 +0000 |
| commit | 49a7bcd60b05fe225bb1513df9fcde11bbf649b3 (patch) | |
| tree | c124a8f53182cab20466ba7e19643ceea8d09321 /ext/bz2 | |
| parent | ec71493b993b7a63f30bc0983603da19e9c0d22d (diff) | |
| download | php-git-49a7bcd60b05fe225bb1513df9fcde11bbf649b3.tar.gz | |
use safe_realloc
Diffstat (limited to 'ext/bz2')
| -rw-r--r-- | ext/bz2/bz2.c | 4 |
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 */ |
