diff --git a/array/array_get.c b/array/array_get.c index 8ed51cd..2bd97b0 100644 --- a/array/array_get.c +++ b/array/array_get.c @@ -25,6 +25,6 @@ void* array_get(array* x,uint64 membersize,int64 pos) { if (__unlikely(pos+1<1)) return 0; if (__unlikely(!umult64(membersize,pos,&wanted))) return 0; - if (__unlikely((int64)wanted >= x->allocated)) return 0; + if (__unlikely((int64)wanted >= x->allocated || wanted>=x->initialized)) return 0; return x->p+pos*membersize; }