Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1950

Unsafe cast to int in getPwdTimeBeforeExpiry calculation of AuthenticationInterceptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0-M15
    • None
    • core
    • None

    Description

      int pwdAge = ( int ) ( currentTime - changedTime ) / 1000;

      Will cast to int before the division which causes overflow of int if the difference is too large. Even with division, it could still be too large so it is unsafe to use an int value for pwdAge. As it is only used for comparison, we can leave it as a long.

      Attachments

        1. DIRSERVER-1950.patch
          4 kB
          lucas theisen

        Activity

          People

            Unassigned Unassigned
            ltheisen@mitre.org lucas theisen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: