Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-980

Numerical overflow in BurstFilter not handled correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.2
    • 2.3
    • Filters
    • None

    Description

      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 say:

      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.

      but the mentioned method compares values directly.

      Attachments

        1. LOG4J2-980.patch
          3 kB
          Mikhail Mazursky

        Activity

          People

            Unassigned Unassigned
            ash2k Mikhail Mazursky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: