Skip to content

Commit d94064c

Browse files
fix(objects): fix a buffer overflow issue in find_sigid_algs. (#175)
1 parent 7d6d8b5 commit d94064c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/resty/openssl/objects.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ local function txtnid2nid(txt_nid)
5757
end
5858

5959
local function find_sigid_algs(nid)
60-
local out = ffi.new("int[0]")
60+
local out = ffi.new("int[1]")
6161
if C.OBJ_find_sigid_algs(nid, out, nil) == 0 then
6262
return 0, "objects.find_sigid_algs: invalid sigid " .. nid
6363
end
@@ -71,4 +71,4 @@ return {
7171
txtnid2nid = txtnid2nid,
7272
find_sigid_algs = find_sigid_algs,
7373
create = C.OBJ_create,
74-
}
74+
}

0 commit comments

Comments
 (0)