]> granicus.if.org Git - php/commitdiff
Improved validation route for size parameter of the mcrypt_create_iv()
authorIlia Alshanetsky <iliaa@php.net>
Thu, 15 Feb 2007 01:15:45 +0000 (01:15 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 15 Feb 2007 01:15:45 +0000 (01:15 +0000)
function.

ext/mcrypt/mcrypt.c

index 6f3561cacd11a52a89a00f6f029863f1b4abaf69..12242ed017caeb29c6da20afb1f07306620f55c1 100644 (file)
@@ -1242,8 +1242,8 @@ PHP_FUNCTION(mcrypt_create_iv)
                return;
        }
 
-       if (size <= 0) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not create an IV with size 0 or smaller");
+       if (size <= 0 || size >= 2147483647) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not create an IV with a size of less then 1 or greater then %d", INT_MAX);
                RETURN_FALSE;
        }