You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-191/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Ensure that integer overflow is properly handled in order to avoid unexpected be
8
8
9
9
## Non-Compliant Code Example
10
10
11
-
Using a `numpy.int64` can cause an unintentional flip of its sign when reaching the maximum number that can be store as demonstrated in `noncompliant01.py`.
11
+
Using a `numpy.int64` can cause an unintentional flip of its sign when reaching the maximum number that can be stored as demonstrated in `noncompliant01.py`.
12
12
13
13
*[noncompliant01.py](noncompliant01.py):*
14
14
@@ -24,12 +24,12 @@ b = numpy.int64(numpy.iinfo(numpy.int64).max + 1) # OverflowError and stops
24
24
print(b) # we will never reach this
25
25
```
26
26
27
-
Adding `+1` to `9223372036854775807` results in a negative number `-9223372036854775808` throws a `RuntimeWarning` but continues.
27
+
Adding `+1` to `9223372036854775807` results in a negative number `-9223372036854775808`and throws a `RuntimeWarning` but continues.
28
28
29
29
An attempt to create `int` from a too big number causes an `OverflowError` and stops.
30
30
31
31
> [!NOTE]
32
-
> It has been observed that different result may occur depending on `numpy` version for reference we are using `numpy 1.23.1` and Python version:`3.9.12.`
32
+
> It has been observed that different results may occur depending on the version of `numpy`. For reference, we are using `numpy 1.23.1` and Python `3.9.12.`
0 commit comments