You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/05/07 13:50:34 UTC

DO NOT REPLY [Bug 8863] New: - DocumentImpl::setUserData has invalid handling

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8863>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8863

DocumentImpl::setUserData has invalid handling

           Summary: DocumentImpl::setUserData has invalid handling
           Product: Xerces-C++
           Version: 1.7.0
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: rainer.prosi@de.heidelberg.com


DocumentImpl::setUserData throws an exception when called with data=0 and 
userData=0:

	if (!userData && data)
		userData = new RefHashTableOf<void>(29, false, new HashPtr());
	if (!data && userData)
		userData->removeKey((void*)n);
	else // this is called if data=0 and userData=0
		userData->put((void*)n,data);

fix:
	if (!userData && data)
		userData = new RefHashTableOf<void>(29, false, new HashPtr());

	if (userData) // only modify if userData exists
	{
		if(!data)
			userData->removeKey((void*)n);
		else
			userData->put((void*)n,data);
	}

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org