Skip to content
Snippets Groups Projects
Commit c8632256 authored by PeiYong Zhang's avatar PeiYong Zhang
Browse files

Bug# 10482: XMLUri crashes with empty fragment.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@173949 13f79535-47bb-0310-9956-ffa450edef68
parent e58ed725
No related branches found
No related tags found
No related merge requests found
......@@ -794,13 +794,25 @@ void XMLUri::initializePath(const XMLCh* const uriSpec)
}
if (getFragment())
{
delete [] fFragment;
}
fFragment = new XMLCh[index - start + 1];
XMLString::subString(fFragment, uriSpec, start, index);
//make sure that there is something following the '#'
if (index > start)
{
fFragment = new XMLCh[index - start + 1];
XMLString::subString(fFragment, uriSpec, start, index);
}
else
{
// RFC 2396, 4.0. URI Reference
// URI-reference = [absoulteURI | relativeURI] [# fragment]
//
// RFC 2396, 4.1. Fragment Identifier
// fragment = *uric
//
// empty fragment is valid
fFragment = 0;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment