From cfcd15e60dba16697929dc28938e32a0f2ebcb1a Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Thu, 22 Aug 2024 10:31:01 -0400 Subject: [PATCH] Address concurrent map read issue --- cric/cric.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cric/cric.go b/cric/cric.go index d29b261..166fb4a 100644 --- a/cric/cric.go +++ b/cric/cric.go @@ -147,6 +147,8 @@ func UpdateCMSRecords(cricRecords cmsauth.CricRecords) { // FindUser finds user info in cric records for given cert subject func FindUser(subjects []string) (cmsauth.CricEntry, error) { + cmsRecordsLock.Lock() + defer cmsRecordsLock.Unlock() for _, s := range subjects { s = strings.Replace(s, "CN=", "", -1) if r, ok := cmsRecords[s]; ok {