From a63c51c8df090726c654b239d15568a6d54b9c06 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 26 Sep 2012 09:00:01 -0400 Subject: Ensure Lua stack has enough elements in `lstring_iconv()`; src/textadept.c Thanks to Gilles for pointing out that I left this part out of his patch. --- src/textadept.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/textadept.c b/src/textadept.c index 9be6c5e1..fa222392 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1434,7 +1434,7 @@ static int lstring_iconv(lua_State *L) { if (errno == E2BIG) { // Buffer was too small to store converted string. Push the partially // converted string for later concatenation. - lua_pushlstring(L, outbuf, outbufp - outbuf), n++; + lua_checkstack(L, 2), lua_pushlstring(L, outbuf, outbufp - outbuf), n++; outbufp = outbuf, outbytesleft = bufsize; } else { free(outbuf), iconv_close(cd); -- cgit v1.2.3