logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Mazurskiy (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4J2-980) Numerical overflow in BurstFilter not handled correctly
Date Sat, 21 Mar 2015 08:09:38 GMT
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message