Skip to content

Commit 0da8b8b

Browse files
committed
Fix bug #72135 - don't create strings with lengths outside int range
1 parent 41fc3c7 commit 0da8b8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: ext/standard/html.c

+4
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,10 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
14441444
}
14451445

14461446
replaced = php_escape_html_entities_ex(str, str_len, &new_len, all, (int) flags, hint_charset, double_encode TSRMLS_CC);
1447+
if (new_len > INT_MAX) {
1448+
efree(replaced);
1449+
RETURN_FALSE;
1450+
}
14471451
RETVAL_STRINGL(replaced, (int)new_len, 0);
14481452
}
14491453
/* }}} */

0 commit comments

Comments
 (0)