CodeQL library for Go
codeql/go-all 5.0.3 (changelog, source)
Search

Module ConversionWithoutBoundsCheckConfig

Import path

import semmle.go.security.IncorrectIntegerConversionLib

Predicates

getASelectedSinkLocation

Gets a location that will be associated with the given sink in a diff-informed query that uses this configuration (see observeDiffInformedIncrementalMode). By default, this is the location of the sink itself, but this predicate should include any locations that are reported as the primary-location of the query or as an additional location (“$@” interpolation). Queries with @kind path-problem that override this predicate should also return the location of the sink itself. For a query that doesn’t report the sink at all, this predicate should be none().

isAdditionalFlowStep

Holds if data may flow from node1 to node2 in addition to the normal data-flow steps. This step is only applicable in state1 and updates the flow state to state2.

isBarrier

Holds if data flow through node is prohibited when the flow state is state.

isSink

Holds if sink is a relevant data flow sink accepting state.

isSink2

Holds if sink is a typecast to an integer type with size bitSize (where 0 represents architecture-dependent) and the expression being typecast is not also in a right-shift expression. We allow this case because it is a common pattern to serialise byte(v), byte(v >> 8), and so on.

isSource

Holds if source is a relevant data flow source with the given initial state.

observeDiffInformedIncrementalMode

Holds if sources and sinks should be filtered to only include those that may lead to a flow path with either a source or a sink in the location range given by AlertFiltering. This only has an effect when running in diff-informed incremental mode.