Commit 1c5df82
gh-156939: Fix struct.pack('0p', bytes) (GH-157071)
If the Pascal string is empty (size=0), do not write the size prefix.
Previously, a NUL byte was written outsize the buffer (buffer
overflow). In practice, the write remains into allocated memory
and is silently ignored: no memory is corrupted.
(cherry picked from commit 23525c9)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 88f6017 commit 1c5df82
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2020 | 2020 | | |
2021 | 2021 | | |
2022 | 2022 | | |
2023 | | - | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
2024 | 2026 | | |
2025 | 2027 | | |
2026 | 2028 | | |
| |||
0 commit comments