You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Mikhail Mazurskiy (JIRA)" <ji...@apache.org> on 2015/03/21 23:54:10 UTC

[jira] [Closed] (LOG4J2-980) Numerical overflow in BurstFilter not handled correctly

     [ https://issues.apache.org/jira/browse/LOG4J2-980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Mazurskiy closed LOG4J2-980.
------------------------------------

> 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
>             Fix For: 2.3
>
>         Attachments: LOG4J2-980.patch
>
>
> {{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