View | Details | Raw Unified | Return to bug 42986
Collapse All | Expand All

(-)src/org/apache/xml/security/utils/IdResolver.java (-1 / +1 lines)
Lines 219-225 Link Here
219
    	} while (sibling==null  && parentNode!=null) {    		      		      			
219
    	} while (sibling==null  && parentNode!=null) {    		      		      			
220
    			sibling=parentNode.getNextSibling();
220
    			sibling=parentNode.getNextSibling();
221
    			parentNode=parentNode.getParentNode();   
221
    			parentNode=parentNode.getParentNode();   
222
    			if (!(parentNode instanceof Element)) {
222
    			if (parentNode != null && Node.ELEMENT_NODE != parentNode.getNodeType()) {
223
    				parentNode=null;
223
    				parentNode=null;
224
    			}    			
224
    			}    			
225
    		}      
225
    		}      
(-)src/org/apache/xml/security/Init.java (-1 / +1 lines)
Lines 145-151 Link Here
145
                }
145
                }
146
            }
146
            }
147
			for (Node el=config.getFirstChild();el!=null;el=el.getNextSibling()) {
147
			for (Node el=config.getFirstChild();el!=null;el=el.getNextSibling()) {
148
                if (!(el instanceof Element)) {
148
                if (el == null || Node.ELEMENT_NODE != el.getNodeType()) {
149
                	continue;
149
                	continue;
150
                }
150
                }
151
                String tag=el.getLocalName();
151
                String tag=el.getLocalName();
(-)src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java (-7 / +7 lines)
Lines 198-204 Link Here
198
        try {
198
        try {
199
         NameSpaceSymbTable ns=new NameSpaceSymbTable();
199
         NameSpaceSymbTable ns=new NameSpaceSymbTable();
200
         int nodeLevel=NODE_BEFORE_DOCUMENT_ELEMENT;
200
         int nodeLevel=NODE_BEFORE_DOCUMENT_ELEMENT;
201
         if (rootNode instanceof Element) {
201
         if (rootNode != null && Node.ELEMENT_NODE == rootNode.getNodeType()) {
202
         	//Fills the nssymbtable with the definitions of the parent of the root subnode
202
         	//Fills the nssymbtable with the definitions of the parent of the root subnode
203
         	getParentNameSpaces((Element)rootNode,ns);
203
         	getParentNameSpaces((Element)rootNode,ns);
204
         	nodeLevel=NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
204
         	nodeLevel=NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
Lines 327-334 Link Here
327
    			if (parentNode==endnode)
327
    			if (parentNode==endnode)
328
    				return;
328
    				return;
329
    			sibling=parentNode.getNextSibling();
329
    			sibling=parentNode.getNextSibling();
330
    			parentNode=parentNode.getParentNode();   
330
    			parentNode=parentNode.getParentNode();
331
    			if (!(parentNode instanceof Element)) {
331
    			if (parentNode == null || Node.ELEMENT_NODE != parentNode.getNodeType()) {
332
    				documentLevel=NODE_AFTER_DOCUMENT_ELEMENT;
332
    				documentLevel=NODE_AFTER_DOCUMENT_ELEMENT;
333
    				parentNode=null;
333
    				parentNode=null;
334
    			}    			
334
    			}    			
Lines 384-390 Link Here
384
		return;
384
		return;
385
	boolean currentNodeIsVisible = false;	  
385
	boolean currentNodeIsVisible = false;	  
386
	NameSpaceSymbTable ns=new  NameSpaceSymbTable();
386
	NameSpaceSymbTable ns=new  NameSpaceSymbTable();
387
	if (currentNode instanceof Element)
387
	if (currentNode != null && Node.ELEMENT_NODE == currentNode.getNodeType())
388
		getParentNameSpaces((Element)currentNode,ns);
388
		getParentNameSpaces((Element)currentNode,ns);
389
  	Node sibling=null;
389
  	Node sibling=null;
390
	Node parentNode=null;	
390
	Node parentNode=null;	
Lines 505-511 Link Here
505
				return;
505
				return;
506
			sibling=parentNode.getNextSibling();
506
			sibling=parentNode.getNextSibling();
507
			parentNode=parentNode.getParentNode();   
507
			parentNode=parentNode.getParentNode();   
508
			if (!(parentNode instanceof Element)) {
508
			if (parentNode == null || Node.ELEMENT_NODE != parentNode.getNodeType()) {
509
				parentNode=null;
509
				parentNode=null;
510
				documentLevel=NODE_AFTER_DOCUMENT_ELEMENT;
510
				documentLevel=NODE_AFTER_DOCUMENT_ELEMENT;
511
			}    			
511
			}    			
Lines 587-593 Link Here
587
   	final void getParentNameSpaces(Element el,NameSpaceSymbTable ns)  {
587
   	final void getParentNameSpaces(Element el,NameSpaceSymbTable ns)  {
588
   		List parents=new ArrayList(10);
588
   		List parents=new ArrayList(10);
589
   		Node n1=el.getParentNode();
589
   		Node n1=el.getParentNode();
590
   		if (!(n1 instanceof Element)) {
590
   		if (n1 == null || Node.ELEMENT_NODE != n1.getNodeType()) {
591
   			return;
591
   			return;
592
   		}
592
   		}
593
   		//Obtain all the parents of the elemnt
593
   		//Obtain all the parents of the elemnt
Lines 595-601 Link Here
595
   		while (parent!=null) {
595
   		while (parent!=null) {
596
   			parents.add(parent);
596
   			parents.add(parent);
597
   			Node n=parent.getParentNode();
597
   			Node n=parent.getParentNode();
598
   			if (!(n instanceof Element )) {
598
   			if (n == null || Node.ELEMENT_NODE != n.getNodeType()) {
599
   				break;
599
   				break;
600
   			}
600
   			}
601
   			parent=(Element)n;
601
   			parent=(Element)n;
(-)src/org/apache/xml/security/encryption/XMLCipher.java (-1 / +1 lines)
Lines 1392-1398 Link Here
1392
		// The de-serialiser returns a fragment whose children we need to
1392
		// The de-serialiser returns a fragment whose children we need to
1393
		// take on.
1393
		// take on.
1394
1394
1395
		if (sourceParent instanceof Document) {
1395
		if (sourceParent != null && Node.DOCUMENT_NODE == sourceParent.getNodeType()) {
1396
			
1396
			
1397
		    // If this is a content decryption, this may have problems
1397
		    // If this is a content decryption, this may have problems
1398
1398
(-)src/org/apache/xml/security/keys/keyresolver/implementations/RetrievalMethodResolver.java (-2 / +2 lines)
Lines 279-285 Link Here
279
	   Element e=null;
279
	   Element e=null;
280
	   while (it.hasNext()) {
280
	   while (it.hasNext()) {
281
		   Node currentNode=(Node)it.next();
281
		   Node currentNode=(Node)it.next();
282
		   if (currentNode instanceof Element) {
282
		   if (currentNode != null && Node.ELEMENT_NODE == currentNode.getNodeType()) {
283
			   e=(Element)currentNode;
283
			   e=(Element)currentNode;
284
			   break;
284
			   break;
285
		   }
285
		   }
Lines 291-297 Link Here
291
  		do {
291
  		do {
292
  			parents.add(e);
292
  			parents.add(e);
293
  			Node n=e.getParentNode();
293
  			Node n=e.getParentNode();
294
  			if (!(n instanceof Element )) {
294
  			if (n == null || Node.ELEMENT_NODE != n.getNodeType()) {
295
  				break;
295
  				break;
296
  			}
296
  			}
297
  			e=(Element)n;
297
  			e=(Element)n;

Return to bug 42986