mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
unpack.c: check if srcidx is shorter than srclen for safety.
This commit is contained in:
@@ -1525,7 +1525,7 @@ pack_unpack(mrb_state *mrb, mrb_value str, int single)
|
||||
break;
|
||||
}
|
||||
|
||||
while (count != 0) {
|
||||
while (count != 0 && srcidx < srclen) {
|
||||
if (srclen - srcidx < size) {
|
||||
while (count-- > 0) {
|
||||
mrb_ary_push(mrb, result, mrb_nil_value());
|
||||
|
||||
Reference in New Issue
Block a user