From: Ilia Alshanetsky Date: Wed, 2 Apr 2003 00:25:57 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.2RC2~200 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd2968d0db63d175b88a529cc76d592710e98914;p=php MFH --- diff --git a/ext/standard/string.c b/ext/standard/string.c index db6ca361ff..6e2379a232 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3531,6 +3531,10 @@ PHP_FUNCTION(str_repeat) /* Initialize the result string */ result_len = Z_STRLEN_PP(input_str) * Z_LVAL_PP(mult); + if (result_len < 1 || result_len > 2147483647) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may not create strings longer then 2147483647 bytes"); + RETURN_FALSE; + } result = (char *)emalloc(result_len + 1); /* Heavy optimization for situations where input string is 1 byte long */