diff options
author | Andrey Andreev <narf@devilix.net> | 2015-11-09 10:24:19 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-11-09 10:24:19 +0100 |
commit | 2fe1a2389aa13c3acde7fb42ab35e79504e89f75 (patch) | |
tree | 0ea61ee7414bb2a46939dd9c095e8ab64708174b /system | |
parent | 4cda80715966ddb28815b69b6e67ec79b10d3d31 (diff) |
[ci skip] Fix an infinite loop in captcha helper
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/captcha_helper.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 85bcfb5a0..03c1dd852 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -171,7 +171,8 @@ if ( ! function_exists('create_captcha')) $byte_index = $word_index = 0; while ($word_index < $word_length) { - if (($rand_index = unpack('C', $bytes[$byte_index++])) > $rand_max) + list(, $rand_index) = unpack('C', $bytes[$byte_index++]); + if ($rand_index > $rand_max) { // Was this the last byte we have? // If so, try to fetch more. |