Skip to content

Prevent assertion from always failing - #1

Open
scfarley wants to merge 2 commits into
KlaraSystems:masterfrom
scfarley:master
Open

Prevent assertion from always failing#1
scfarley wants to merge 2 commits into
KlaraSystems:masterfrom
scfarley:master

Conversation

@scfarley

Copy link
Copy Markdown

Casting SIZE_MAX to off_t results in -1, causing the assertion to always
fail. Change the assertion to verify that clip, cast to size_t, does
not exceed the data size of the buffer.

scfarley added 2 commits June 10, 2026 10:34
Casting SIZE_MAX to off_t results in -1, causing the assertion to always
fail.  Change the assertion to verify that clip, cast to size_t, does
not exceed the data size of the buffer.
Cast values to unsigned types to safely compare sizes and offsets
without truncation.
@scfarley

Copy link
Copy Markdown
Author

After fixing the assert, I noticed that syncing some large files had become excruciatingly slow. The second commit fixes that issue.

dsh2dsh added a commit to dsh2dsh/freebsd-ports that referenced this pull request Jun 23, 2026
@dsh2dsh

dsh2dsh commented Jun 23, 2026

Copy link
Copy Markdown

Thanks! It fixed my problem.

@scfarley

Copy link
Copy Markdown
Author

Thanks! It fixed my problem.

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants