Mikhail Mazurskiy created LOG4J2-980:
----------------------------------------
Summary: Numerical overflow in BurstFilter not handled correctly
Key: LOG4J2-980
URL: https://issues.apache.org/jira/browse/LOG4J2-980
Project: Log4j 2
Issue Type: Bug
Components: Filters
Affects Versions: 2.2
Reporter: Mikhail Mazurskiy
Priority: Trivial
{{org.apache.logging.log4j.core.filter.BurstFilter.LogDelay#compareTo}} is
implemented with mistake - it does not account for numerical overflow (negative
values). I.e. [System.nanoTime()
JavaDocs|http://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--]
say:
{quote}
To compare two nanoTime values
long t0 = System.nanoTime();
...
long t1 = System.nanoTime();
one should use t1 - t0 < 0, not t1 < t0, because of the possibility of
numerical overflow.
{quote}
but the mentioned method compares values directly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]