1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

use safe_realloc

This commit is contained in:
Stanislav Malyshev
2007-03-06 02:10:25 +00:00
parent ec71493b99
commit 49a7bcd60b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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 */
+1 -1
View File
@@ -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);