Skip to content

Commit 36c4f5d

Browse files
committed
Add failing test
The cause of the test failure is confusion about whether the architecture is 32 bit or 64 bit.
1 parent ffc36e4 commit 36c4f5d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
failures
21
testFailures
2+
| IncorrectIntegerConversion.go:497:15:497:15 | i | Unexpected result: hasValueFlow="i" |
3+
failures

go/ql/test/query-tests/Security/CWE-681/IncorrectIntegerConversion.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,3 +491,10 @@ func typeAssertion(s string) {
491491
}
492492

493493
}
494+
495+
func dealWithArchSizeCorrectly(s string) uint {
496+
if i, err := strconv.ParseUint(s, 10, 64); err == nil && i < math.MaxUint {
497+
return uint(i)
498+
}
499+
return 0
500+
}

0 commit comments

Comments
 (0)