From c00c6fd19b1170b9df9d47ba762517d8ef6bde15 Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Sat, 17 Mar 2018 19:59:23 -0700 Subject: Make fields containing lock objects readonly. If one of these fields is accidentally reassigned, it's possible for threads to be oblivious to an existing lock. By making the fields readonly, we will be notified at compile-time if we inadvertently redefine one of these fields. --- Duplicati/Server/WebServer/RESTMethods/Captcha.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Duplicati/Server/WebServer/RESTMethods/Captcha.cs') diff --git a/Duplicati/Server/WebServer/RESTMethods/Captcha.cs b/Duplicati/Server/WebServer/RESTMethods/Captcha.cs index ac4bec06a..bd7ad5d5d 100644 --- a/Duplicati/Server/WebServer/RESTMethods/Captcha.cs +++ b/Duplicati/Server/WebServer/RESTMethods/Captcha.cs @@ -38,7 +38,7 @@ namespace Duplicati.Server.WebServer.RESTMethods } } - private static object m_lock = new object(); + private static readonly object m_lock = new object(); private static Dictionary m_captchas = new Dictionary(); public static bool SolvedCaptcha(string token, string target, string answer) -- cgit v1.2.3