diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-01-21 17:59:49 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-01-21 18:01:12 +0900 |
| commit | c48aef0b653ba83452c97b1d1017869de2a846b9 (patch) | |
| tree | ffd2f5b2a32ac96ff60e2361c86bc0f4a95b1d9c /src | |
| parent | 873b96bebc6751b2bb6f4488cdaf316c6f2eef9f (diff) | |
| download | mruby-c48aef0b653ba83452c97b1d1017869de2a846b9.tar.gz mruby-c48aef0b653ba83452c97b1d1017869de2a846b9.zip | |
Stack position may be bigger than stack bottom; fix #3401
This issue was reported by https://hackerone.com/titanous
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -137,6 +137,7 @@ stack_extend_alloc(mrb_state *mrb, int room, int keep) size_t size = mrb->c->stend - mrb->c->stbase; size_t off = mrb->c->stack - mrb->c->stbase; + if (off > size) size = off; #ifdef MRB_STACK_EXTEND_DOUBLING if (room <= size) size *= 2; |
