Repository navigation
Conversation
| Py_ssize_t b_len = PyBytes_GET_SIZE(*bytes); | ||
| if (unitsize * logical_length >= b_len - to_add * unitsize) { | ||
| // There's not enough room. Double it. | ||
| if (b_len > PY_SSIZE_T_MAX / 2) { |
There was a problem hiding this comment.
This has the same issue as the backport.
We want to be able to index all code object structures with an int, so you'll need INT_MAX instead of PY_SSIZE_T_MAX and it should be an overflow error, not a memory error.
There was a problem hiding this comment.
To clarify, we want a_bytecode to be able to have INT_MAX code units, not just INT_MAX bytes, right?
There was a problem hiding this comment.
We probably want the smaller amount to avoid risk of overflow. So the length in bytes should be less than INT_MAX.
|
Is the PR still relevant or some other PR superseded this one? For merge conflict resolution: touched functions were moved to cc @iritkatriel |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 90 days with no activity. |
|
Rebase review found this PR unportable: the assembler has since moved from compile.c to assemble.c and was rewritten around PyBytesWriter, so this 2022 hardening no longer applies; its issue gh-93964 is already closed. Closing to cull the number of open pull requests. If the hardening is still wanted, please open a new PR against the current assembler rather than reopening this one. |
#93964
The issue was found in 3.10, so it will need to be manually backported there.