Fix mutable arguments passed as default arguments.#101
Fix mutable arguments passed as default arguments.#101roberthdevries wants to merge 2 commits intowolfSSL:masterfrom
Conversation
ee90b05 to
786dd94
Compare
|
One test case |
JeremiahM37
left a comment
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: REQUEST_CHANGES
Findings: 2 total — 2 posted, 0 skipped
2 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [Critical] Use-after-free: EccPrivate.make_key stores dangling RNG pointer when rng=None —
wolfcrypt/ciphers.py:1192-1207 - [Medium] Test does not cover the default rng=None path for EccPrivate.make_key —
tests/test_ciphers.py:616-629
Review generated by Skoll
dgarske
left a comment
There was a problem hiding this comment.
🐺 Skoll Code Review
Overall recommendation: REQUEST_CHANGES
Findings: 2 total — 2 posted, 0 skipped
Posted findings
- [High] EccPrivate.make_key: locally-created RNG freed while ECC key still holds pointer via wc_ecc_set_rng —
wolfcrypt/ciphers.py:1188-1207 - [Medium] No test exercises the default rng=None path for successful EccPrivate.make_key —
tests/test_ciphers.py:616-629
Review generated by Skoll via openclaw
|
@roberthdevries please also resolve conflicts. Thanks |
4f284ed to
a6e9470
Compare
|
Conflicts are resolved. |
8066987 to
6a67909
Compare
Function defaults are evaluated once, when the function is defined. The same mutable object is then shared across all calls to the function. If the object is modified, those modifications will persist across calls, which can lead to unexpected behavior.
Add a test for the case where no random number generator is passed to EccPrivate.
6a67909 to
b4ddce1
Compare
Function defaults are evaluated once, when the function is defined.
The same mutable object is then shared across all calls to the function. If the object is modified, those modifications will persist across calls, which can lead to unexpected behavior.