From 486145900b44b47732509b47c6c8c6c16460d4e6 Mon Sep 17 00:00:00 2001 From: Dibyendu Majumdar Date: Wed, 17 Feb 2021 20:08:23 +0000 Subject: [PATCH] issue #208 check for overflow when resizing array --- src/ltable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ltable.c b/src/ltable.c index cf2baf0..4bdd5fd 100644 --- a/src/ltable.c +++ b/src/ltable.c @@ -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)