Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-742

XalanVector assignment operator crash bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • CurrentCVS, 1.11
    • None
    • XalanC
    • None
    • Tested on Windows 7, MSVC 2010

    Description

      When assigning an empty XalanVector to another, a NULL dereference and crash results. Specifically, the std::copy() statement copies to this->begin(), which returns NULL when the vector is empty.

      Here is simple demo code:

      #include <xercesc/util/PlatformUtils.hpp>
      #include <xalanc/Include/XalanVector.hpp>

      using namespace xercesc;
      using namespace xalanc;

      int main(int argc, char* argv[])
      {
      XMLPlatformUtils::Initialize();

      XalanVector<int> vec1;
      XalanVector<int> vec2(XalanMemMgrs::getDefaultXercesMemMgr(), 5);

      vec1 = vec2;

      XMLPlatformUtils::Terminate();

      return 0;
      }

      Attachments

        Activity

          People

            shathaway Steven J. Hathaway
            chisholm Michael Chisholm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: