You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2003/10/05 05:20:50 UTC

cvs commit: xml-xerces/c/src/xercesc/internal IGXMLScanner2.cpp SGXMLScanner.cpp

neilg       2003/10/04 20:20:50

  Modified:    c/src/xercesc/internal IGXMLScanner2.cpp SGXMLScanner.cpp
  Log:
  fix potential null pointer reference
  
  Revision  Changes    Path
  1.33      +3 -3      xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp
  
  Index: IGXMLScanner2.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- IGXMLScanner2.cpp	5 Oct 2003 02:15:12 -0000	1.32
  +++ IGXMLScanner2.cpp	5 Oct 2003 03:20:50 -0000	1.33
  @@ -534,8 +534,8 @@
           // Check after all specified attrs are scanned
           // (1) report error for REQUIRED attrs that are missing (V_TAGc)
           // (2) add default attrs if missing (FIXED and NOT_FIXED)
  -        XMLAttDefList &attDefList = (fGrammarType == Grammar::SchemaGrammarType)
  -                ? (((SchemaValidator*)fValidator)->getCurrentTypeInfo()->getAttDefList())
  +        XMLAttDefList &attDefList = (fGrammarType == Grammar::SchemaGrammarType && currType)
  +                ? (currType->getAttDefList())
                   : (elemDecl->getAttDefList());
           while (attDefList.hasMoreElements())
           {
  
  
  
  1.39      +4 -2      xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
  
  Index: SGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- SGXMLScanner.cpp	5 Oct 2003 02:15:12 -0000	1.38
  +++ SGXMLScanner.cpp	5 Oct 2003 03:20:50 -0000	1.39
  @@ -2404,7 +2404,9 @@
           // Check after all specified attrs are scanned
           // (1) report error for REQUIRED attrs that are missing (V_TAGc)
           // (2) add default attrs if missing (FIXED and NOT_FIXED)
  -        XMLAttDefList& attDefList = ((SchemaValidator*)fValidator)->getCurrentTypeInfo()->getAttDefList();
  +        XMLAttDefList& attDefList = (currType)
  +                ? currType->getAttDefList()
  +                : elemDecl->getAttDefList();
           while (attDefList.hasMoreElements())
           {
               // Get the current att def, for convenience and its def type
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org