Bug 324723: Make nsPropertyTable resistent against using the wrong base pointer by enforcing type safety. r/sr=jst

This commit is contained in:
cvshook@sicking.cc
2006-01-26 23:40:49 +00:00
parent 88dffaea7c
commit 9c8dbaf863
5 changed files with 48 additions and 34 deletions

View File

@@ -867,8 +867,7 @@ nsGenericElement::~nsGenericElement()
if (document) {
document->CallUserDataHandler(nsIDOMUserDataHandler::NODE_DELETED,
this, nsnull, nsnull);
document->PropertyTable()->
DeleteAllPropertiesFor(NS_STATIC_CAST(nsINode*, this));
document->PropertyTable()->DeleteAllPropertiesFor(this);
}
}
@@ -1927,8 +1926,7 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
ownerDocument->CopyUserData(this, aDocument);
// Remove all properties.
ownerDocument->PropertyTable()->
DeleteAllPropertiesFor(NS_STATIC_CAST(nsINode*, this));
ownerDocument->PropertyTable()->DeleteAllPropertiesFor(this);
}
// get a new nodeinfo