Title: gh-144475: Fix a heap buffer overflow in partial_repr by brijkapadia · Pull Request #145362 · python/cpython · GitHub
Open Graph Title: gh-144475: Fix a heap buffer overflow in partial_repr by brijkapadia · Pull Request #145362 · python/cpython
X Title: gh-144475: Fix a heap buffer overflow in partial_repr by brijkapadia · Pull Request #145362 · python/cpython
Description: This is a cleaner version of PR #144571. I am not exactly sure what happened in #144571 so I would appreciate if anyone could tell me so I don't make the same mistake again. Here are the changes I made: I added an args and kw local pointer so that both live long enough during the call to repr to prevent a segfault I added an fn local pointer so that repr uses its original state when generating its final representation. I got rid of the error goto and merged it with the done goto as I needed to decrement the reference count of fn, args, and kw, and I found that decrementing them in the done goto was the easiest. I added a test based on @Qanux's original code. I extended it to also check for changes in the fn and kw arguments. Issue: gh-144475
Open Graph Description: This is a cleaner version of PR #144571. I am not exactly sure what happened in #144571 so I would appreciate if anyone could tell me so I don't make the same mistake again. Here are the change...
X Description: This is a cleaner version of PR #144571. I am not exactly sure what happened in #144571 so I would appreciate if anyone could tell me so I don't make the same mistake again. Here are the ch...
Opengraph URL: https://github.com/python/cpython/pull/145362
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:af6f70c9-3388-349e-dbc9-6f558a5573bf |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CD7A:47EDE:4D0E75E:6C9B1E1:6A500FAC |
| html-safe-nonce | ccc2c79f69a095ba6692d2c0d46a438655f12cf5b205403b86ad5650a407eeb0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDdBOjQ3RURFOjREMEU3NUU6NkM5QjFFMTo2QTUwMEZBQyIsInZpc2l0b3JfaWQiOiI2NDc2NjE0NjIzMTg5NTM2Njg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 838f526dce22f903b8db3b15d74e8c8b495cb4ba1c7356b718e66ac5820c6cc0 |
| hovercard-subject-tag | pull_request:3338984462 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/145362/files |
| twitter:image | https://avatars.githubusercontent.com/u/97006829?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/97006829?s=400&v=4 |
| og:image:alt | This is a cleaner version of PR #144571. I am not exactly sure what happened in #144571 so I would appreciate if anyone could tell me so I don't make the same mistake again. Here are the change... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | fe4f38b24922a1ce81c1708c3793b47c185599b9144ab94f6ca846b00698058d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42b6390c91978a16f9196c38c7a00e9bf21f37e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width