From c84501fe70ad8b8ca637daebb75eed7fcc707f6a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 28 Mar 2019 19:01:25 +0100 Subject: prog: fix a bunch of bugs in parsing Add fuzzer for Deserialize and fix 5 or so bugs it found. Fixes #1086 --- prog/alloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/alloc.go') diff --git a/prog/alloc.go b/prog/alloc.go index c47fc703d..344ec7a0e 100644 --- a/prog/alloc.go +++ b/prog/alloc.go @@ -57,7 +57,7 @@ func (ma *memAlloc) alloc(r *randGen, size0 uint64) uint64 { } size := (size0 + memAllocGranule - 1) / memAllocGranule end := ma.size - size - for start := uint64(0); start < end; start++ { + for start := uint64(0); start <= end; start++ { empty := true for i := uint64(0); i < size; i++ { if ma.get(start + i) { -- cgit mrf-deployment