Skip to content
Permalink
Browse files
Improve capacity enhancing conditions
  • Loading branch information
matz committed Jan 6, 2017
1 parent c6a1172 commit 885d929398cf6962f3b0d292cf44105976f6c848
Showing 2 changed files with 3 additions and 3 deletions.
@@ -182,10 +182,10 @@ ary_expand_capa(mrb_state *mrb, struct RArray *a, size_t len)
capa *= 2;
}
else {
goto size_error;
capa = len;
}
}
if (capa < len || capa > MRB_INT_MAX) {
if (capa < len || capa > ARY_MAX_SIZE) {
goto size_error;
}

@@ -169,7 +169,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len)
capa *= 2;
}
else {
goto size_error;
capa = total;
}
}
if (capa < total || capa > MRB_INT_MAX) {

0 comments on commit 885d929

Please sign in to comment.