summaryrefslogtreecommitdiff
path: root/ext/mcrypt/mcrypt.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-08-12 10:58:21 +0200
committerAnatol Belski <ab@php.net>2015-08-12 14:50:43 +0200
commit2366a070c819f96d47f28021e76e0f01a7e1f7f4 (patch)
tree280a019e8ec089ef195bb79fef67bd680156fba4 /ext/mcrypt/mcrypt.c
parentb7031ba743fd8ca8f6e64df871054b796a979da0 (diff)
downloadphp-git-2366a070c819f96d47f28021e76e0f01a7e1f7f4.tar.gz
improve condition
same as CSPRNG, break by EOF
Diffstat (limited to 'ext/mcrypt/mcrypt.c')
-rw-r--r--ext/mcrypt/mcrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index bdb119fd41..a9098ed283 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -1377,7 +1377,7 @@ PHP_FUNCTION(mcrypt_create_iv)
while (read_bytes < size) {
n = read(*fd, iv + read_bytes, size - read_bytes);
- if (n < 0) {
+ if (n <= 0) {
break;
}
read_bytes += n;