diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:38:07 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:38:07 -0400 |
| commit | bb01389fbd53ec1cbcb80d0681a37cca1267891a (patch) | |
| tree | 4783178fca65a5d9071c8df34f2ddc3d31728673 /ext/bcmath/libbcmath/src/div.c | |
| parent | eddbbea4325e602ddc87c545531609132d4f0e3b (diff) | |
| download | php-upstream/5.2.4.tar.gz | |
Imported Upstream version 5.2.4upstream/5.2.4
Diffstat (limited to 'ext/bcmath/libbcmath/src/div.c')
| -rw-r--r-- | ext/bcmath/libbcmath/src/div.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bcmath/libbcmath/src/div.c b/ext/bcmath/libbcmath/src/div.c index 1ad371012..8c05170c7 100644 --- a/ext/bcmath/libbcmath/src/div.c +++ b/ext/bcmath/libbcmath/src/div.c @@ -127,13 +127,13 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC) extra = scale - scale1; else extra = 0; - num1 = (unsigned char *) emalloc (n1->n_len+n1->n_scale+extra+2); + num1 = (unsigned char *) safe_emalloc (1, n1->n_len+n1->n_scale, extra+2); if (num1 == NULL) bc_out_of_memory(); memset (num1, 0, n1->n_len+n1->n_scale+extra+2); memcpy (num1+1, n1->n_value, n1->n_len+n1->n_scale); len2 = n2->n_len + scale2; - num2 = (unsigned char *) emalloc (len2+1); + num2 = (unsigned char *) safe_emalloc (1, len2, 1); if (num2 == NULL) bc_out_of_memory(); memcpy (num2, n2->n_value, len2); *(num2+len2) = 0; @@ -164,7 +164,7 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC) memset (qval->n_value, 0, qdigits); /* Allocate storage for the temporary storage mval. */ - mval = (unsigned char *) emalloc (len2+1); + mval = (unsigned char *) safe_emalloc (1, len2, 1); if (mval == NULL) bc_out_of_memory (); /* Now for the full divide algorithm. */ |
