rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
78 stars 64 forks source link

Fix panic caused by rand_bytes() #179

Closed vibharya closed 1 year ago

vibharya commented 1 year ago

Signed-off-by: Vibha Acharya vibharya@amazon.co.uk

Summary of the PR

rand_bytes() causes a panic when number of bytes requested are not multiples of 4. 'main' panicked at 'attempt to subtract with overflow'

Relates to : #178

The unit test was testing for 8 which is why it passed.

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

andreeaflorescu commented 1 year ago

Can you also add the following to your commit message: Fixes: https://github.com/rust-vmm/vmm-sys-util/issues/178

This way the issue will be closed when we merged the PR and we also trace it back when doing a git log.

andreeaflorescu commented 1 year ago

Please update the changelog to specify the bug you fixed. This is now part of the requirements for a PR.

There is still the changelog update needed.