-
-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lower capped RAND generators #2671
Conversation
good. |
Yes let's add a |
Sounds good!! Ill make that change. |
You can change one of them, for example |
Nice thx! :) error: this method could have a `#[must_use]` attribute
--> libafl/src/generators/mod.rs:108:5
|
108 | pub fn with_min_size(min_size: NonZeroUsize, max_size: NonZeroUsize) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_min_size(min_size: NonZeroUsize, max_size: NonZeroUsize) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: `-D clippy::must-use-candidate` implied by `-D clippy::pedantic`
= help: to override `-D clippy::pedantic` add `#[allow(clippy::must_use_candidate)]`
error: this method could have a `#[must_use]` attribute
--> libafl/src/generators/mod.rs:148:5
|
148 | pub fn with_min_size(min_size: NonZeroUsize, max_size: NonZeroUsize) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_min_size(min_size: NonZeroUsize, max_size: NonZeroUsize) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate |
|
The second error isn't related to your changes, sorry :) pub fn with_min_size(min_size: NonZeroUsize, max_size: NonZeroUsize) -> Self { to #[must_use]
pub fn with_min_size(min_size: NonZeroUsize, max_size: NonZeroUsize) -> Self { That should be all :) |
Done on this one!! |
Thank you! |
* Lower capped rand generators * Updated all references to RAND generators * Formatting updates * New RAND bytes generator constructor * Revert "Updated all references to RAND generators" This reverts commit 9daad89. * Revert "Formatting updates" This reverts commit ff2a61a. * cargo nightly format * Added must_use to with_min_size
Basically, there is a
min_size
aside from themax_size
in the RAND generators (RandBytesGenerator
andRandPrintablesGenerator
).This allows to generate rand bytes sequences from
min_size
tomax_size
, e.g. between 2 bytes and 4 bytes or 1 byte and 1 byte for that matter.Becomes extremely useful if we are aware of the recipient's acceptance bounds.
If not, simply keep
min_size
as 1 and the older behavior is restored.