Changeset

7319:afa83f3ccaad

certmanager: Explicitly tonumber() version number segments before doing arithmetic and avoid relying on implicit coercion (thanks David Favro)
author Matthew Wild <mwild1@gmail.com>
date Sat, 26 Mar 2016 19:55:08 +0000
parents 7317:a2dce746599b
children 7320:3849b5187d47 7321:a7199fc8a50e
files core/certmanager.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/certmanager.lua	Fri Mar 25 16:09:34 2016 +0100
+++ b/core/certmanager.lua	Sat Mar 26 19:55:08 2016 +0000
@@ -36,7 +36,7 @@
 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;