diff options
| author | Veronica Radu <veronicaradu@google.com> | 2019-09-24 16:31:31 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2019-09-24 20:13:37 +0200 |
| commit | e38a6630eb6b89a4b3c344dc62ecb3b60f078028 (patch) | |
| tree | 3912ffcb263c326b2fb6fefb978edfd05cfb1d5d /prog/rand.go | |
| parent | 38634e3316fa12223ea9988c9a65d778572a20a4 (diff) | |
syz-manager: fix unwanted syscalls that were enabled
Update #1424
Diffstat (limited to 'prog/rand.go')
| -rw-r--r-- | prog/rand.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/prog/rand.go b/prog/rand.go index f8c640161..1b02dc728 100644 --- a/prog/rand.go +++ b/prog/rand.go @@ -492,8 +492,10 @@ func (r *randGen) nOutOf(n, outOf int) bool { func (r *randGen) generateCall(s *state, p *Prog, insertionPoint int) []*Call { idx := 0 - if s.ct == nil || insertionPoint <= 0 { + if s.ct == nil { idx = r.Intn(len(r.target.Syscalls)) + } else if insertionPoint <= 0 { + idx = s.ct.enabledCalls[r.Intn(len(s.ct.enabledCalls))].ID } else { call := -1 if len(p.Calls) != 0 { |
