Skip to content

Replace unsound RefCell usage with UnsafeCell for error buffer - #595

Merged
sagebind merged 2 commits into
sagebind:mainfrom
kadiwa4:no_unsound_refcell
Oct 6, 2026
Merged

sagebind merged 2 commits into
sagebind:mainfrom
kadiwa4:no_unsound_refcell

Conversation

@kadiwa4

@kadiwa4 kadiwa4 commented Jan 12, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #589. RefCell's interface cannot be soundly used for this purpose because libcurl needs a long-lived mutable pointer to the error buffer.

For users, this PR should not have any visible effect except for slight changes in performance perhaps. The auto trait implementations (Send/!Sync/Freeze) of Easy2 do not change.

@sagebind sagebind added the soundness Potential soundness bug. label Oct 5, 2026

@sagebind sagebind left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Sorry about the delay.

@sagebind
sagebind merged commit 2ce8e33 into sagebind:main Oct 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

soundness Potential soundness bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation of the error buffer in Easy2 is unsound

2 participants