René's URL Explorer Experiment


Title: Fix Windows runtime validation and 32-bit string size overflows by youknowone · Pull Request #9412 · RustPython/RustPython · GitHub

Open Graph Title: Fix Windows runtime validation and 32-bit string size overflows by youknowone · Pull Request #9412 · RustPython/RustPython

X Title: Fix Windows runtime validation and 32-bit string size overflows by youknowone · Pull Request #9412 · RustPython/RustPython

Description: Summary Follow up the Windows runtime fixes in #9406, without C API, ctypes, PyO3, dependency, or CI changes. Reject WSARecvFromInto requests larger than their writable buffer before starting I/O. Match CPython's spawnv argument TypeError while preserving embedded-NUL ValueError and other conversion exceptions. Check replacement, tab-expansion, and string-join result sizes before allocation. This fixes capacity-overflow panics and oversized-allocation aborts reproduced in an actual 32-bit Windows process. Fallible allocation is used for tab expansion and string join. Add Rust regression tests for length arithmetic, receive validation, and spawnv exceptions. Remove the now-passing Windows expected-failure markers; the redundant socket-test override is removed so the unchanged inherited test runs normally. Rebased onto upstream/main at 058bebf. Validation Windows x64: cargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi passed after rebase. Windows x64: workspace/all-targets Clippy with the same exclusions and -D warnings passed. Only the existing linker-messages warning remains (not governed by -D warnings). Separate crates/capi Clippy also passed. Actual i686-pc-windows-msvc interpreter: test_str test_bytes test_struct test_array test_os test_winapi test_subprocess passed (9 expanded test files; reported run=2,357, skipped=589). Windows x64 related regression modules passed, including asyncio low-level sockets, os, subprocess, winapi, msvcrt, signal, dbm, and interpreter-pool tests (10 expanded files). Existing skipped replacement-overflow tests were also invoked without their skip wrappers at runtime for str, bytes, and bytearray; all passed on x86. Their source skip decorators are unchanged. Formatting and all applicable pre-commit hooks passed; focused pre-commit review found no blockers. C API tests were attempted separately but remain blocked by missing-symbol link errors outside this PR; no C API fixes are included. The separately reproduced Windows subnormal math.remainder issue originates in the external pymath dependency and is also excluded. This PR does not claim that every Windows incompatibility is resolved. AI assistance Codex assisted with implementation, investigation, testing, review, and this PR description. Runtime checks were executed on Windows x64 and x86; no human review is claimed. Summary by CodeRabbit Bug Fixes Oversized receive requests are rejected before I/O begins. String and byte operations now report overflow or allocation failures instead of proceeding with invalid or unavailable output sizes. Tab expansion handles zero tab stops and line breaks consistently. On MSVC, invalid path-like arguments to spawnv receive a clearer error; embedded-null errors remain unchanged.

Open Graph Description: Summary Follow up the Windows runtime fixes in #9406, without C API, ctypes, PyO3, dependency, or CI changes. Reject WSARecvFromInto requests larger than their writable buffer before starting I/O....

X Description: Summary Follow up the Windows runtime fixes in #9406, without C API, ctypes, PyO3, dependency, or CI changes. Reject WSARecvFromInto requests larger than their writable buffer before starting I/O....

Opengraph URL: https://github.com/RustPython/RustPython/pull/9412

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:79e7fbed-199e-58f5-a22d-97efddfb6414
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8B4C:16E4ED:2FCEC5:3C634E:6B01F7B2
html-safe-nonceed00259483a890bc4b2db5ae8e5558570eff0bc959181905401c68da4ba4a1c0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjRDOjE2RTRFRDoyRkNFQzU6M0M2MzRFOjZCMDFGN0IyIiwidmlzaXRvcl9pZCI6IjM5NTE4NDc4MTUxMjYzMTY5NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7497e5c2eda5d9b83e74cf6ecc1e47bbf77fb7f77f4f9d6b840abfff0c6f482b
hovercard-subject-tagpull_request:5043780367
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9412/files
twitter:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
og:image:altSummary Follow up the Windows runtime fixes in #9406, without C API, ctypes, PyO3, dependency, or CI changes. Reject WSARecvFromInto requests larger than their writable buffer before starting I/O....
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9412/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9412%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9412%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9412/files
Reloadhttps://github.com/RustPython/RustPython/pull/9412/files
Reloadhttps://github.com/RustPython/RustPython/pull/9412/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowone:windows-runtime-followupshttps://github.com/youknowone/RustPython/tree/windows-runtime-followups
Conversation 3 https://github.com/RustPython/RustPython/pull/9412
Commits 1 https://github.com/RustPython/RustPython/pull/9412/commits
Checks 28 https://github.com/RustPython/RustPython/pull/9412/checks
Files changed https://github.com/RustPython/RustPython/pull/9412/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9412/files
Fix Windows runtime validation and 32-bit string size overflows https://github.com/RustPython/RustPython/pull/9412/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/9412/files
bd68b55 Fix Windows runtime validation and 32-bit string size overflows youknowone Oct 28, 2026 https://github.com/RustPython/RustPython/pull/9412/commits/bd68b554baac1b0895f56ccc5af9a3d152a54ec9
Clear filters https://github.com/RustPython/RustPython/pull/9412/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9412/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9412/files
test_sock_lowlevel.py https://github.com/RustPython/RustPython/pull/9412/files#diff-80001b2e1f4874e8d3bb4ff5cb5726de0453614831d477b6d7ef36dfa437d17c
test_os.py https://github.com/RustPython/RustPython/pull/9412/files#diff-0c3c0e7d77a166e9089c5ddcc9d2db7c4fab9528044dec1fda4b3a6be569f784
str.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-7ee55fb44b28d7414fad35b96a11ccce327227a8175a9337f8ff3dda5304033e
overlapped.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-bb8ee5bb0761c7423d34995edf5470ad459baa28266d730cbad6080a05f05893
anystr.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
bytearray.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
bytes.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
str.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
bytes_inner.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-94a4e578864d9ec94d59e2b7f57ea8f5a67aa734d28847c8921202237f2156b7
nt.rs https://github.com/RustPython/RustPython/pull/9412/files#diff-b6dbcd2c4153830809b8a9bda455dd41046ee3d8db21e0e79b636a15dde0d936
Lib/test/test_asyncio/test_sock_lowlevel.pyhttps://github.com/RustPython/RustPython/pull/9412/files#diff-80001b2e1f4874e8d3bb4ff5cb5726de0453614831d477b6d7ef36dfa437d17c
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/Lib/test/test_asyncio/test_sock_lowlevel.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-80001b2e1f4874e8d3bb4ff5cb5726de0453614831d477b6d7ef36dfa437d17c
https://github.com/RustPython/RustPython/pull/9412/files#diff-80001b2e1f4874e8d3bb4ff5cb5726de0453614831d477b6d7ef36dfa437d17c
Lib/test/test_os/test_os.pyhttps://github.com/RustPython/RustPython/pull/9412/files#diff-0c3c0e7d77a166e9089c5ddcc9d2db7c4fab9528044dec1fda4b3a6be569f784
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/Lib/test/test_os/test_os.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-0c3c0e7d77a166e9089c5ddcc9d2db7c4fab9528044dec1fda4b3a6be569f784
https://github.com/RustPython/RustPython/pull/9412/files#diff-0c3c0e7d77a166e9089c5ddcc9d2db7c4fab9528044dec1fda4b3a6be569f784
crates/common/src/str.rshttps://github.com/RustPython/RustPython/pull/9412/files#diff-7ee55fb44b28d7414fad35b96a11ccce327227a8175a9337f8ff3dda5304033e
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/crates/common/src/str.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-7ee55fb44b28d7414fad35b96a11ccce327227a8175a9337f8ff3dda5304033e
https://github.com/RustPython/RustPython/pull/9412/files#diff-7ee55fb44b28d7414fad35b96a11ccce327227a8175a9337f8ff3dda5304033e
https://github.com/RustPython/RustPython/pull/9412/files#diff-7ee55fb44b28d7414fad35b96a11ccce327227a8175a9337f8ff3dda5304033e
crates/stdlib/src/overlapped.rshttps://github.com/RustPython/RustPython/pull/9412/files#diff-bb8ee5bb0761c7423d34995edf5470ad459baa28266d730cbad6080a05f05893
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/crates/stdlib/src/overlapped.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-bb8ee5bb0761c7423d34995edf5470ad459baa28266d730cbad6080a05f05893
https://github.com/RustPython/RustPython/pull/9412/files#diff-bb8ee5bb0761c7423d34995edf5470ad459baa28266d730cbad6080a05f05893
https://github.com/RustPython/RustPython/pull/9412/files#diff-bb8ee5bb0761c7423d34995edf5470ad459baa28266d730cbad6080a05f05893
crates/vm/src/anystr.rshttps://github.com/RustPython/RustPython/pull/9412/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/crates/vm/src/anystr.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/9412/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/9412/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
crates/vm/src/builtins/bytearray.rshttps://github.com/RustPython/RustPython/pull/9412/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/crates/vm/src/builtins/bytearray.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
https://github.com/RustPython/RustPython/pull/9412/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
crates/vm/src/builtins/bytes.rshttps://github.com/RustPython/RustPython/pull/9412/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/crates/vm/src/builtins/bytes.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
https://github.com/RustPython/RustPython/pull/9412/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
crates/vm/src/builtins/str.rshttps://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
View file https://github.com/youknowone/RustPython/blob/bd68b554baac1b0895f56ccc5af9a3d152a54ec9/crates/vm/src/builtins/str.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9412/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/9412/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9412/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9412/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.