mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-27 05:10:43 +00:00
prog: fix crash in blob mutation
If we deserialized a huge blob (larger than max blob size), then we can get a negative size in the "Insert random bytes" case at: if r := int(maxLen) - len(data); n > r { n = r } Don't insert bytes if data is already larger than maxLen.
This commit is contained in:
parent
cf49ed5769
commit
3e5d1beb82
@ -465,7 +465,7 @@ var mutateDataFuncs = [...]func(r *randGen, data []byte, minLen, maxLen uint64)
|
||||
},
|
||||
// Insert random bytes.
|
||||
func(r *randGen, data []byte, minLen, maxLen uint64) ([]byte, bool) {
|
||||
if len(data) == 0 {
|
||||
if len(data) == 0 || uint64(len(data)) >= maxLen {
|
||||
return data, false
|
||||
}
|
||||
n := r.Intn(16) + 1
|
||||
|
Loading…
Reference in New Issue
Block a user