From 3f553abf1d1fa2c60c0c85f2f2d6007d15e8747b Mon Sep 17 00:00:00 2001 From: Maks Naumov Date: Wed, 11 Apr 2018 23:53:59 +0300 Subject: [PATCH] Use correct sizeof value (#426) * Use correct sizeof() value * Use correct size for Zero() --- src/Cedar/Admin.c | 6 +++--- src/Cedar/Server.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cedar/Admin.c b/src/Cedar/Admin.c index 680f3a93..65987f54 100644 --- a/src/Cedar/Admin.c +++ b/src/Cedar/Admin.c @@ -1619,7 +1619,7 @@ UINT StGetHubMsg(ADMIN *a, RPC_MSG *t) else { FreeRpcMsg(t); - Zero(t, sizeof(t)); + Zero(t, sizeof(RPC_MSG)); t->Msg = GetHubMsg(h); @@ -6304,7 +6304,7 @@ UINT StGetLink(ADMIN *a, RPC_CREATE_LINK *t) StrCpy(hubname, sizeof(hubname), t->HubName); FreeRpcCreateLink(t); - Zero(t, sizeof(t)); + Zero(t, sizeof(RPC_CREATE_LINK)); StrCpy(t->HubName, sizeof(t->HubName), hubname); Lock(k->lock); @@ -7750,7 +7750,7 @@ UINT StGetHubRadius(ADMIN *a, RPC_RADIUS *t) return ERR_HUB_NOT_FOUND; } - Zero(t, sizeof(t)); + Zero(t, sizeof(RPC_RADIUS)); //GetRadiusServer(h, t->RadiusServerName, sizeof(t->RadiusServerName), // &t->RadiusPort, t->RadiusSecret, sizeof(t->RadiusSecret)); GetRadiusServerEx(h, t->RadiusServerName, sizeof(t->RadiusServerName), diff --git a/src/Cedar/Server.c b/src/Cedar/Server.c index c87ceba6..4f9d3a03 100644 --- a/src/Cedar/Server.c +++ b/src/Cedar/Server.c @@ -1341,7 +1341,7 @@ void GetServerCaps(SERVER *s, CAPSLIST *t) GetServerCapsMain(s, s->CapsListCache); } - Copy(t, s->CapsListCache, sizeof(s->CapsListCache)); + Copy(t, s->CapsListCache, sizeof(CAPSLIST)); } Unlock(s->CapsCacheLock); }