Skip to content
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

Fix an inconsistency in the error message and a comment in callSeqGenFuncCorpusHead #347

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions fuzzing/fuzzer_worker_sequence_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package fuzzing

import (
"fmt"
"math/big"

"github.com/crytic/medusa/fuzzing/calls"
"github.com/crytic/medusa/fuzzing/valuegeneration"
"github.com/crytic/medusa/utils"
"github.com/crytic/medusa/utils/randomutils"
"math/big"
)

// CallSequenceGenerator generates call sequences iteratively per element, for use in fuzzing campaigns. It is attached
Expand Down Expand Up @@ -336,10 +337,10 @@ func callSeqGenFuncCorpusHead(sequenceGenerator *CallSequenceGenerator, sequence
// Obtain a call sequence from the corpus
corpusSequence, err := sequenceGenerator.worker.fuzzer.corpus.RandomMutationTargetSequence()
if err != nil {
return fmt.Errorf("could not obtain corpus call sequence for tail mutation: %v", err)
return fmt.Errorf("could not obtain corpus call sequence for head mutation: %v", err)
}

// Determine a random position to slice the call sequence.
// Determine the length of the slice to be copied in the head.
maxLength := utils.Min(len(sequence), len(corpusSequence))
copy(sequence, corpusSequence[:maxLength])

Expand Down
Loading