Skip to content

Commit 2b7394c

Browse files
authored
Merge pull request #16305 from github/go/value-flow-instead-of-taint-flow
Go: Use value flow instead of taint flow for `go/incorrect-integer-conversion`
2 parents 499c4df + 410543f commit 2b7394c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

go/ql/lib/semmle/go/security/IncorrectIntegerConversionLib.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ private module ConversionWithoutBoundsCheckConfig implements DataFlow::StateConf
572572
* Tracks taint flow from an integer obtained from parsing a string that flows
573573
* to a type conversion to a smaller integer type, which could cause data loss.
574574
*/
575-
module Flow = TaintTracking::GlobalWithState<ConversionWithoutBoundsCheckConfig>;
575+
module Flow = DataFlow::GlobalWithState<ConversionWithoutBoundsCheckConfig>;
576576

577577
/** Gets a string describing the size of the integer parsed. */
578578
deprecated string describeBitSize(int bitSize, int intTypeBitSize) {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The query `go/incorrect-integer-conversion` has now been restricted to only use flow through value-preserving steps. This reduces false positives, especially around type switches.

0 commit comments

Comments
 (0)