Simplify isBracketedForTagHelperAttribute per review feedback · github/codeql@befe578 · GitHub
Skip to content

Commit befe578

Browse files
committed
Simplify isBracketedForTagHelperAttribute per review feedback
Consolidate the two separate not-exists checks (]i,j[ and ]j,k[) into a single check over the whole open interval ]i,k[. Since no other Begin/EndWriteTagHelperAttribute call can share writeLiteral's own control flow node index j, checking the combined interval is equivalent to checking both sides separately, but simpler. Also bind BasicBlock bb once via writeLiteral.getBasicBlock() and reuse it, instead of calling it independently for each of i, j, and k. No behavior change: all CWE-079/XSS tests still pass.
1 parent 459b9ff commit befe578

1 file changed

Lines changed: 16 additions & 22 deletions

File tree

  • csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks

‎csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Html.qll‎

Lines changed: 16 additions & 22 deletions

0 commit comments

Comments
 (0)