lua-cmsgpack icon indicating copy to clipboard operation
lua-cmsgpack copied to clipboard

Wrong size passed into realloc on delete of buf

Open tmiv opened this issue 10 years ago • 1 comments

In mp_buf_free in file lua_cmsgpack.c line 133 reads mp_realloc(buf->L, buf->b, buf->len, 0); when it should read mp_realloc(buf->L, buf->b, buf->len + buf->free, 0);

realloc is passed the wrong osize. That can be problematic if the implementation of realloc is sensitive to it.

tmiv avatar Mar 19 '15 20:03 tmiv

I think this has been fixed by https://github.com/antirez/lua-cmsgpack/commit/4d94cabed195ef47303f27e286aa0ab8e8f9a144

ensonic avatar Sep 30 '16 09:09 ensonic