diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2016-10-21 18:25:45 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@google.com> | 2016-11-22 15:56:24 +0100 |
| commit | c1c3a73cd976f966bf74d6bbcc126b559b43e147 (patch) | |
| tree | 4197c386974fc7ded68147909c56221ac85490eb | |
| parent | 20468be84d98f3bcc046c4313359c07559e07d06 (diff) | |
prog: fix checks for max and min len when mutating a bin blob
| -rw-r--r-- | prog/mutation.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/mutation.go b/prog/mutation.go index 8d5fa36a4..80b7cdf54 100644 --- a/prog/mutation.go +++ b/prog/mutation.go @@ -388,14 +388,14 @@ func mutateData(r *randGen, data []byte, minLen, maxLen int) []byte { r.choose( 100, func() { // Append byte. - if len(data) == maxLen { + if len(data) >= maxLen { return } data = append(data, byte(r.rand(256))) }, 100, func() { // Remove byte. - if len(data) == minLen { + if len(data) <= minLen { return } if len(data) == 0 { |
