aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encodingexec.go')
-rw-r--r--prog/encodingexec.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/prog/encodingexec.go b/prog/encodingexec.go
index c15eb25bc..e0c7ec59d 100644
--- a/prog/encodingexec.go
+++ b/prog/encodingexec.go
@@ -52,6 +52,8 @@ const (
const (
ExecBufferSize = 4 << 20 // keep in sync with kMaxInput in executor.cc
ExecNoCopyout = ^uint64(0)
+
+ execMaxCommands = 1000 // executor knows about this constant (kMaxCommands)
)
var ErrExecBufferTooSmall = errors.New("encodingexec: provided buffer is too small")
@@ -72,7 +74,7 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) {
w.serializeCall(c)
}
w.write(execInstrEOF)
- if w.eof {
+ if w.eof || w.copyoutSeq > execMaxCommands {
return 0, ErrExecBufferTooSmall
}
return len(buffer) - len(w.buf), nil