Title: [3.13] gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) by miss-islington · Pull Request #148405 · python/cpython · GitHub
Open Graph Title: [3.13] gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) by miss-islington · Pull Request #148405 · python/cpython
X Title: [3.13] gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) by miss-islington · Pull Request #148405 · python/cpython
Description: When a custom iterator calls next() on the same csv.reader from within next, the inner iteration sets self->fields to NULL. The outer iteration then crashes in parse_save_field() by passing NULL to PyList_Append. Add a guard after PyIter_Next() to detect that fields was set to NULL by a re-entrant call, and raise csv.Error instead of crashing. (cherry picked from commit 20994b1) Co-authored-by: Ramin Farajpour Cami ramin.blackhat@gmail.com Issue: gh-145105
Open Graph Description: When a custom iterator calls next() on the same csv.reader from within next, the inner iteration sets self->fields to NULL. The outer iteration then crashes in parse_save_field() by passing NULL...
X Description: When a custom iterator calls next() on the same csv.reader from within next, the inner iteration sets self->fields to NULL. The outer iteration then crashes in parse_save_field() by passing ...
Opengraph URL: https://github.com/python/cpython/pull/148405
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:77c52486-3e77-4967-9125-437c7cdfb654 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BD10:CC9D1:2BEE33:3FE6B9:6A6201F0 |
| html-safe-nonce | 3b69209c1ed60c6de00e0bb949d782668f40af8d14dd1b40a3b954a3c0df6f01 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDEwOkNDOUQxOjJCRUUzMzozRkU2Qjk6NkE2MjAxRjAiLCJ2aXNpdG9yX2lkIjoiNjY2NDYwMzg1MDI2NjM4MzIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6881941cf79e7422c2dffbf3c6930c983f8a6eec99680589d1a513e172e8b4e4 |
| hovercard-subject-tag | pull_request:3518330905 |
| 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/148405/files |
| twitter:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| og:image:alt | When a custom iterator calls next() on the same csv.reader from within next, the inner iteration sets self->fields to NULL. The outer iteration then crashes in parse_save_field() by passing NULL... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92eeba52656842b5eb8a3f62fd6465e80107329999099c7144d43d7476b38ad0 |
| 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 | 14dbe1e269fc16133b0b2bbc058e3a259cd85df4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width