DBCollection Doesn't Check Keys Contained By Lists

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.11.2, 2.12.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In DBCollection._checkKeys (pasted below), if the inner Object is an instance of List, it is not validated. It is possible, for instance, to have a List<BasicDBObject>> where the DBObjects in the list will not have their keys validated.

       private void _checkKeys( DBObject o ) {
              if ( o instanceof LazyDBObject || o instanceof LazyDBList )
                  return;
      
              for ( String s : o.keySet() ){
                  validateKey ( s );
                  Object inner = o.get( s );
                  if ( inner instanceof DBObject ) {
                      _checkKeys( (DBObject)inner );
                  } else if ( inner instanceof Map ) {
                      _checkKeys( (Map<String, Object>)inner );
                  }
              }
          }
      

              Assignee:
              Unassigned
              Reporter:
              Doug Jones
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: