From 47b99608cfb1250b6abf2481e14fee4e7f63a273 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Tue, 1 Feb 2022 00:01:10 -0800 Subject: [PATCH] Updated matching algorithm for ID_LOCK --- meshcore/agentcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 6a0129b..a8e9043 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -3912,7 +3912,7 @@ void MeshServer_ConnectEx(MeshAgentHostContainer *agent) #ifdef WIN32 if (agent->ID_LOCK[0] != 0) { - if(f->datalength > sizeof(agent->ID_LOCK) || strncasecmp(agent->ID_LOCK, f->data, f->datalength)!=0) + if (f->datalength > sizeof(agent->ID_LOCK) || (strnlen_s(agent->ID_LOCK, sizeof(agent->ID_LOCK)) != f->datalength && strncasecmp(agent->ID_LOCK, f->data, f->datalength) != 0)) { printf("agentcore: ServerID Lock: ServerID MISMATCH for: %s\n", host); free(host); free(path);