Skip to content

Commit 2c1d335

Browse files
Copilotbytemain
andauthored
Guard certutil read and close
Agent-Logs-Url: https://github.com/version-fox/vfox-python/sessions/130dc982-32c0-4ae6-8db0-e62d21f8918d Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent 67fb703 commit 2c1d335

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/util.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,12 @@ local function verifyUvBuildArchive(path, sha256)
462462
error("Unable to verify uv-build archive sha256 for " .. path .. ": certutil command could not be started")
463463
end
464464

465-
local output = handle:read("*a")
466-
handle:close()
467-
if output == nil then
465+
local readOk, output = pcall(function()
466+
local data = handle:read("*a")
467+
handle:close()
468+
return data
469+
end)
470+
if not readOk or output == nil then
468471
error("Unable to verify uv-build archive sha256 for " .. path .. ": failed to read certutil output")
469472
end
470473
local actualSha256

0 commit comments

Comments
 (0)