Title: bpo-40958: Avoid buffer overflow in the parser when indexing the current line by pablogsal · Pull Request #20875 · python/cpython · GitHub
Open Graph Title: bpo-40958: Avoid buffer overflow in the parser when indexing the current line by pablogsal · Pull Request #20875 · python/cpython
X Title: bpo-40958: Avoid buffer overflow in the parser when indexing the current line by pablogsal · Pull Request #20875 · python/cpython
Description: After thinking a bit more about the whole problem I found that we were processing the offsets incorrectly if the input is raw (no need to transform the offset to a character offset). Once we process the column offsets correctly, is quite straightforward to fix the incorrect access.
As an example of why we were processing the offset incorrectly previously, consider this code (current master without this PR):
❯ ./python
Python 3.9.0b1+ (heads/3.9:299d3d1c52, Jun 8 2020, 22:11:46)
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> Python = "Ṕýţĥòñ" + 34 $ lelummsmdsads +
File "
Open Graph Description: After thinking a bit more about the whole problem I found that we were processing the offsets incorrectly if the input is raw (no need to transform the offset to a character offset). Once we proces...
X Description: After thinking a bit more about the whole problem I found that we were processing the offsets incorrectly if the input is raw (no need to transform the offset to a character offset). Once we proces...
Opengraph URL: https://github.com/python/cpython/pull/20875
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:3e1a89cc-c2ce-7a6f-d593-ebc0965075f3 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 93EC:1FFDC1:1347672:1AE04B4:696A3528 |
| html-safe-nonce | 31784d591c14a7b9cd9b2cee02b6000050938fe8dd31887de57fabf7b22f4491 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0VDOjFGRkRDMToxMzQ3NjcyOjFBRTA0QjQ6Njk2QTM1MjgiLCJ2aXNpdG9yX2lkIjoiNDIwNTA5NjI5NjgwNTcwOTA5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 104bb8a3f2448d2685147e0b3e38f27c761dba05d9ec7f6c7f513b03ea720874 |
| hovercard-subject-tag | pull_request:434227332 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/20875/checks |
| twitter:image | https://avatars.githubusercontent.com/u/11718525?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/11718525?s=400&v=4 |
| og:image:alt | After thinking a bit more about the whole problem I found that we were processing the offsets incorrectly if the input is raw (no need to transform the offset to a character offset). Once we proces... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| turbo-cache-control | no-preview |
| 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 full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width