Commit 13528e5
authored
fix: incorrect conversion between integer types (#467)
To fix the problem, we need to ensure that the value parsed by strconv.ParseUint does not exceed the maximum value that an int can hold before converting it. We can achieve this by adding a bounds check before the conversion. If the value exceeds the maximum value of an int, we should handle it appropriately, such as by setting a default value or returning an error.
Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>1 parent 635ddb1 commit 13528e5
1 file changed
+7
-2
lines changedLines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
0 commit comments