Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144475: Fix a heap buffer overflow in partial_repr#144571

Closed
bkap123 wants to merge 231 commits intopython:mainfrom
bkap123:fix-functools_partial_repr_bug
Closed

gh-144475: Fix a heap buffer overflow in partial_repr#144571
bkap123 wants to merge 231 commits intopython:mainfrom
bkap123:fix-functools_partial_repr_bug

Conversation

@bkap123
Copy link
Contributor

@bkap123bkap123 commentedFeb 7, 2026
edited by bedevere-appbot
Loading

@python-cla-bot
Copy link

python-cla-botbot commentedFeb 7, 2026
edited
Loading

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@picnixz
Copy link
Member

picnixz commentedFeb 7, 2026
edited
Loading

Please:

  • add regression tests and check that the test failed before your change
  • remove blank lines in NEWS

@picnixz
Copy link
Member

picnixz commentedFeb 7, 2026
edited
Loading

By the way,@dr-carlos already suggested to open a PR. It is polite to ask them if they want to contribute themselves. As such, I'm going to close this one unless they are fine with you making the PR (we don't really want people "sniping" work of others)

dr-carlos reacted with heart emoji

@bkap123
Copy link
ContributorAuthor

Thanks for the feedback. I missed that@dr-carlos suggested to fix it.

I’m happy to close this PR if@dr-carlos is already working on it.

dr-carlos reacted with thumbs up emoji

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@dr-carlos
Copy link
Contributor

Thanks for the feedback. I missed that@dr-carlos suggested to fix it.

I’m happy to close this PR if@dr-carlos is already working on it.

Hi, thanks for asking!
I'm happy for you to continue with the PR :)

bkap123 reacted with thumbs up emoji

@bkap123
Copy link
ContributorAuthor

bkap123 commentedFeb 8, 2026
edited
Loading

Here are the changes I made:

  • I added akw local pointer, as a similar segfault happens for keywords
  • I added anfn local pointer so thatrepr uses its original state when generating its final representation.
  • I got rid of theerror goto and merged it with thedone goto as I needed to decrement the reference count offn,args, andkw, and I found that decrementing them in thedone goto was the easiest.
    Update: I changed the goto logic to reduce repetitive calls toPy_DECREF
  • I added a test based on@Qanux's original code in issueheap-buffer-overflow in functools.partial.__repr__() #144475. I extended it to also check for changes in thefn andkw arguments.

serhiy-storchakaand others added23 commitsFebruary 28, 2026 08:31
… Segment (pythonGH-145216)Remove the tp_clear slots and make Segment members read-only.Also add tests for reference loops involving GraphemeBreakIteratorand Segment.
…ions (pythonGH-144824)Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Remove PyThread_type_lock (now uses PyMutex internally).Add new benchmark options:- work_inside/work_outside: control work inside and outside the critical section to vary contention levels- num_locks: use multiple independent locks with threads assigned round-robin- total_iters: fixed iteration count per thread instead of time-based, useful for measuring fairness- num_acquisitions: lock acquisitions per loop iteration- random_locks: acquire random lock each iterationAlso return elapsed time from benchmark_locks() and switch lockbench.py to use argparse.
…h item (python#145282)Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>---------Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
@bkap123bkap123 deleted the fix-functools_partial_repr_bug branchFebruary 28, 2026 13:41
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@picnixzpicnixzpicnixz left review comments

+2 more reviewers

@caje731caje731caje731 left review comments

@dr-carlosdr-carlosdr-carlos left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

20 participants

@bkap123@picnixz@dr-carlos@caje731@serhiy-storchaka@StanFromIreland@yoney@vstinner@gpshead@akx@Sacul0457@nybblista@hugovk@dubek@lkollar@jmroot@adorilson@lysnikolaou@nedbat@kumaraditya303

[8]ページ先頭

©2009-2026 Movatter.jp