Skip to content

Commit

Permalink
issue #208 check for overflow when resizing array
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Feb 17, 2021
1 parent a3b933a commit 4861459
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ltable.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ static int ravi_resize_array(lua_State *L, RaviArray *t, unsigned int new_size,
}
/* make sure new size is not going to overflow */
unsigned int size;
uint64_t next_size = t->size + 10;
uint64_t next_size = (uint64_t)t->size + 10;
if (new_size < next_size) {
size = (unsigned int)next_size;
if (size != next_size)
Expand Down

0 comments on commit 4861459

Please sign in to comment.