Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Fix the log buffer bounds #14

Merged
merged 1 commit into from Jul 21, 2022
Merged

Conversation

vadorovsky
Copy link
Member

Change 150ee79 removed the size > buf.len() check, which was a
mistake, because we might write to a subslice of the whole buffer, so
then buf can be lower than LOG_BUF_CAPACITY.

This change compares size with min::(buf.len(), LOG_BUF_CAPACITY)
instead.

Fixes: 150ee79 ("Ensure log buffer bounds")
Signed-off-by: Michal Rostecki vadorovsky@gmail.com

Change 150ee79 removed the `size > buf.len()` check, which was a
mistake, because we might write to a subslice of the whole buffer, so
then `buf` can be lower than `LOG_BUF_CAPACITY`.

This change compares `size` with `min::(buf.len(), LOG_BUF_CAPACITY)`
instead.

Fixes: 150ee79 ("Ensure log buffer bounds")
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
@alessandrod alessandrod merged commit dc7e887 into aya-rs:main Jul 21, 2022
@vadorovsky vadorovsky deleted the bounds-verifier-2 branch July 21, 2022 13:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants