Fix secret-string taint error on aura sourceUnit compare#39
Open
hausec wants to merge 1 commit into
Open
Conversation
In Midnight/Retail, auraData.sourceUnit can be returned as a "secret" (tainted) string. Comparing it with == directly throws: attempt to compare local 'sourceUnit' (a secret string value tainted...) The error fires from the blizzard-cooldowns path inside AuraButtonOnShow when an aura from a non-player source shows up on the player buff frame. Fix: prefer the boolean isFromPlayerOrPlayerPet field from auraData, and fall back to the existing sourceUnit compare only after TPerl_CanAccess confirms the value is not secret. Existing Classic/UnitAura path is unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a runtime Lua error on Retail (Midnight secure-aura API) when a non-player aura passes through the blizzard-cooldowns path in
AuraButtonOnShow:auraData.sourceUnitfromC_UnitAuras.GetAuraDataByIndexis sometimes returned as a "secret" (tainted) string that throws when compared directly with==. The error can fire hundreds of times per second while any such aura is visible.Change
In
TPerl/TPerl.luaAuraButtonOnShow:isFromPlayerOrPlayerPetfromauraData(the boolean replacement for the== "player"heuristic).isPlayerSourcesafely: preferisFromPlayerOrPlayerPetwhen accessible; fall back to the oldsourceUnit == "player"compare only afterTPerl_CanAccess(sourceUnit)confirms the value isn't secret; default tofalseotherwise.TPerl_CooldownFrame_SetTimerin place of the raw compare.Net diff is 12 additions / 2 deletions, all inside one function. The classic
UnitAurapath is untouched.Test plan
isPlayerSourcestill resolves totrueviaisFromPlayerOrPlayerPet).UnitAurareturns a plain string forsourceUnitand takes the old comparison branch.