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

XSValue::getActValStrings translates dt_boolean wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.0
    • None
    • None
    • None
    • Windows XP Professional

    Description

      In the lines (marked with BUG) where retVal->fData.fValue.f_bool is assigned a boolean value, the wrong value is assigned.

      XMLUni::fgBooleanValueSpace[0] and XMLUni::fgBooleanValueSpace[2] contain the values for false.
      XMLUni::fgBooleanValueSpace[1] and XMLUni::fgBooleanValueSpace[3] contain the values for true.

      Does anybody actually use this code?

      XSValue*
      XSValue::getActValStrings(const XMLCh* const content
      , DataType datatype
      , Status& status
      , XMLVersion version
      , bool toValidate
      , MemoryManager* const manager)
      {
      try
      {
      switch (datatype)
      {
      case XSValue::dt_boolean:
      {
      //do validation here more efficiently
      if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[0]) ||
      XMLString::equals(content, XMLUni::fgBooleanValueSpace[2]) )

      { XSValue* retVal = new (manager) XSValue(dt_boolean, manager); BUG retVal->fData.fValue.f_bool = true; return retVal; }

      else if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[1]) ||
      XMLString::equals(content, XMLUni::fgBooleanValueSpace[3]) )

      { XSValue* retVal = new (manager) XSValue(dt_boolean, manager); BUG retVal->fData.fValue.f_bool = false; return retVal; }

      else

      { status = st_FOCA0002; return 0; }

      }
      break;

      Attachments

        Activity

          People

            Unassigned Unassigned
            pfrants Patrick Frants
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: