neilg       2002/09/05 14:35:29

  Modified:    java/src/org/apache/xerces/impl XMLEntityManager.java
  Log:
  fixing bugs 11406 and 12040.
  When searching for a mark-up terminating symbol (like --> or ?>), the parser would 
go into
  an infinite loop if only some of the characters were present before EOF.
  
  Revision  Changes    Path
  1.40      +10 -1     xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
  
  Index: XMLEntityManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- XMLEntityManager.java     4 Sep 2002 15:54:03 -0000       1.39
  +++ XMLEntityManager.java     5 Sep 2002 21:35:29 -0000       1.40
  @@ -2790,6 +2790,15 @@
                                    fCurrentEntity.ch, 0, fCurrentEntity.count - 
fCurrentEntity.position);
                   load(fCurrentEntity.count - fCurrentEntity.position, false);
                   fCurrentEntity.position = 0;
  +            } 
  +            if (fCurrentEntity.position >= fCurrentEntity.count - delimLen) {
  +                // something must be wrong with the input:  e.g., file ends  an 
unterminated comment
  +                int length = fCurrentEntity.count - fCurrentEntity.position;
  +                data.setValues(fCurrentEntity.ch, fCurrentEntity.position, length); 
  +                fCurrentEntity.columnNumber += fCurrentEntity.count;
  +                fCurrentEntity.position = fCurrentEntity.count;
  +                load(0,true);
  +                return false;
               }
   
               // normalize newlines
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to