View Single Post
11-25-15, 02:48 AM   #9
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by MunkDev View Post
It's possible because handle:GetChildren() will still return unprotected frames in the secure environment when you're not in combat. Since they are unprotected, they can very well be tainted. It's kind of a trojan horse in the secure environment.
Any frame created by an addon that isn't secure is, by definition, tainted, so unless bagnon is the only thing you're running with a child of UIParent something else would also trigger it.

Here's an example that outputs all unprotected children of UIParent when you mouse over a unit. If you're in combat, GetChildren() will simply not include those frames, it doesn't freak out about a tainted execution path.
Lua Code:
  1. local f = CreateFrame('frame', nil, UIParent, 'SecureHandlerStateTemplate')
  2. f:SetAttribute('_onstate-mousestate', [[
  3.     if newstate == 'on' then
  4.         for i, f in pairs(newtable(self:GetParent():GetChildren())) do
  5.             if not f:IsProtected() and f:GetName() then
  6.                 print(f:GetName())
  7.             end
  8.         end
  9.     end
  10. ]])
  11. RegisterStateDriver(f, 'mousestate', '[@mouseover,exists] on; off')
  Reply With Quote