Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-281

JNDIConfiguration::recursiveGetKeys goes out of stack

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.5
    • None
    • None
    • Websphere 5.1

    Description

      There can be cycles in contexts. Websphere 5.1 certainly does have them.

      When getKeys() is called on a JNDIConfiguration, eventually recursiveGetKeys() is called, which calls itself for every subcontext. This will never stop if there is a cycle.

      I would like to suggest the following changes to recursiveGetKeys() to fix this:

      1) check for each subcontext if it has been processed before. If so, don't process it. An additional stack argument to recursiveGetKeys() should do the trick here.

      2) a maxDepth attribute, like <jndi maxDepth="4"/>. If the number of subcontexts is equal to maxDepth, stop processing. The maxDepth attribute should be optional of course, and have a default value like 911or so. The stack argument could be used to check the amount of subcontexts processed.

      Because I want to be able to dump the configuration for debugging purposes, this item is of somewhat importance to me.

      I tested this in 1.2 at work, so I cannot easily test this against 1.4. But as the code of 1.4 seems to be more or less the same, I think the problem still exists.

      Attachments

        Activity

          People

            Unassigned Unassigned
            michielgkalkman Michiel Kalkman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: