Skip to content

Commit 1054d12

Browse files
committed
src/openssl.c: save top before calling luaL_buffinit
1 parent 4783a54 commit 1054d12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/openssl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11929,10 +11929,11 @@ static _Bool cipher_update_(lua_State *L, EVP_CIPHER_CTX *ctx, luaL_Buffer *B, i
1192911929
static int cipher_update(lua_State *L) {
1193011930
EVP_CIPHER_CTX *ctx = checksimple(L, 1, CIPHER_CLASS);
1193111931
luaL_Buffer B;
11932+
int top = lua_gettop(L);
1193211933

1193311934
luaL_buffinit(L, &B);
1193411935

11935-
if (!cipher_update_(L, ctx, &B, 2, lua_gettop(L)))
11936+
if (!cipher_update_(L, ctx, &B, 2, top))
1193611937
goto sslerr;
1193711938

1193811939
luaL_pushresult(&B);
@@ -11951,10 +11952,11 @@ static int cipher_final(lua_State *L) {
1195111952
luaL_Buffer B;
1195211953
size_t block;
1195311954
int out;
11955+
int top = lua_gettop(L);
1195411956

1195511957
luaL_buffinit(L, &B);
1195611958

11957-
if (!cipher_update_(L, ctx, &B, 2, lua_gettop(L)))
11959+
if (!cipher_update_(L, ctx, &B, 2, top))
1195811960
goto sslerr;
1195911961

1196011962
block = EVP_CIPHER_CTX_block_size(ctx);

0 commit comments

Comments
 (0)