]> Cypherpunks repositories - gostls13.git/commit
internal/fuzz: fix chunk swap mutator
authorRoland Shoemaker <roland@golang.org>
Thu, 18 Nov 2021 19:40:48 +0000 (11:40 -0800)
committerRoland Shoemaker <roland@golang.org>
Fri, 19 Nov 2021 18:23:43 +0000 (18:23 +0000)
commit80cb59c0c15d2391f7b8d2571121f8213df70f7b
tree20d60b6292615d785b69f8c711e0853d4d35dd91
parenta94409660dbf05c1cdc2013aa2c7aa2489fe5c1c
internal/fuzz: fix chunk swap mutator

When swapping two chunks of bytes in a slice, don't pick chunks which
extend beyond the end of the slice. Also don't pick chunks which
intersect with each other.

Fixes #49047

Change-Id: I070eb1888d05ae849ec6122d01c40c45e602019f
Reviewed-on: https://go-review.googlesource.com/c/go/+/365175
Trust: Roland Shoemaker <roland@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
src/internal/fuzz/mutators_byteslice.go
src/internal/fuzz/mutators_byteslice_test.go