Skip to content

gh-111178: fix UBSan failures in Modules/_lzmamodule.c - #129783

Merged
encukou merged 5 commits into
python:mainfrom
picnixz:fix/ubsan/lzma-111178
Feb 18, 2025
Merged

gh-111178: fix UBSan failures in Modules/_lzmamodule.c#129783
encukou merged 5 commits into
python:mainfrom
picnixz:fix/ubsan/lzma-111178

Conversation

@picnixz

@picnixzpicnixz commented Feb 7, 2025

Copy link
Copy Markdown
Member

This PR fixes the UBSan failures and addresses some minor cosmetic changes. PEP-7 changes were not applied since they could scramble the diff but other semantic changes affecting the signature of touched functions may have been done.

@picnixz

Copy link
Copy Markdown
MemberAuthor

Ah I'm sorry I put this one as ready for review but I learned that _ + capital letter was also UB (#128248 (comment)) so I'll fix them tomorrow.

@picnixz
picnixz marked this pull request as draft February 7, 2025 18:33
@picnixz
picnixz marked this pull request as ready for review February 8, 2025 09:27
Comment threadModules/_lzmamodule.c
}
PyTypeObject *tp = Py_TYPE(self);
tp->tp_free((PyObject *)self);
tp->tp_free(self);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be op?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tp_free takes a void * as input, so it doesn't matter. I've chosen the one that reduces the diff (but honestly, I don't know whether I've always been consistent)

@encukou
encukou merged commit 185ac5a into python:mainFeb 18, 2025
@picnixz
picnixz deleted the fix/ubsan/lzma-111178 branch February 21, 2025 12:36
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@picnixz@encukou