diff options
| author | Shulhan <ms@kilabit.info> | 2023-12-18 01:57:46 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-12-18 01:57:46 +0700 |
| commit | 207cc263d4f28e11af896f0b1e3fc06d305c2a62 (patch) | |
| tree | 9afb9e9a1f179227b45fc74cd40edbd98b3c9848 /session.go | |
| parent | 1640caca8245096a7fb1bc6f1b1e03881ce5824e (diff) | |
| download | awwan-207cc263d4f28e11af896f0b1e3fc06d305c2a62.tar.xz | |
all: fix panic due to out of range when running "#require" statement
Diffstat (limited to 'session.go')
| -rw-r--r-- | session.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -414,6 +414,10 @@ func (ses *Session) close() (err error) { // executeRequires run the "#require:" statements from line 0 until // the start argument in the local system. func (ses *Session) executeRequires(req *ExecRequest, pos linePosition) (err error) { + if pos.start >= int64(len(req.script.requires)) { + return nil + } + var ( stmt *Statement x int64 |
