mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
Fix UnicodeDoS vulnerability in CWE-770 code
This commit is contained in:
@@ -61,15 +61,15 @@ predicate underAValue(DataFlow::GuardNode g, ControlFlowNode node, boolean branc
|
||||
branch = true and
|
||||
cn.operands(_, op_gt, n.asCfgNode())
|
||||
or
|
||||
// not arg <= LIMIT OR not arg < LIMIT
|
||||
(op_lt = any(LtE lte) or op_lt = any(Lt lt)) and
|
||||
branch = false and
|
||||
cn.operands(n.asCfgNode(), op_lt, _)
|
||||
or
|
||||
// not LIMIT >= arg OR not LIMIT > arg
|
||||
// not arg >= LIMIT OR not arg > LIMIT
|
||||
(op_gt = any(GtE gte) or op_gt = any(Gt gt)) and
|
||||
branch = false and
|
||||
cn.operands(_, op_gt, n.asCfgNode())
|
||||
cn.operands(n.asCfgNode(), op_gt, _)
|
||||
or
|
||||
// not LIMIT <= arg OR not LIMIT < arg
|
||||
(op_lt = any(LtE lte) or op_lt = any(Lt lt)) and
|
||||
branch = false and
|
||||
cn.operands(_, op_lt, n.asCfgNode())
|
||||
)
|
||||
|
|
||||
lenCall = API::builtin("len").getACall() and
|
||||
|
||||
Reference in New Issue
Block a user