mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
pack.c: check overflow before calling pack_x.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user