summaryrefslogtreecommitdiff
path: root/ext/mcrypt/mcrypt.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-10-03 10:12:11 +0200
committerNikita Popov <nikic@php.net>2015-10-03 10:12:11 +0200
commitfe1933aae2185624bd51b1fd46b8d959f88daf4a (patch)
tree375535e26ff6402fd8b0dca2a565d85e50b16ea6 /ext/mcrypt/mcrypt.c
parent6f895a29c9335b78a7efd0725802e78a8d2ed2d5 (diff)
downloadphp-git-fe1933aae2185624bd51b1fd46b8d959f88daf4a.tar.gz
Fixed bug #70625
Diffstat (limited to 'ext/mcrypt/mcrypt.c')
-rw-r--r--ext/mcrypt/mcrypt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 5b341123bb..624e2ce786 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -1237,6 +1237,10 @@ static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSR
{
if (mcrypt_enc_mode_has_iv(td) == 1) {
int expected_iv_size = mcrypt_enc_get_iv_size(td);
+ if (expected_iv_size == 0) {
+ /* Algorithm does not use IV, even though mode supports it */
+ return SUCCESS;
+ }
if (!iv) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,