Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1225

Access violation in CopyHelper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • C++-SCA-Next
    • None
    • C++ SDO
    • None
    • Win32, PHP

    Description

      Cloning a DataObject withe a property that has been explicitly set to null results in an AccessViolation:

      commonj::sdo::CopyHelper::internalCopy(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject>

      {...}, unsigned char 0x01) line 277 + 3 bytes
      commonj::sdo::CopyHelper::internalCopy(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject> {...}

      , unsigned char 0x01) line 403 + 41 bytes
      commonj::sdo::CopyHelper::copy(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject>

      {...}

      ) line 267 + 29 bytes
      sdo_do_clone_obj(_zval_struct * 0x0120c050, void * * * 0x003d2a20) line 208 + 33 bytes

      On the second entry to internalCopy(), the dataObject is null, which results in the AccessViolation when trying to get the DataFactory.

      Example:

      schema:
      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:ord="orderNS" xmlns:cust="customerNS" targetNamespace="orderNS">

      <include schemaLocation="./Customer.xsd"/>

      <element name="order" type="ord:OrderType">
      <complexType name="OrderType">
      <sequence>
      <element ref="cust:customer"/>
      </sequence>
      </complexType>
      </element>

      </schema>

      document:
      $customer_xsd = <<<EOF2
      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:cust="customerNS" targetNamespace="customerNS">
      <element name="customer" type="cust:CustomerType">
      <complexType name="CustomerType">
      <sequence>
      </sequence>
      </complexType>
      </element>

      </schema>

      logic:
      $xmldas = SDO_DAS_XML::create('Order.xsd');
      $order = $xmldas->createDataObject('orderNS','OrderType');
      $order->customer = null;
      $o = clone $order;

      If customer is unset, there is no problem. Or if it is set to a real data object there is no problem either.

      Attachments

        Activity

          People

            robbinspg Peter George Robbins
            cem Caroline Maynard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: