Skip to content

Commit f634c62

Browse files
committed
remove redundant check
1 parent 1124816 commit f634c62

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

javascript/ql/src/Security/CWE-327/BadRandomness.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ private DataFlow::Node goodRandom(DataFlow::TypeTracker t, DataFlow::SourceNode
117117
not exists(BinaryExpr binop | binop = result.asExpr() |
118118
binop.getOperator().regexpMatch(".*(<|>).*")
119119
or
120-
binop.getOperator() = "*" and
121-
(
122-
isPowerOfTwo().asExpr() = binop.getAnOperand() or
123-
binop.getAnOperand().(NumberLiteral).getValue().regexpMatch("0x0*10*")
124-
)
120+
binop.getOperator() = "*" and isPowerOfTwo().asExpr() = binop.getAnOperand()
125121
or
126122
binop.getOperator() = "+" and exists(binop.getAnOperand().getStringValue()) // string concat does not produce a number
127123
)

0 commit comments

Comments
 (0)