-
Notifications
You must be signed in to change notification settings - Fork 37
/
parseint-downcast.yml
31 lines (31 loc) · 1.15 KB
/
parseint-downcast.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
rules:
- id: parseint-downcast
patterns:
- pattern-either:
- pattern: |
$X, ... = strconv.ParseInt(..., ..., 64)
...
int32($X)
- pattern: |
$X, ... = strconv.ParseInt(..., ..., 64)
...
uint32($X)
- pattern: |
$X, ... = strconv.ParseUint(..., ..., 64)
...
int32($X)
- pattern: |
$X, ... = strconv.ParseUint(..., ..., 64)
...
uint32($X)
- pattern: |
$X = strconv.Atoi(...)
...
int32($X)
- pattern: |
$X = strconv.Atoi(...)
...
uint32($X)
message: "64-bit integer parsed and downcast to u/int32"
languages: [go]
severity: ERROR