mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
17 lines
447 B
Plaintext
17 lines
447 B
Plaintext
/**
|
|
* @name Comparison with zero
|
|
* @description Finds comparisons between an unsigned value and zero.
|
|
* @id go/examples/unsignedgez
|
|
* @tags comparison
|
|
* unsigned
|
|
*/
|
|
|
|
import go
|
|
|
|
from DataFlow::RelationalComparisonNode cmp, DataFlow::Node unsigned, DataFlow::Node zero
|
|
where
|
|
zero.getNumericValue() = 0 and
|
|
unsigned.getType().getUnderlyingType() instanceof UnsignedIntegerType and
|
|
cmp.leq(_, zero, unsigned, 0)
|
|
select cmp, unsigned
|