From c62ffa7e012b1eec4e102d4e80ca4923ba3dfe16 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 25 Apr 1999 21:50:24 +0000 Subject: [PATCH] oops, the 0th byte should be set, too --- ext/mcrypt/mcrypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 09d0c31dd2..65f1693637 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -188,8 +188,8 @@ PHP_FUNCTION(mcrypt_create_iv) read(fd, iv, i); close(fd); } else { - while(i--) { - iv[i] = rand(); + while(i) { + iv[--i] = rand(); } } RETURN_STRINGL(iv, size->value.lval, 0); -- 2.50.1