Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Jan 1, 2025
1 parent 028dd58 commit 9e9e281
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xalgor.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static int openssl_xalgor_get(lua_State* L)
}
else
lua_pushnil(L);
if (type == V_ASN1_UNDEF)
if (type == V_ASN1_UNDEF || val == NULL)
lua_pushnil(L);
else
{
Expand Down
2 changes: 2 additions & 0 deletions test/0.misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ function testAll()
local data = f:read('*a')
f:close()

if not openssl.lhash_read then return end

local conf = assert(openssl.lhash_read(data))
local t = conf:parse(false)
lu.assertIsTable(t)
Expand Down
4 changes: 2 additions & 2 deletions test/5.x509_req.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ local function _test_req(self, alg, params)
lu.assertEquals(req1:attr_count(), cnt)

lu.assertEquals(req1:version(), 0)
lu.assertEquals(req1:version(1), true)
lu.assertEquals(req1:version(), 1)
lu.assertEquals(req1:version(0), true)
lu.assertEquals(req1:version(), 0)
assert(req1:version(0))

lu.assertEquals(req1:subject():tostring(), self.subject:tostring())
Expand Down

0 comments on commit 9e9e281

Please sign in to comment.