Skip to content

Conversation

@xmoezzz
Copy link

@xmoezzz xmoezzz commented Dec 3, 2025

When n is zero, the loop for (size_t i = n; i-- > 0;) never enters the body but still wraps i from 0 to SIZE_MAX, which triggers UBSan.
Add an early if (n == 0) return 0; to keep the behaviour unchanged while avoiding the warning.

Fix #407

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.

Security: size_t overflow in jas_stream_peek

1 participant