summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-pack
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-pack')
-rw-r--r--mrbgems/mruby-pack/src/pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c
index 17009ee6a..6da0a2c67 100644
--- a/mrbgems/mruby-pack/src/pack.c
+++ b/mrbgems/mruby-pack/src/pack.c
@@ -1191,8 +1191,8 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary)
if (dir == PACK_DIR_INVALID)
continue;
else if (dir == PACK_DIR_NUL) {
+ if (count > 0 && ridx > INT_MAX - count) goto overflow;
ridx += pack_x(mrb, mrb_nil_value(), result, ridx, count, flags);
- if (ridx < 0) goto overflow;
continue;
}