1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-06 18:43:46 +00:00

Updated matching algorithm for ID_LOCK

This commit is contained in:
Bryan Roe
2022-02-01 00:01:10 -08:00
parent be5cddf256
commit 47b99608cf

View File

@@ -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);