Skip to content

do not crash on __delitem__#235

Merged
mattip merged 1 commit into
python-cffi:mainfrom
mildsunrise:delitem-check
Apr 24, 2026
Merged

do not crash on __delitem__#235
mattip merged 1 commit into
python-cffi:mainfrom
mildsunrise:delitem-check

Conversation

@mildsunrise
Copy link
Copy Markdown
Contributor

@mildsunrise mildsunrise commented Mar 20, 2026

what it says on the tin: we're forgetting to check for deletions in many cases, so it's easy to crash the python process by doing del pointer[slice] or del buffer[anything]

@mattip
Copy link
Copy Markdown
Contributor

mattip commented Mar 20, 2026

Please add a test that fails before, passes after

@mildsunrise
Copy link
Copy Markdown
Contributor Author

mildsunrise commented Mar 28, 2026

done. i don't think it's possible to test in a way that fails instead of invoking UB... in this case i think it's mostly guaranteed to be a crash though

@mildsunrise
Copy link
Copy Markdown
Contributor Author

hello?

@mattip mattip enabled auto-merge (squash) April 24, 2026 10:10
@mattip
Copy link
Copy Markdown
Contributor

mattip commented Apr 24, 2026

Thanks @mildsunrise

@mattip mattip disabled auto-merge April 24, 2026 10:11
@mattip mattip enabled auto-merge (rebase) April 24, 2026 10:11
@mattip mattip disabled auto-merge April 24, 2026 10:13
@mattip mattip merged commit c5212d0 into python-cffi:main Apr 24, 2026
35 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants