Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
CurrentCVS, 1.11
-
None
-
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;
}