summaryrefslogtreecommitdiff
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
parentec71493b993b7a63f30bc0983603da19e9c0d22d (diff)
downloadphp-git-49a7bcd60b05fe225bb1513df9fcde11bbf649b3.tar.gz
use safe_realloc
-rw-r--r--ext/bz2/bz2.c4
-rw-r--r--ext/sybase_ct/php_sybase_ct.c2
2 files changed, 3 insertions, 3 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 */
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index 10358c96c4..581f4f44fa 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -1138,7 +1138,7 @@ static int php_sybase_fetch_result_row (sybase_result *result, int numrows)
result->num_rows++;
i= result->store ? result->num_rows- 1 : 0;
if (i >= result->blocks_initialized*SYBASE_ROWS_BLOCK) {
- result->data = (zval **) erealloc(result->data, sizeof(zval *)*SYBASE_ROWS_BLOCK*(++result->blocks_initialized));
+ result->data = (zval **) safe_erealloc(result->data, SYBASE_ROWS_BLOCK*(++result->blocks_initialized), sizeof(zval *), 0);
}
if (result->store || 1 == result->num_rows) {
result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0);