Skip to content

Commit f31dae0

Browse files
committed
Promote to a catchable error a condition which needs special crafted data
1 parent 2057668 commit f31dae0

File tree

1 file changed

+2
-2
lines changed
  • ext/bcmath/libbcmath/src

1 file changed

+2
-2
lines changed

ext/bcmath/libbcmath/src/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ _bc_new_num_ex (length, scale, persistent)
4545
{
4646
bc_num temp;
4747
/* PHP Change: add length check */
48-
if ((size_t)length+(size_t)scale > INT_MAX) {
49-
zend_error(E_ERROR, "Result too long, max is %d", INT_MAX);
48+
if ((size_t)length + (size_t)scale > INT_MAX) {
49+
zend_throw_error(NULL, "Result exceeds the length a PHP string can hold");
5050
}
5151
/* PHP Change: malloc() -> pemalloc(), removed free_list code */
5252
temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, persistent);

0 commit comments

Comments
 (0)