Skip to content

Fix ssl/net silently losing data past two gibibytes - #138

Merged
SeanTAllen merged 1 commit into
mainfrom
fix-i32-narrowing-ssl-net
Aug 2, 2026
Merged

Fix ssl/net silently losing data past two gibibytes#138
SeanTAllen merged 1 commit into
mainfrom
fix-i32-narrowing-ssl-net

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

Four methods in SSL narrowed a USize to I32 without checking. Past I32.max_value() the conversion wraps, so write and receive silently dropped data, send returned uninitialized memory, and read over-allocated its buffer.

write and receive now loop in chunks that fit in a C int. read and send cap the per-call length and let their callers' existing loops drain the rest.

Closes #121

Four methods in SSL narrowed a USize to I32 without checking.
Past I32.max_value the conversion wraps, so write and receive
silently dropped data, send returned uninitialized memory, and
read over-allocated its buffer. write and receive now loop in
chunks that fit in a C int. read and send cap the per-call
length and let their callers' existing loops drain the rest.

Closes #121
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Aug 2, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Aug 2, 2026
@SeanTAllen
SeanTAllen merged commit 8dbf430 into main Aug 2, 2026
16 checks passed
@SeanTAllen
SeanTAllen deleted the fix-i32-narrowing-ssl-net branch August 2, 2026 01:27
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Aug 2, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ssl/net narrows lengths to an int without checking

2 participants