Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Division by 0 in JCrypt #1557

Merged
merged 1 commit into from

2 participants

@elinw

We have a report of division by 0 error [#29372] at line 210 (https://github.com/joomla/joomla-platform/blob/staging/libraries/joomla/crypt/crypt.php#L210) . A look at the code indicates that you would get $duration == 0 where $microStart and $microEnd are the same (and all the conditions for getting to that point are met, which would not be typical).

@LouisLandry LouisLandry merged commit b22fdf8 into joomla:staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 28, 2012
  1. @elinw
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  libraries/joomla/crypt/crypt.php
View
2  libraries/joomla/crypt/crypt.php
@@ -194,7 +194,7 @@ public static function genRandomBytes($length = 16)
}
$microEnd = microtime(true) * 1000000;
$entropy .= $microStart . $microEnd;
- if ($microStart > $microEnd)
+ if ($microStart >= $microEnd)
{
$microEnd += 1000000;
}
Something went wrong with that request. Please try again.