From: Matthew Wild Date: Sat, 26 Mar 2016 19:55:08 +0000 (+0000) Subject: certmanager: Explicitly tonumber() version number segments before doing arithmetic... X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=599d774b1827672b2ab67b1f6f70c61141191cdb;p=prosody.git certmanager: Explicitly tonumber() version number segments before doing arithmetic and avoid relying on implicit coercion (thanks David Favro) --- diff --git a/core/certmanager.lua b/core/certmanager.lua index a4c9d891..29a5a6c8 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -36,7 +36,7 @@ local resolve_path = require"util.paths".resolve_relative_path; local config_path = prosody.paths.config; local luasec_major, luasec_minor = ssl._VERSION:match("^(%d+)%.(%d+)"); -local luasec_version = luasec_major * 100 + luasec_minor; +local luasec_version = tonumber(luasec_major) * 100 + tonumber(luasec_minor); local luasec_has = { -- TODO If LuaSec ever starts exposing these things itself, use that instead cipher_server_preference = luasec_version >= 2;