Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1248

AttrNS/ElementNS setPrefix(empyString)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.6.0
    • Component/s: DOM
    • Labels:
      None

      Description

      passing an emptyString "" (not a null pointer) to the DOMAttrNSImpl::setPrefix(prefix) throws an INVALID_CHARACTER_ERR in isXMLName(prefix) before the code is executed that handles the special case for null pointer and emptystring.

      the isXMLName(prefix) check should be performed after the special case handling to verify that the prefix isn't empty:

      DOMAttrNSImpl.cpp around line 130:

      if (prefix == 0 || prefix[0] == chNull)

      { fName = fLocalName; fPrefix = 0; return; }

      if (!((DOMDocumentImpl *)this->getOwnerDocument())->isXMLName(prefix))
      throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, GetDOMNodeMemoryManager);

      same problem appears in DOMElementNSImpl::setPrefix(prefix)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ts@edvwl.de Tobias Schuette
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: