Skip to content

Commit bb895ff

Browse files
myterongkunz
andauthored
Apply suggestions from code review
Typos fixed Co-authored-by: Georg Kunz <[email protected]> Signed-off-by: myteron <[email protected]>
1 parent 549948a commit bb895ff

File tree

1 file changed

+4
-4
lines changed
  • docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-191

1 file changed

+4
-4
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-191/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Ensure that integer overflow is properly handled in order to avoid unexpected be
88

99
## Non-Compliant Code Example
1010

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`.
1212

1313
*[noncompliant01.py](noncompliant01.py):*
1414

@@ -24,12 +24,12 @@ b = numpy.int64(numpy.iinfo(numpy.int64).max + 1) # OverflowError and stops
2424
print(b) # we will never reach this
2525
```
2626

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.
2828

2929
An attempt to create `int` from a too big number causes an `OverflowError` and stops.
3030

3131
> [!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.`
3333
3434
## Compliant Solution
3535

@@ -87,7 +87,7 @@ print(get_time_in_future(23**74))
8787

8888
## Compliant Solution
8989

90-
This `compliant02.py` solution handles `OverflowError` Exception when a to high value is given to `get_time_in_future`.
90+
This `compliant02.py` solution handles `OverflowError` Exception when a too large value is given to `get_time_in_future`.
9191

9292
*[compliant02.py](compliant02.py):*
9393

0 commit comments

Comments
 (0)