bug 1185726 - avoid killing the child process when it sends the parent events with bad IDs r=lsocks

This commit is contained in:
Trevor Saunders 2015-07-21 11:21:53 -04:00
parent c38a7a94b3
commit 0e01d47b97

View File

@ -30,13 +30,13 @@ DocAccessibleParent::RecvShowEvent(const ShowEventData& aData)
// required show events. // required show events.
if (!parent) { if (!parent) {
NS_ERROR("adding child to unknown accessible"); NS_ERROR("adding child to unknown accessible");
return false; return true;
} }
uint32_t newChildIdx = aData.Idx(); uint32_t newChildIdx = aData.Idx();
if (newChildIdx > parent->ChildrenCount()) { if (newChildIdx > parent->ChildrenCount()) {
NS_ERROR("invalid index to add child at"); NS_ERROR("invalid index to add child at");
return false; return true;
} }
uint32_t consumed = AddSubtree(parent, aData.NewTree(), 0, newChildIdx); uint32_t consumed = AddSubtree(parent, aData.NewTree(), 0, newChildIdx);
@ -48,7 +48,7 @@ DocAccessibleParent::RecvShowEvent(const ShowEventData& aData)
} }
#endif #endif
return consumed != 0; return true;
} }
uint32_t uint32_t
@ -140,8 +140,10 @@ DocAccessibleParent::RecvStateChangeEvent(const uint64_t& aID,
const bool& aEnabled) const bool& aEnabled)
{ {
ProxyAccessible* target = GetAccessible(aID); ProxyAccessible* target = GetAccessible(aID);
if (!target) if (!target) {
return false; NS_ERROR("we don't know about the target of a state change event!");
return true;
}
ProxyStateChangeEvent(target, aState, aEnabled); ProxyStateChangeEvent(target, aState, aEnabled);
return true; return true;
@ -151,8 +153,10 @@ bool
DocAccessibleParent::RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset) DocAccessibleParent::RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
{ {
ProxyAccessible* proxy = GetAccessible(aID); ProxyAccessible* proxy = GetAccessible(aID);
if (!proxy) if (!proxy) {
return false; NS_ERROR("unknown caret move event target!");
return true;
}
ProxyCaretMoveEvent(proxy, aOffset); ProxyCaretMoveEvent(proxy, aOffset);
return true; return true;
@ -167,8 +171,10 @@ DocAccessibleParent::RecvTextChangeEvent(const uint64_t& aID,
const bool& aFromUser) const bool& aFromUser)
{ {
ProxyAccessible* target = GetAccessible(aID); ProxyAccessible* target = GetAccessible(aID);
if (!target) if (!target) {
return false; NS_ERROR("text change event target is unknown!");
return true;
}
ProxyTextChangeEvent(target, aStr, aStart, aLen, aIsInsert, aFromUser); ProxyTextChangeEvent(target, aStr, aStart, aLen, aIsInsert, aFromUser);