You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ga...@apache.org on 2003/07/24 11:32:53 UTC

cvs commit: xml-xerces/c/src/xercesc/util XMLUri.cpp

gareth      2003/07/24 02:32:52

  Modified:    c/src/xercesc/util XMLUri.cpp
  Log:
  Fix for bug #2005. Patch by Michael Glavassevich.
  
  'scheme:#fragment' is not a valid URI, however from inspecting the code it
  seems like Xerces-C will accept 'URIs' of this form. The ':' must be followed
  by either a '/' or a uric_no_slash.
  
  Revision  Changes    Path
  1.13      +6 -4      xml-xerces/c/src/xercesc/util/XMLUri.cpp
  
  Index: XMLUri.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLUri.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XMLUri.cpp	16 May 2003 06:01:53 -0000	1.12
  +++ XMLUri.cpp	24 Jul 2003 09:32:52 -0000	1.13
  @@ -395,6 +395,7 @@
   	}
   
   	int index = 0;
  +	bool foundScheme = false;
   
   	// Check for scheme, which must be before `/'. Also handle names with
   	// DOS drive letters ('D:'), so 1-character schemes are not allowed.
  @@ -413,17 +414,18 @@
       }
   	else
       {
  -        initializeScheme(trimedUriSpec);
  +        foundScheme = true;
  +	initializeScheme(trimedUriSpec);
           index = XMLString::stringLen(fScheme)+1;
       }
   
       // It's an error if we stop here
  -    if (index == trimedUriSpecLen)
  +    if (index == trimedUriSpecLen || (foundScheme && (trimedUriSpec[index] == chPound)))
       {
           ThrowXML1(MalformedURLException
                   , XMLExcepts::XMLNUM_URI_Component_Empty
                   , errMsg_PATH);
  -	}
  +    }
   
   	// two slashes means generic URI syntax, so we get the authority
       XMLCh* authUriSpec = (XMLCh*) fMemoryManager->allocate
  
  
  

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