dbertoni 01/12/18 22:11:45
Modified: c/src/XPath XPathProcessorImpl.cpp
Log:
Check for 0-length NCNames.
Revision Changes Path
1.47 +12 -3 xml-xalan/c/src/XPath/XPathProcessorImpl.cpp
Index: XPathProcessorImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathProcessorImpl.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- XPathProcessorImpl.cpp 2001/11/26 23:16:02 1.46
+++ XPathProcessorImpl.cpp 2001/12/19 06:11:45 1.47
@@ -78,6 +78,7 @@
+#include "XalanQName.hpp"
#include "XPathEnvSupport.hpp"
#include "XPathExecutionContext.hpp"
#include "XPathParserException.hpp"
@@ -389,7 +390,7 @@
case XalanUnicode::charColon:
{
- if(posOfNSSep == i - 1)
+ if(posOfNSSep == i - 1 && i > 0)
{
if(startSubstring != -1)
{
@@ -603,8 +604,12 @@
const XalanDOMString prefix =
substring(pat, startSubstring, posOfNSSep);
- assert(length(prefix) != 0);
+ if (XalanQName::isValidNCName(prefix) == false)
+ {
+ error(XalanDOMString("'") + prefix + XalanDOMString("' is not a
valid NCName"));
+ }
+
const XalanDOMString* const uName =
m_prefixResolver->getNamespaceForPrefix(prefix);
@@ -630,7 +635,11 @@
const XalanDOMString s = substring(pat, posOfNSSep + 1,
posOfScan);
- if(length(s) > 0)
+ if(XalanQName::isValidNCName(s) == false)
+ {
+ error(XalanDOMString("'") + s + XalanDOMString("' is
not a valid NCName"));
+ }
+ else
{
addToTokenQueue(s);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]